/*
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 * as tslib_1 from "tslib";
import { FinancialSeries } from "./FinancialSeries";
import { DependencyProperty } from "igniteui-angular-core/ES5/DependencyProperty";
import { ISortingAxis_$type } from "./ISortingAxis";
import { Type, typeCast, markType } from "igniteui-angular-core/ES5/type";
import { Rect } from "igniteui-angular-core/ES5/Rect";
import { ScalerParams } from "./ScalerParams";
import { AxisRange } from "./AxisRange";
import { PropertyMetadata } from "igniteui-angular-core/ES5/PropertyMetadata";
import { isNaN_ } from "igniteui-angular-core/ES5/number";
/**
 * @hidden
 */
var FinancialOverlay = /** @class */ (function (_super) {
    tslib_1.__extends(FinancialOverlay, _super);
    function FinancialOverlay() {
        var _this = _super.call(this) || this;
        _this.pa = false;
        _this.pa = false;
        return _this;
    }
    FinancialOverlay.prototype.hs = function (a, b, c, d) {
        _super.prototype.hs.call(this, a, b, c, d);
        if (this.l0 != null && typeCast(ISortingAxis_$type, this.l0) !== null) {
            this.l0.i$i();
        }
        this.mg.bu.e(this.er);
        this.pb();
        if (this.ml != null) {
            this.ml.ck();
        }
        this.i5(true);
    };
    FinancialOverlay.prototype.get_du = function () {
        return true;
    };
    FinancialOverlay.prototype.is = function (a, b, c, d) {
        switch (b) {
            case "FastItemsSource":
                this.pa = false;
                break;
            case FinancialOverlay.$$p[0]:
                this.pa = false;
                this.i5(false);
                this.ic();
                break;
            case "XAxis":
                this.pa = false;
                break;
        }
        _super.prototype.is.call(this, a, b, c, d);
    };
    FinancialOverlay.prototype.bd = function () {
        if (this.be == 0) {
            return 1;
        }
        else {
            return _super.prototype.bd.call(this);
        }
    };
    FinancialOverlay.prototype.dg = function (a, b) {
        if (this.df(a, b)) {
            return true;
        }
        return false;
    };
    FinancialOverlay.prototype.ac = function () {
        _super.prototype.ac.call(this);
        this.i5(false);
    };
    FinancialOverlay.prototype.c8 = function (a) {
        var b = this.bz != null ? this.bz.indexOf(a) : -1;
        var c = this.bi.bs;
        c = c.copy();
        var d = this.bi.br;
        var e = new Rect(0, 0, 0, 1, 1);
        var f = this.lk(this.bi);
        var g = new ScalerParams(0, e, e, this.l0.b8, f);
        var h = new ScalerParams(0, e, e, this.ml.b8, f);
        h.b = this.ee();
        if (b >= 0 && Rect.l_op_Inequality(c, null) && Rect.l_op_Inequality(d, null)) {
            if (this.l0 != null) {
                var i = this.l0.dt(b, g);
                if (i < c.left + 0.1 * c.width) {
                    i = i + 0.4 * c.width;
                }
                if (i > c.right - 0.1 * c.width) {
                    i = i - 0.4 * c.width;
                }
                c.x = i - 0.5 * c.width;
            }
            if (this.ml != null && this.ms != null && this.mq != null && b < this.ms.count && b < this.mq.count) {
                var j = this.ml.dt(this.ms.item(b), h);
                var k = this.ml.dt(this.mq.item(b), h);
                if (!isNaN_(j) && !isNaN_(k)) {
                    var l = Math.abs(j - k);
                    if (c.height < l) {
                        c.height = l;
                        c.y = Math.min(j, k);
                    }
                    else {
                        if (j < c.top + 0.1 * c.height) {
                            j = j + 0.4 * c.height;
                        }
                        if (j > c.bottom - 0.1 * c.height) {
                            j = j - 0.4 * c.height;
                        }
                        c.y = j - 0.5 * c.height;
                    }
                }
            }
            this.bn.ap(this.bs, c, true);
        }
        return b >= 0;
    };
    FinancialOverlay.prototype.an = function (a) {
        if (a != null && a == this.ml && this.ms != null && this.mq != null) {
            return new AxisRange(this.ms.minimum, this.mq.maximum);
        }
        return null;
    };
    FinancialOverlay.$t = markType(FinancialOverlay, 'FinancialOverlay', FinancialSeries.$);
    return FinancialOverlay;
}(FinancialSeries));
export { FinancialOverlay };
Type.dep(DependencyProperty, PropertyMetadata, FinancialOverlay, 'raisePropertyChanged', ['IgnoreFirst:pc:pe', [1, 0]]);
//# sourceMappingURL=FinancialOverlay.js.map