/*
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 { __extends } 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) {
    __extends(StraightNumericAxisBase, _super);
    function StraightNumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.nk = null;
        _this.no = false;
        _this.ny();
        return _this;
    }
    StraightNumericAxisBase.prototype.a4 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.ht = function (a) {
        _super.prototype.ht.call(this, a);
        this.nn = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "nm", {
        get: function () {
            return this.c(StraightNumericAxisBase.n0);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.n0, a);
        },
        enumerable: false,
        configurable: true
    });
    StraightNumericAxisBase.nw = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.ny();
        c.h3("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.nl = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_nj = function () {
        if (this.nk == null) {
            this.ny();
        }
        return this.nk;
    };
    StraightNumericAxisBase.prototype.set_nj = function (a) {
        var b = this.nk != a;
        if (b) {
            var c = this.nk;
            this.nk = a;
            this.h3("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "nj", {
        get: function () {
            return this.get_nj();
        },
        set: function (a) {
            this.set_nj(a);
        },
        enumerable: false,
        configurable: true
    });
    StraightNumericAxisBase.prototype.mz = function (a, b, c, d, e, f, g) {
        var h = this.nj.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.nx = function (a) {
        var b = this.no;
        this.no = true;
        a();
        this.no = b;
    };
    StraightNumericAxisBase.prototype.ny = function () {
        var a = this.nm;
        if (a == null) {
            a = this.k4();
        }
        this.nj = a;
        if (this.nj == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.nt();
    };
    StraightNumericAxisBase.prototype.nt = function () {
        this.nn.bn();
    };
    StraightNumericAxisBase.prototype.hx = function (a, b, c, d) {
        if (this.no) {
            return;
        }
        _super.prototype.hx.call(this, a, b, c, d);
        switch (b) {
            case NumericAxisBase.$$p[6]:
                this.ny();
                break;
            case NumericAxisBase.$$p[5]:
                this.ny();
                break;
            case StraightNumericAxisBase.$$p[0]:
                this.ny();
                break;
            case "Scaler":
                this.ny();
                break;
            case "ActualScaler":
                this.lc = typeCast(LogarithmicScaler.$, this.nj) !== null;
                this.nt();
                this.c1();
                this.h9(false);
                break;
            case "ActualMaximumValue":
                this.nu();
                break;
            case "ActualMinimumValue":
                this.nv();
                this.ny();
                break;
        }
    };
    StraightNumericAxisBase.prototype.nv = function () {
        this.nj.y(this.ly);
    };
    StraightNumericAxisBase.prototype.nu = function () {
        this.nj.x(this.lx);
    };
    StraightNumericAxisBase.prototype.np = function (a, b) {
        if (a < this.ly) {
            a = this.ly;
        }
        else if (a > this.lx) {
            a = this.lx;
        }
        if (!b.cp) {
            return (a - this.ly) / (this.lx - this.ly);
        }
        else {
            return (a - this.lx) / (this.ly - this.lx);
        }
    };
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.n0 = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.nw));
    StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'h3', ['ScaleMode:ni:nz', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
    return StraightNumericAxisBase;
}(NumericAxisBase));
export { StraightNumericAxisBase };
/**
 * @hidden
 */
var StraightNumericAxisBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(StraightNumericAxisBaseView, _super);
    function StraightNumericAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bm = null;
        _this.bm = a;
        return _this;
    }
    StraightNumericAxisBaseView.prototype.bn = function () {
        this.bm.nj.x(this.bm.lx);
        this.bm.nj.y(this.bm.ly);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
