/*
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 { StraightNumericAxisBase } from "./StraightNumericAxisBase";
import { IScaler_$type } from "./IScaler";
import { markType, TypeRegistrar } from "igniteui-react-core";
import { HorizontalAxisLabelPanel } from "./HorizontalAxisLabelPanel";
import { ScalerParams } from "./ScalerParams";
import { Rect } from "igniteui-react-core";
import { RangeInfo } from "./RangeInfo";
import { HorizontalLogarithmicScaler } from "./HorizontalLogarithmicScaler";
import { FastHorizontalLinearScaler } from "./FastHorizontalLinearScaler";
import { isNaN_ } from "igniteui-react-core";
import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView";
/**
 * @hidden
 */
var NumericXAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(NumericXAxis, _super);
    function NumericXAxis() {
        var _this = _super.call(this) || this;
        _this.ab = NumericXAxis.$;
        _this.jo = _this.jm();
        return _this;
    }
    NumericXAxis.prototype.a3 = function () {
        return new NumericXAxisView(this);
    };
    NumericXAxis.prototype.gy = function (a) {
        _super.prototype.gy.call(this, a);
        this.l4 = a;
    };
    NumericXAxis.prototype.au = function () {
        if (this.cr) {
            return (TypeRegistrar.create('HorizontalSmartAxisLabelPanel'));
        }
        else {
            return new HorizontalAxisLabelPanel();
        }
    };
    NumericXAxis.prototype.jm = function () {
        var _this = this;
        var a = _super.prototype.jm.call(this);
        a.b.c = function (b) {
            if ((_this.ay == null || _this.ay.visibility == 0) && _this.ai != null) {
                _this.av.a9 = b;
                if (_this.ay != null && (_this.ay.location == 4 || _this.ay.location == 5)) {
                    _this.bh.ja();
                }
            }
        };
        a.k = function (b, c, d) { return _this.hm(c, d, b.z, b.b, false); };
        a.l = function (b, c, d, e) { return _this.hn(c, d, e, b.z); };
        a.m = function (b, c) {
            var d = b.y;
            var e = new ScalerParams(0, b.aa, b.z, _this.cb, d);
            return _this.dz(c, e);
        };
        a.q = function (b, c) { return true; };
        a.j = function (b) { return _this.gw(b.t, b.n, b.z, b.a, true); };
        a.e = function (b) {
            b.n = b.z.bottom;
            if (_this.ai != null && _this.ai.bh != null) {
                var c = b.n;
                var d = b.r;
                var e = _this.hh(c, d, b.aa, b.z, b.y, b.z.top, b.z.bottom);
                c = e.p0;
                d = e.p1;
                b.n = c;
                b.r = d;
            }
        };
        a.p = function (b, c, d) {
            var e = Math.round(c);
            return e >= Math.floor(b.z.left) && e <= Math.ceil(b.z.right);
        };
        return a;
    };
    NumericXAxis.prototype.dz = function (a, b) {
        if (this.ln != null) {
            return this.ln.p(a, b);
        }
        return this.lm.p(a, b);
    };
    NumericXAxis.prototype.d2 = function (a, b) {
        if (this.ln != null) {
            return this.ln.q(a, b);
        }
        return this.lm.q(a, b);
    };
    NumericXAxis.prototype.gt = function (a, b, c, d) {
        if (this.ln != null) {
            this.ln.v(a, b, c, d);
            return;
        }
        this.lm.v(a, b, c, d);
    };
    NumericXAxis.prototype.gs = function (a, b, c, d, e) {
        if (this.ln != null) {
            this.ln.u(a, b, c, d, e);
            return;
        }
        this.lm.u(a, b, c, d, e);
    };
    NumericXAxis.prototype.gu = function (a, b, c, d) {
        if (this.ln != null) {
            this.ln.j(a, b, c, d);
            return;
        }
        this.lm.j(a, b, c, d);
    };
    NumericXAxis.prototype.l5 = function (a, b) {
        if (this.bh == null || a == NaN || b == NaN) {
            return;
        }
        var c = this.ls(a, this);
        var d = this.ls(b, this);
        if (c == NaN || d == NaN) {
            return;
        }
        this.bh.o8 = new Rect(0, c, this.bh.o8.y, d - c, this.bh.o8.height);
    };
    NumericXAxis.prototype.jp = function (a, b, c, d) {
        var e = d;
        var f = _super.prototype.jp.call(this, a, b, c, d);
        var g = new ScalerParams(0, b, a, this.ca, c);
        var h = NaN;
        var i = NaN;
        if (!this.ca && b.right == 1) {
            i = this.kc;
        }
        else if (this.ca && b.left == 0) {
            h = this.kc;
        }
        if (isNaN_(h)) {
            h = this.d2(e.left, g);
        }
        if (isNaN_(i)) {
            i = this.d2(e.right, g);
        }
        var j = Math.min(h, i);
        var k = Math.max(h, i);
        this.kg = j;
        this.kf = k;
        f.k.add(((function () {
            var $ret = new RangeInfo();
            $ret.d = j;
            $ret.c = k;
            $ret.b = e.width;
            return $ret;
        })()));
        return f;
    };
    NumericXAxis.prototype.hd = function (a) {
        _super.prototype.hd.call(this, a);
        var b = this.bh != null ? this.bh.os : Rect.empty;
        var c = !b.isEmpty ? this.ja : Rect.empty;
        var d = this.i5();
        var e = this.i4();
        var f = this.jo.c(a, c, b, d, e);
        if (f != null) {
            this.kb = f.f.m;
            this.ke = f.f.l;
        }
    };
    NumericXAxis.prototype.ho = function (a, b) {
        _super.prototype.ho.call(this, a, b);
        if (b.height != a.height) {
            this.cn();
        }
    };
    NumericXAxis.prototype.get_a1 = function () {
        return 0;
    };
    Object.defineProperty(NumericXAxis.prototype, "a1", {
        get: function () {
            return this.get_a1();
        },
        enumerable: true,
        configurable: true
    });
    NumericXAxis.prototype.jr = function () {
        if (this.j2) {
            return new HorizontalLogarithmicScaler();
        }
        switch (this.ll) {
            case 0: return new FastHorizontalLinearScaler();
            case 1: return new HorizontalLogarithmicScaler();
        }
        return null;
    };
    NumericXAxis.prototype.j$c = function (a, b) {
        return this.d2.apply(this, arguments);
    };
    NumericXAxis.prototype.j$b = function (a, b) {
        return this.dz.apply(this, arguments);
    };
    NumericXAxis.prototype.j$d = function (a, b, c, d, e) {
        this.gs.apply(this, arguments);
    };
    NumericXAxis.prototype.j$e = function (a, b, c, d) {
        this.gt.apply(this, arguments);
    };
    NumericXAxis.prototype.j$f = function (a, b, c, d) {
        this.gu.apply(this, arguments);
    };
    Object.defineProperty(NumericXAxis.prototype, "j$a", {
        get: function () {
            return this.ca;
        },
        enumerable: true,
        configurable: true
    });
    NumericXAxis.$t = markType(NumericXAxis, 'NumericXAxis', StraightNumericAxisBase.$, [IScaler_$type]);
    return NumericXAxis;
}(StraightNumericAxisBase));
export { NumericXAxis };
/**
 * @hidden
 */
var NumericXAxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(NumericXAxisView, _super);
    function NumericXAxisView(a) {
        var _this = _super.call(this, a) || this;
        _this.bi = null;
        _this.bi = a;
        return _this;
    }
    NumericXAxisView.$t = markType(NumericXAxisView, 'NumericXAxisView', StraightNumericAxisBaseView.$);
    return NumericXAxisView;
}(StraightNumericAxisBaseView));
export { NumericXAxisView };
//# sourceMappingURL=NumericXAxis_combined.js.map
