/*
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 { Base, markType } from "igniteui-angular-core";
import { ArgumentException } from "igniteui-angular-core";
/**
 * @hidden
 */
var UltraCalcFunctionConvert_UnitInfo = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(UltraCalcFunctionConvert_UnitInfo, _super);
    function UltraCalcFunctionConvert_UnitInfo(a, b, c, d) {
        var _this = _super.call(this) || this;
        _this.k = null;
        _this.e = false;
        _this.i = 0;
        _this.b = 0;
        _this.k = a;
        _this.e = b;
        _this.i = c;
        _this.b = d;
        return _this;
    }
    UltraCalcFunctionConvert_UnitInfo.d = function (a) {
        var b = a;
        var c = 1;
        var d = UltraCalcFunctionConvert_UnitInfo.a(b);
        if (d == 0) {
            b = b.substr(1);
            d = UltraCalcFunctionConvert_UnitInfo.a(b);
            if (d == 0) {
                return null;
            }
            else {
                var e = ((function () { var f = UltraCalcFunctionConvert_UnitInfo.h(a.substr(0, 1), c); c = f.p1; return f.ret; })());
                if (e == false) {
                    return null;
                }
            }
        }
        var f = UltraCalcFunctionConvert_UnitInfo.g(b);
        if (f == false && c != 1) {
            return null;
        }
        return new UltraCalcFunctionConvert_UnitInfo(b, f, c, d);
    };
    Object.defineProperty(UltraCalcFunctionConvert_UnitInfo.prototype, "l", {
        get: function () {
            return this.k;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(UltraCalcFunctionConvert_UnitInfo.prototype, "f", {
        get: function () {
            return this.e;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(UltraCalcFunctionConvert_UnitInfo.prototype, "j", {
        get: function () {
            return this.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(UltraCalcFunctionConvert_UnitInfo.prototype, "c", {
        get: function () {
            return this.b;
        },
        enumerable: false,
        configurable: true
    });
    UltraCalcFunctionConvert_UnitInfo.a = function (a) {
        switch (a) {
            case "g":
            case "sg":
            case "lbm":
            case "u":
            case "ozm": return 1;
            case "m":
            case "mi":
            case "Nmi":
            case "in":
            case "ft":
            case "yd":
            case "ang":
            case "pica":
            case "Pica": return 2;
            case "yr":
            case "day":
            case "hr":
            case "mn":
            case "sec": return 3;
            case "Pa":
            case "p":
            case "atm":
            case "at":
            case "mmHg": return 4;
            case "N":
            case "dyn":
            case "dy":
            case "lbf": return 5;
            case "J":
            case "e":
            case "c":
            case "cal":
            case "eV":
            case "ev":
            case "HPh":
            case "hh":
            case "Wh":
            case "wh":
            case "flb":
            case "BTU":
            case "btu": return 6;
            case "HP":
            case "h":
            case "W":
            case "w": return 7;
            case "T":
            case "ga": return 8;
            case "C":
            case "cel":
            case "F":
            case "fah":
            case "K":
            case "kel": return 9;
            case "tsp":
            case "tbs":
            case "oz":
            case "cup":
            case "pt":
            case "us_pt":
            case "uk_pt":
            case "qt":
            case "gal":
            case "l":
            case "lt": return 10;
        }
        return 0;
    };
    UltraCalcFunctionConvert_UnitInfo.h = function (a, b) {
        switch (a) {
            case "E":
                b = 1E+18;
                return {
                    ret: true,
                    p1: b
                };
            case "P":
                b = 1E+15;
                return {
                    ret: true,
                    p1: b
                };
            case "T":
                b = 1000000000000;
                return {
                    ret: true,
                    p1: b
                };
            case "G":
                b = 1000000000;
                return {
                    ret: true,
                    p1: b
                };
            case "M":
                b = 1000000;
                return {
                    ret: true,
                    p1: b
                };
            case "k":
                b = 1000;
                return {
                    ret: true,
                    p1: b
                };
            case "h":
                b = 100;
                return {
                    ret: true,
                    p1: b
                };
            case "e":
                b = 10;
                return {
                    ret: true,
                    p1: b
                };
            case "d":
                b = 0.1;
                return {
                    ret: true,
                    p1: b
                };
            case "c":
                b = 0.01;
                return {
                    ret: true,
                    p1: b
                };
            case "m":
                b = 0.001;
                return {
                    ret: true,
                    p1: b
                };
            case "u":
                b = 1E-06;
                return {
                    ret: true,
                    p1: b
                };
            case "n":
                b = 1E-09;
                return {
                    ret: true,
                    p1: b
                };
            case "p":
                b = 1E-12;
                return {
                    ret: true,
                    p1: b
                };
            case "f":
                b = 1E-15;
                return {
                    ret: true,
                    p1: b
                };
            case "a":
                b = 1E-18;
                return {
                    ret: true,
                    p1: b
                };
        }
        b = 1;
        return {
            ret: false,
            p1: b
        };
    };
    UltraCalcFunctionConvert_UnitInfo.g = function (a) {
        switch (a) {
            case "g":
            case "u": return true;
            case "sg":
            case "lbm":
            case "ozm": return false;
            case "m":
            case "ang": return true;
            case "mi":
            case "Nmi":
            case "in":
            case "ft":
            case "yd":
            case "pica":
            case "Pica": return false;
            case "sec": return true;
            case "yr":
            case "day":
            case "hr":
            case "mn": return false;
            case "Pa":
            case "p":
            case "atm":
            case "at":
            case "mmHg": return true;
            case "N":
            case "dyn":
            case "dy": return true;
            case "lbf": return false;
            case "J":
            case "e":
            case "c":
            case "cal":
            case "eV":
            case "ev":
            case "Wh":
            case "wh": return true;
            case "HPh":
            case "hh":
            case "flb":
            case "BTU":
            case "btu": return false;
            case "HP":
            case "h": return false;
            case "W":
            case "w": return true;
            case "T":
            case "ga": return true;
            case "C":
            case "cel":
            case "F":
            case "fah": return false;
            case "K":
            case "kel": return true;
            case "tsp":
            case "tbs":
            case "oz":
            case "cup":
            case "pt":
            case "us_pt":
            case "uk_pt":
            case "qt":
            case "gal": return false;
            case "l":
            case "lt": return true;
        }
        throw new ArgumentException(2, "baseUnit must be a unit with no metric prefix", "baseUnit");
    };
    UltraCalcFunctionConvert_UnitInfo.$t = markType(UltraCalcFunctionConvert_UnitInfo, 'UltraCalcFunctionConvert_UnitInfo');
    return UltraCalcFunctionConvert_UnitInfo;
}(Base));
export { UltraCalcFunctionConvert_UnitInfo };
