/*
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 } from "igniteui-react-core";
import { VerticalAxisLabelPanel } from "./VerticalAxisLabelPanel";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { RangeInfo } from "./RangeInfo";
import { VerticalLogarithmicScaler } from "./VerticalLogarithmicScaler";
import { FastVerticalLinearScaler } from "./FastVerticalLinearScaler";
import { isNaN_ } from "igniteui-react-core";
import { StraightNumericAxisBaseView } from "./StraightNumericAxisBaseView";
/**
 * @hidden
 */
export let NumericYAxis = /*@__PURE__*/ (() => {
    class NumericYAxis extends StraightNumericAxisBase {
        constructor() {
            super();
            this.ab = NumericYAxis.$;
            this.jo = this.jm();
        }
        a3() {
            return new NumericYAxisView(this);
        }
        au() {
            return new VerticalAxisLabelPanel();
        }
        get_ch() {
            return true;
        }
        dy() {
            return this.ja.height;
        }
        dz(a, b) {
            if (this.ln != null) {
                return this.ln.p(a, b);
            }
            return this.lm.p(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);
        }
        d2(a, b) {
            if (this.ln != null) {
                return this.ln.q(a, b);
            }
            return this.lm.q(a, b);
        }
        gu(a, b, c, d) {
            if (this.ln != null) {
                this.ln.j(a, b, c, d);
                return;
            }
            this.lm.j(a, b, c, d);
        }
        l4(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, this.bh.o8.x, d, this.bh.o8.width, c - d);
        }
        jm() {
            let a = super.jm();
            a.b.c = (b) => {
                if (this.ay == null || this.ay.visibility == 0) {
                    this.av.a9 = b;
                    if (this.ay != null && (this.ay.location == 7 || this.ay.location == 6)) {
                        this.bh.ja();
                    }
                }
            };
            a.k = (b, c, d) => this.gw(c, d, b.z, b.b, false);
            a.l = (b, c, d, e) => this.gx(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.hm(b.t, b.n, b.z, b.a, true);
            a.e = (b) => {
                b.n = this.ay != null && (this.ay.location == 7 || this.ay.location == 3) ? b.z.right : b.z.left;
                let c = b.y;
                let d = new ScalerParams(0, b.aa, b.z, this.cb, c);
                if (this.ai != null && this.ai.bh != null) {
                    let e = b.n;
                    let f = b.r;
                    let g = this.hh(e, f, b.aa, b.z, b.y, b.z.left, b.z.right);
                    e = g.p0;
                    f = g.p1;
                    b.n = e;
                    b.r = f;
                }
            };
            a.p = (b, c, d) => {
                let e = Math.round(c);
                return e >= Math.floor(b.z.top) && e <= Math.ceil(b.z.bottom);
            };
            return a;
        }
        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.top == 0) {
                i = this.kc;
            }
            else if (this.ca && b.bottom == 1) {
                h = this.kc;
            }
            if (isNaN_(h)) {
                h = this.d2(e.bottom, g);
            }
            if (isNaN_(i)) {
                i = this.d2(e.top, g);
            }
            let j = Math.min(h, i);
            let k = Math.max(h, i);
            this.kg = j;
            this.kf = k;
            let l = ((() => {
                let $ret = new RangeInfo();
                $ret.d = j;
                $ret.c = k;
                $ret.b = e.height;
                return $ret;
            })());
            f.k.add(l);
            return f;
        }
        hd(a) {
            super.hd(a);
            let b = this.bh != null ? this.bh.os : Rect.empty;
            let c = this.ja;
            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 1;
        }
        get a1() {
            return this.get_a1();
        }
        jr() {
            if (this.j2) {
                return new VerticalLogarithmicScaler();
            }
            switch (this.ll) {
                case 0: return new FastVerticalLinearScaler();
                case 1: return new VerticalLogarithmicScaler();
            }
            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;
        }
    }
    NumericYAxis.$t = /*@__PURE__*/ markType(NumericYAxis, 'NumericYAxis', StraightNumericAxisBase.$, [IScaler_$type]);
    return NumericYAxis;
})();
/**
 * @hidden
 */
export let NumericYAxisView = /*@__PURE__*/ (() => {
    class NumericYAxisView extends StraightNumericAxisBaseView {
        constructor(a) {
            super(a);
            this.bi = null;
            this.bi = a;
        }
    }
    NumericYAxisView.$t = /*@__PURE__*/ markType(NumericYAxisView, 'NumericYAxisView', StraightNumericAxisBaseView.$);
    return NumericYAxisView;
})();
//# sourceMappingURL=NumericYAxis_combined.js.map
