/*
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 { BuiltInFunctionBase } from "./BuiltInFunctionBase";
import { ExcelCalcValue } from "./ExcelCalcValue";
import { ExcelCalcErrorValue } from "./ExcelCalcErrorValue";
import { markType } from "igniteui-angular-core";
/**
 * @hidden
 */
var UltraCalcFunctionType = /** @class */ (function (_super) {
    tslib_1.__extends(UltraCalcFunctionType, _super);
    function UltraCalcFunctionType() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    UltraCalcFunctionType.prototype.evaluate = function (a, b) {
        var c;
        var d = a.pop();
        if (d.isError) {
            c = 16;
        }
        else if (d.isBoolean) {
            c = 4;
        }
        else if (d.isString) {
            c = 2;
        }
        else if (d.isArray) {
            c = 64;
        }
        else {
            var e_1;
            if (!((function () { var f = d._toDouble1(e_1); e_1 = f.p0; return f.ret; })())) {
                return new ExcelCalcValue(new ExcelCalcErrorValue(1));
            }
            c = 1;
        }
        return new ExcelCalcValue(c);
    };
    UltraCalcFunctionType.prototype.get_name = function () {
        return "type";
    };
    Object.defineProperty(UltraCalcFunctionType.prototype, "name", {
        get: function () {
            return this.get_name();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionType.prototype.get_minArgs = function () {
        return 1;
    };
    Object.defineProperty(UltraCalcFunctionType.prototype, "minArgs", {
        get: function () {
            return this.get_minArgs();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionType.prototype.get_maxArgs = function () {
        return 1;
    };
    Object.defineProperty(UltraCalcFunctionType.prototype, "maxArgs", {
        get: function () {
            return this.get_maxArgs();
        },
        enumerable: true,
        configurable: true
    });
    UltraCalcFunctionType.$t = markType(UltraCalcFunctionType, 'UltraCalcFunctionType', BuiltInFunctionBase.$);
    return UltraCalcFunctionType;
}(BuiltInFunctionBase));
export { UltraCalcFunctionType };
//# sourceMappingURL=UltraCalcFunctionType.js.map