/*
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 { NumericAxisBase } from "./NumericAxisBase";
import { NumericScaleMode_$type } from "./NumericScaleMode";
import { DependencyProperty } from "igniteui-react-core";
import { NumericScaler } from "./NumericScaler";
import { enumGetBox, typeCast, markType, markDep } from "igniteui-react-core";
import { ArgumentNullException } from "igniteui-react-core";
import { LogarithmicScaler } from "./LogarithmicScaler";
import { PropertyMetadata } from "igniteui-react-core";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
var StraightNumericAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(StraightNumericAxisBase, _super);
    function StraightNumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.ln = null;
        _this.lr = false;
        _this.l1();
        return _this;
    }
    StraightNumericAxisBase.prototype.a3 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.gy = function (a) {
        _super.prototype.gy.call(this, a);
        this.lq = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "lp", {
        get: function () {
            return this.c(StraightNumericAxisBase.l3);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.l3, a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.lz = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.l1();
        c.g6("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.lo = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_lm = function () {
        if (this.ln == null) {
            this.l1();
        }
        return this.ln;
    };
    StraightNumericAxisBase.prototype.set_lm = function (a) {
        var b = this.ln != a;
        if (b) {
            var c = this.ln;
            this.ln = a;
            this.g6("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "lm", {
        get: function () {
            return this.get_lm();
        },
        set: function (a) {
            this.set_lm(a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.prototype.k8 = function (a, b, c, d, e, f, g) {
        var h = this.lm.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.l0 = function (a) {
        var b = this.lr;
        this.lr = true;
        a();
        this.lr = b;
    };
    StraightNumericAxisBase.prototype.l1 = function () {
        var a = this.lp;
        if (a == null) {
            a = this.jr();
        }
        this.lm = a;
        if (this.lm == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.lw();
    };
    StraightNumericAxisBase.prototype.lw = function () {
        this.lq.bh();
    };
    StraightNumericAxisBase.prototype.g0 = function (a, b, c, d) {
        if (this.lr) {
            return;
        }
        _super.prototype.g0.call(this, a, b, c, d);
        switch (b) {
            case NumericAxisBase.$$p[2]:
                this.l1();
                break;
            case NumericAxisBase.$$p[1]:
                this.l1();
                break;
            case StraightNumericAxisBase.$$p[0]:
                this.l1();
                break;
            case "Scaler":
                this.l1();
                break;
            case "ActualScaler":
                this.jy = typeCast(LogarithmicScaler.$, this.lm) !== null;
                this.lw();
                this.cn();
                this.hc(false);
                break;
            case "ActualMaximumValue":
                this.lx();
                break;
            case "ActualMinimumValue":
                this.ly();
                this.l1();
                break;
        }
    };
    StraightNumericAxisBase.prototype.ly = function () {
        this.lm.y(this.kd);
    };
    StraightNumericAxisBase.prototype.lx = function () {
        this.lm.x(this.kc);
    };
    StraightNumericAxisBase.prototype.ls = function (a, b) {
        if (a < this.kd) {
            a = this.kd;
        }
        else if (a > this.kc) {
            a = this.kc;
        }
        if (!b.ch) {
            return (a - this.kd) / (this.kc - this.kd);
        }
        else {
            return (a - this.kc) / (this.kd - this.kc);
        }
    };
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.l3 = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.lz));
    StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'g6', ['ScaleMode:ll:l2', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
    return StraightNumericAxisBase;
}(NumericAxisBase));
export { StraightNumericAxisBase };
/**
 * @hidden
 */
var StraightNumericAxisBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(StraightNumericAxisBaseView, _super);
    function StraightNumericAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bg = null;
        _this.bg = a;
        return _this;
    }
    StraightNumericAxisBaseView.prototype.bh = function () {
        this.bg.lm.x(this.bg.kc);
        this.bg.lm.y(this.bg.kd);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
//# sourceMappingURL=StraightNumericAxisBase_combined.js.map
