/*
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.uz();
        }
        uz() {
            this.uk = this.ul;
            this.ab = this.uy;
        }
        ur() {
            return -2147483648;
        }
        u0(a) {
        }
        ut() {
            return -2147483648;
        }
        uq() {
            return -2147483648;
        }
        static u4(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.uo.add(c);
            return d;
        }
        static u3(a, b) {
            return StrategyBasedIndicator.u4(a, b, "Period");
        }
        static u1(a, b) {
            return StrategyBasedIndicator.u4(a, b, "LongPeriod");
        }
        static u5(a, b) {
            return StrategyBasedIndicator.u4(a, b, "ShortPeriod");
        }
        tx(a, b) {
            let c = this.qt(a, b);
            let d = this.qu(c);
            return this.uk.b(c, d);
        }
        tu(a, b) {
            let c = this.qt(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.rp(this.tx(a, b))) {
                return false;
            }
            let d = this.qu(c);
            if (this.tq != null) {
                c.minimumValue = this.tq.c;
                c.maximumValue = this.tq.b;
            }
            let e = this.uk.a(c, d);
            for (let f = 0; f < this.tz && f < c.indicatorColumn.count; f++) {
                c.indicatorColumn.item(f, NaN);
            }
            if (this.q2 != null && this.un(c)) {
                this.q2.c0();
            }
            return e;
        }
        un(a) {
            if (!isNaN_(a.minimumValue) && !isNaN_(a.maximumValue) && a.specifiesRange) {
                let b = this.tq;
                this.tq = new AxisRange(a.minimumValue, a.maximumValue);
                return this.um(b, this.tq);
            }
            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.tq;
            this.tq = new AxisRange(c, d);
            return this.um(f, this.tq);
        }
        um(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;
        }
        us(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;
        }
        qt(a, b) {
            let c = super.qt(a, b);
            c.indicatorColumn = this.indicatorColumn;
            c.period = this.us(this.ur());
            c.shortPeriod = this.us(this.ut());
            c.longPeriod = this.us(this.uq());
            c.multiplier = this.up();
            return c;
        }
        up() {
            return 1;
        }
        static u2(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.uo.add("Multiplier");
            return c;
        }
        l7(a, b, c, d) {
            super.l7(a, b, c, d);
            if (StrategyBasedIndicator.uo.contains(b)) {
                if (this.q2 != null && !this.q2.c0()) {
                    this.qx.bx.e(this.fv);
                    this.tu(0, this.indicatorColumn.count);
                    if (this.tr.b7) {
                        this.tr.b5.g$i();
                    }
                    this.ml(false);
                }
            }
        }
    }
    StrategyBasedIndicator.$t = markType(StrategyBasedIndicator, 'StrategyBasedIndicator', FinancialIndicator.$);
    StrategyBasedIndicator.uo = new List$1(String_$type, 0);
    return StrategyBasedIndicator;
})();
