/*
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-angular-core";
import { NumericScaler } from "./NumericScaler";
import { enumGetBox, typeCast, markType, markDep } from "igniteui-angular-core";
import { ArgumentNullException } from "igniteui-angular-core";
import { LogarithmicScaler } from "./LogarithmicScaler";
import { PropertyMetadata } from "igniteui-angular-core";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
var StraightNumericAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(StraightNumericAxisBase, _super);
    function StraightNumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.n2 = null;
        _this.n6 = false;
        _this.og();
        return _this;
    }
    StraightNumericAxisBase.prototype.a4 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.hv = function (a) {
        _super.prototype.hv.call(this, a);
        this.n5 = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "n4", {
        get: function () {
            return this.c(StraightNumericAxisBase.oi);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.oi, a);
        },
        enumerable: false,
        configurable: true
    });
    StraightNumericAxisBase.oe = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.og();
        c.h5("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.n3 = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_n1 = function () {
        if (this.n2 == null) {
            this.og();
        }
        return this.n2;
    };
    StraightNumericAxisBase.prototype.set_n1 = function (a) {
        var b = this.n2 != a;
        if (b) {
            var c = this.n2;
            this.n2 = a;
            this.h5("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "n1", {
        get: function () {
            return this.get_n1();
        },
        set: function (a) {
            this.set_n1(a);
        },
        enumerable: false,
        configurable: true
    });
    StraightNumericAxisBase.prototype.ng = function (a, b, c, d, e, f, g) {
        var h = this.n1.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.of = function (a) {
        var b = this.n6;
        this.n6 = true;
        a();
        this.n6 = b;
    };
    StraightNumericAxisBase.prototype.og = function () {
        var a = this.n4;
        if (a == null) {
            a = this.k7();
        }
        this.n1 = a;
        if (this.n1 == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.ob();
    };
    StraightNumericAxisBase.prototype.ob = function () {
        this.n5.bn();
    };
    StraightNumericAxisBase.prototype.hz = function (a, b, c, d) {
        if (this.n6) {
            return;
        }
        _super.prototype.hz.call(this, a, b, c, d);
        switch (b) {
            case NumericAxisBase.$$p[6]:
                this.og();
                break;
            case NumericAxisBase.$$p[5]:
                this.og();
                break;
            case StraightNumericAxisBase.$$p[0]:
                this.og();
                break;
            case "Scaler":
                this.og();
                break;
            case "ActualScaler":
                this.lg = typeCast(LogarithmicScaler.$, this.n1) !== null;
                this.ob();
                this.c1();
                this.ib(false);
                break;
            case "ActualMaximumValue":
                this.oc();
                break;
            case "ActualMinimumValue":
                this.od();
                this.og();
                break;
        }
    };
    StraightNumericAxisBase.prototype.od = function () {
        this.n1.y(this.l4);
    };
    StraightNumericAxisBase.prototype.oc = function () {
        this.n1.x(this.l3);
    };
    StraightNumericAxisBase.prototype.n7 = function (a, b) {
        if (a < this.l4) {
            a = this.l4;
        }
        else if (a > this.l3) {
            a = this.l3;
        }
        if (!b.cp) {
            return (a - this.l4) / (this.l3 - this.l4);
        }
        else {
            return (a - this.l3) / (this.l4 - this.l3);
        }
    };
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.oi = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.oe));
    StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'h5', ['ScaleMode:n0:oh', [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.n1.x(this.bm.l3);
        this.bm.n1.y(this.bm.l4);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
