/*
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 { 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
 */
export let NumericXAxis = /*@__PURE__*/ (() => {
    class NumericXAxis extends StraightNumericAxisBase {
        constructor() {
            super();
            this.ab = NumericXAxis.$;
            this.jo = this.jm();
        }
        a3() {
            return new NumericXAxisView(this);
        }
        gy(a) {
            super.gy(a);
            this.l4 = a;
        }
        au() {
            if (this.cr) {
                return (TypeRegistrar.create('HorizontalSmartAxisLabelPanel'));
            }
            else {
                return new HorizontalAxisLabelPanel();
            }
        }
        jm() {
            let a = super.jm();
            a.b.c = (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 = (b, c, d) => this.hm(c, d, b.z, b.b, false);
            a.l = (b, c, d, e) => this.hn(c, d, e, b.z);
            a.m = (b, c) => {
                let d = b.y;
                let e = new ScalerParams(0, b.aa, b.z, this.cb, d);
                return this.dz(c, e);
            };
            a.q = (b, c) => true;
            a.j = (b) => this.gw(b.t, b.n, b.z, b.a, true);
            a.e = (b) => {
                b.n = b.z.bottom;
                if (this.ai != null && this.ai.bh != null) {
                    let c = b.n;
                    let d = b.r;
                    let 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 = (b, c, d) => {
                let e = Math.round(c);
                return e >= Math.floor(b.z.left) && e <= Math.ceil(b.z.right);
            };
            return a;
        }
        dz(a, b) {
            if (this.ln != null) {
                return this.ln.p(a, b);
            }
            return this.lm.p(a, b);
        }
        d2(a, b) {
            if (this.ln != null) {
                return this.ln.q(a, b);
            }
            return this.lm.q(a, b);
        }
        gt(a, b, c, d) {
            if (this.ln != null) {
                this.ln.v(a, b, c, d);
                return;
            }
            this.lm.v(a, b, c, d);
        }
        gs(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);
        }
        gu(a, b, c, d) {
            if (this.ln != null) {
                this.ln.j(a, b, c, d);
                return;
            }
            this.lm.j(a, b, c, d);
        }
        l5(a, b) {
            if (this.bh == null || a == NaN || b == NaN) {
                return;
            }
            let c = this.ls(a, this);
            let 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);
        }
        jp(a, b, c, d) {
            let e = d;
            let f = super.jp(a, b, c, d);
            let g = new ScalerParams(0, b, a, this.ca, c);
            let h = NaN;
            let 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);
            }
            let j = Math.min(h, i);
            let k = Math.max(h, i);
            this.kg = j;
            this.kf = k;
            f.k.add(((() => {
                let $ret = new RangeInfo();
                $ret.d = j;
                $ret.c = k;
                $ret.b = e.width;
                return $ret;
            })()));
            return f;
        }
        hd(a) {
            super.hd(a);
            let b = this.bh != null ? this.bh.os : Rect.empty;
            let c = !b.isEmpty ? this.ja : Rect.empty;
            let d = this.i5();
            let e = this.i4();
            let f = this.jo.c(a, c, b, d, e);
            if (f != null) {
                this.kb = f.f.m;
                this.ke = f.f.l;
            }
        }
        ho(a, b) {
            super.ho(a, b);
            if (b.height != a.height) {
                this.cn();
            }
        }
        get_a1() {
            return 0;
        }
        get a1() {
            return this.get_a1();
        }
        jr() {
            if (this.j2) {
                return new HorizontalLogarithmicScaler();
            }
            switch (this.ll) {
                case 0: return new FastHorizontalLinearScaler();
                case 1: return new HorizontalLogarithmicScaler();
            }
            return null;
        }
        j$c(a, b) {
            return this.d2.apply(this, arguments);
        }
        j$b(a, b) {
            return this.dz.apply(this, arguments);
        }
        j$d(a, b, c, d, e) {
            this.gs.apply(this, arguments);
        }
        j$e(a, b, c, d) {
            this.gt.apply(this, arguments);
        }
        j$f(a, b, c, d) {
            this.gu.apply(this, arguments);
        }
        get j$a() {
            return this.ca;
        }
    }
    NumericXAxis.$t = /*@__PURE__*/ markType(NumericXAxis, 'NumericXAxis', StraightNumericAxisBase.$, [IScaler_$type]);
    return NumericXAxis;
})();
/**
 * @hidden
 */
export let NumericXAxisView = /*@__PURE__*/ (() => {
    class NumericXAxisView extends StraightNumericAxisBaseView {
        constructor(a) {
            super(a);
            this.bi = null;
            this.bi = a;
        }
    }
    NumericXAxisView.$t = /*@__PURE__*/ markType(NumericXAxisView, 'NumericXAxisView', StraightNumericAxisBaseView.$);
    return NumericXAxisView;
})();
//# sourceMappingURL=NumericXAxis_combined.js.map
