/*
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 { ValueType, toNullable, markStruct } from "igniteui-angular-core";
import { ST_PositiveUniversalMeasure } from "./ST_PositiveUniversalMeasure";
import { ST_UnsignedDecimalNumber } from "./ST_UnsignedDecimalNumber";
import { DocCoreUtils } from "./DocCoreUtils";
import { nullableNotEquals } from "igniteui-angular-core";
import { stringEmpty } from "igniteui-angular-core";
/**
 * @hidden
 */
export let ST_HpsMeasure = /*@__PURE__*/ (() => {
    class ST_HpsMeasure extends ValueType {
        constructor(a, ..._rest) {
            super();
            this.g = toNullable(ST_PositiveUniversalMeasure.$, null);
            this.h = toNullable(ST_UnsignedDecimalNumber.$, null);
            a = (a == void 0) ? 0 : a;
            switch (a) {
                case 0: break;
                case 1:
                    {
                        let c = _rest[0];
                        let d = [new ST_PositiveUniversalMeasure(1, c, 3)];
                        {
                            let f = d[0];
                            this.g = toNullable(ST_PositiveUniversalMeasure.$, f);
                            this.h = toNullable(ST_UnsignedDecimalNumber.$, null);
                        }
                    }
                    break;
                case 2:
                    {
                        let c = _rest[0];
                        this.g = toNullable(ST_PositiveUniversalMeasure.$, c);
                        this.h = toNullable(ST_UnsignedDecimalNumber.$, null);
                    }
                    break;
                case 3:
                    {
                        let c = _rest[0];
                        this.g = toNullable(ST_PositiveUniversalMeasure.$, null);
                        this.h = toNullable(ST_UnsignedDecimalNumber.$, c);
                    }
                    break;
            }
        }
        toString() {
            if (nullableNotEquals(this.g, null)) {
                return this.g.getValueOrDefault().toString();
            }
            if (nullableNotEquals(this.h, null)) {
                return this.h.getValueOrDefault().toString();
            }
            return stringEmpty();
        }
        f() {
            if (nullableNotEquals(this.g, null)) {
                return this.g.getValueOrDefault().d();
            }
            if (nullableNotEquals(this.h, null)) {
                return (ST_UnsignedDecimalNumber.h(this.h.getValueOrDefault()) * 10);
            }
            return 0;
        }
        static e(a) {
            let b = ST_HpsMeasure.k(a);
            if (nullableNotEquals(b, null)) {
                return b.getValueOrDefault();
            }
            throw DocCoreUtils.n(ST_HpsMeasure.$, a);
        }
        static k(a) {
            let b = ST_PositiveUniversalMeasure.e(a);
            if (nullableNotEquals(b, null)) {
                return toNullable(ST_HpsMeasure.$, ST_HpsMeasure.a(b.getValueOrDefault()));
            }
            let c = ST_UnsignedDecimalNumber.f(a);
            if (nullableNotEquals(c, null)) {
                return toNullable(ST_HpsMeasure.$, ST_HpsMeasure.b(c.getValueOrDefault()));
            }
            return toNullable(ST_HpsMeasure.$, null);
        }
        static a(a) {
            return new ST_HpsMeasure(2, a);
        }
        static i(a) {
            if (!a.hasValue) {
                return toNullable(ST_HpsMeasure.$, null);
            }
            return toNullable(ST_HpsMeasure.$, ST_HpsMeasure.a(a.value));
        }
        static b(a) {
            return new ST_HpsMeasure(3, a);
        }
        static j(a) {
            if (!a.hasValue) {
                return toNullable(ST_HpsMeasure.$, null);
            }
            return toNullable(ST_HpsMeasure.$, ST_HpsMeasure.b(a.value));
        }
    }
    ST_HpsMeasure.$t = markStruct(ST_HpsMeasure, 'ST_HpsMeasure');
    return ST_HpsMeasure;
})();
