/*
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 { ValueType, toNullable, markStruct } from "igniteui-angular-core";
import { ST_CoordinateUnqualified } from "./ST_CoordinateUnqualified";
import { ST_UniversalMeasure } from "./ST_UniversalMeasure";
import { DocCoreUtils } from "./DocCoreUtils";
import { nullableNotEquals } from "igniteui-angular-core";
import { stringEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
var ST_Coordinate = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ST_Coordinate, _super);
    function ST_Coordinate(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = _super.call(this) || this;
        _this.m = toNullable(ST_CoordinateUnqualified.$, null);
        _this.n = toNullable(ST_UniversalMeasure.$, null);
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0: break;
            case 1:
                {
                    var c = _rest[0];
                    _this.m = toNullable(ST_CoordinateUnqualified.$, c);
                    _this.n = toNullable(ST_UniversalMeasure.$, null);
                }
                break;
            case 2:
                {
                    var c = _rest[0];
                    _this.m = toNullable(ST_CoordinateUnqualified.$, null);
                    _this.n = toNullable(ST_UniversalMeasure.$, c);
                }
                break;
        }
        return _this;
    }
    ST_Coordinate.prototype.l = function () {
        if (nullableNotEquals(this.m, null)) {
            return this.m.getValueOrDefault().f();
        }
        if (ST_UniversalMeasure.f(this.n, toNullable(ST_UniversalMeasure.$, null))) {
            return this.n.getValueOrDefault().m();
        }
        return 0;
    };
    ST_Coordinate.prototype.k = function () {
        if (nullableNotEquals(this.m, null)) {
            return this.m.getValueOrDefault().d();
        }
        if (ST_UniversalMeasure.f(this.n, toNullable(ST_UniversalMeasure.$, null))) {
            return this.n.getValueOrDefault().k();
        }
        return 0;
    };
    ST_Coordinate.h = function (a) {
        var b = ST_Coordinate.s(a);
        if (nullableNotEquals(b, null)) {
            return b.getValueOrDefault();
        }
        throw DocCoreUtils.n(ST_Coordinate.$, a);
    };
    ST_Coordinate.s = function (a) {
        var b = ST_CoordinateUnqualified.k(a);
        if (nullableNotEquals(b, null)) {
            return toNullable(ST_Coordinate.$, ST_Coordinate.c(b.getValueOrDefault()));
        }
        var c = ST_UniversalMeasure.o(a);
        if (ST_UniversalMeasure.f(c, toNullable(ST_UniversalMeasure.$, null))) {
            return toNullable(ST_Coordinate.$, ST_Coordinate.d(c.getValueOrDefault()));
        }
        return toNullable(ST_Coordinate.$, null);
    };
    ST_Coordinate.prototype.toString = function () {
        if (nullableNotEquals(this.m, null)) {
            return this.m.getValueOrDefault().toString();
        }
        if (ST_UniversalMeasure.f(this.n, toNullable(ST_UniversalMeasure.$, null))) {
            return this.n.getValueOrDefault().toString();
        }
        return stringEmpty();
    };
    ST_Coordinate.a = function (a) {
        return new ST_Coordinate(1, ST_CoordinateUnqualified.a(a));
    };
    ST_Coordinate.b = function (a) {
        return new ST_Coordinate(1, ST_CoordinateUnqualified.a(a));
    };
    ST_Coordinate.p = function (a) {
        if (!a.hasValue) {
            return toNullable(ST_Coordinate.$, null);
        }
        return toNullable(ST_Coordinate.$, ST_Coordinate.b(a.value));
    };
    ST_Coordinate.c = function (a) {
        return new ST_Coordinate(1, a);
    };
    ST_Coordinate.q = function (a) {
        if (!a.hasValue) {
            return toNullable(ST_Coordinate.$, null);
        }
        return toNullable(ST_Coordinate.$, ST_Coordinate.c(a.value));
    };
    ST_Coordinate.i = function (a) {
        return a.m.value;
    };
    ST_Coordinate.o = function (a) {
        if (!a.hasValue) {
            return toNullable(ST_CoordinateUnqualified.$, null);
        }
        return toNullable(ST_CoordinateUnqualified.$, ST_Coordinate.i(a.value));
    };
    ST_Coordinate.d = function (a) {
        return new ST_Coordinate(2, a);
    };
    ST_Coordinate.r = function (a) {
        if (!a.hasValue) {
            return toNullable(ST_Coordinate.$, null);
        }
        return toNullable(ST_Coordinate.$, ST_Coordinate.d(a.value));
    };
    ST_Coordinate.$t = markStruct(ST_Coordinate, 'ST_Coordinate');
    return ST_Coordinate;
}(ValueType));
export { ST_Coordinate };
