/*
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";
import { DependencyProperty } from "igniteui-react-core";
import { PropertyMetadata } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { AxisRange } from "./AxisRange";
import { isNaN_ } from "igniteui-react-core";
/**
 * @hidden
 */
export let StrategyBasedIndicator = /*@__PURE__*/ (() => {
    class StrategyBasedIndicator extends FinancialIndicator {
        constructor() {
            super();
            this.ab1();
        }
        ab1() {
            this.abm = this.abn;
            this.ab = this.ab0;
        }
        abt() {
            return -2147483648;
        }
        ab2(a) {
        }
        abv() {
            return -2147483648;
        }
        abs() {
            return -2147483648;
        }
        static ab6(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.abq.add(c);
            return d;
        }
        static ab5(a, b) {
            return StrategyBasedIndicator.ab6(a, b, "Period");
        }
        static ab3(a, b) {
            return StrategyBasedIndicator.ab6(a, b, "LongPeriod");
        }
        static ab7(a, b) {
            return StrategyBasedIndicator.ab6(a, b, "ShortPeriod");
        }
        aaz(a, b) {
            let c = this.xb(a, b);
            let d = this.xc(c);
            return this.abm.b(c, d);
        }
        aaw(a, b) {
            let c = this.xb(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.x7(this.aaz(a, b))) {
                return false;
            }
            let d = this.xc(c);
            if (this.aas != null) {
                c.minimumValue = this.aas.c;
                c.maximumValue = this.aas.b;
            }
            let e = this.abm.a(c, d);
            for (let f = 0; f < this.aa1 && f < c.indicatorColumn.count; f++) {
                c.indicatorColumn.item(f, NaN);
            }
            if (this.xh != null && this.abp(c)) {
                this.xh.c1();
            }
            return e;
        }
        abp(a) {
            if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
                let b = this.aas;
                this.aas = new AxisRange(a.minimumValue, a.maximumValue);
                return this.abo(b, this.aas);
            }
            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.aas;
            this.aas = new AxisRange(c, d);
            return this.abo(f, this.aas);
        }
        abo(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;
        }
        abu(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;
        }
        xb(a, b) {
            let c = super.xb(a, b);
            c.indicatorColumn = this.indicatorColumn;
            c.period = this.abu(this.abt());
            c.shortPeriod = this.abu(this.abv());
            c.longPeriod = this.abu(this.abs());
            c.multiplier = this.abr();
            return c;
        }
        abr() {
            return 1;
        }
        static ab4(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.abq.add("Multiplier");
            return c;
        }
        q5(a, b, c, d) {
            super.q5(a, b, c, d);
            if (StrategyBasedIndicator.abq.contains(b)) {
                if (this.xh != null && !this.xh.c1()) {
                    this.xf.b0.e(this.ib);
                    this.aaw(0, this.indicatorColumn.count);
                    if (this.aat.ca) {
                        this.aat.b8.g$i();
                    }
                    this.rn(false);
                }
            }
        }
    }
    StrategyBasedIndicator.$t = /*@__PURE__*/ markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
    StrategyBasedIndicator.abq = /*@__PURE__*/ new List$1(String_$type, 0);
    return StrategyBasedIndicator;
})();
