/*
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 { StrategyBasedIndicator } from "./StrategyBasedIndicator";
import { CustomIndicatorStrategy } from "./CustomIndicatorStrategy";
import { String_$type, fromEnum, markType } from "igniteui-react-core/ES2015/type";
import { FinancialEventArgs } from "./FinancialEventArgs";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
/**
 * @hidden
 */
export class CustomIndicator extends StrategyBasedIndicator {
    constructor() {
        super(...arguments);
        this.qr = null;
        this.qq = null;
    }
    get_p5() {
        return new CustomIndicatorStrategy();
    }
    get p5() {
        return this.get_p5();
    }
    get_qi() {
        return CustomIndicator.$;
    }
    get qi() {
        return this.get_qi();
    }
    ph(a, b) {
        let c = this.md(a, b);
        let d = this.me(c);
        let e = new List$1(String_$type, 0);
        if (this.qq != null) {
            let f = new FinancialEventArgs(c.calculateFrom, c.calculateCount, c, d, this);
            this.qq(this, f);
            if (f.basedOn != null) {
                for (let g of fromEnum(f.basedOn)) {
                    e.add(g);
                }
            }
        }
        return e;
    }
    get indicator() {
        return this.qr;
    }
    set indicator(a) {
        this.qr = a;
        this.pp();
    }
    get basedOnColumns() {
        return this.qq;
    }
    set basedOnColumns(a) {
        this.qq = a;
    }
    pe(a, b) {
        super.pe(a, b);
        if (this.qr != null) {
            let c = this.md(a, b);
            if (b == 0) {
                return false;
            }
            if (!this.na(this.ph(a, b))) {
                return false;
            }
            this.qr(this, new FinancialEventArgs(a, b, c, this.me(c), this));
            if (this.p7(c) && this.mm != null) {
                this.mm.ck();
            }
            return true;
        }
        return false;
    }
}
CustomIndicator.$t = markType(CustomIndicator, 'CustomIndicator', StrategyBasedIndicator.$);
