import { F as FlowGraphUnaryOperationBlock } from './flowGraphUnaryOperationBlock-gWC9KyK1.esm.js';
import { d as RichTypeNumber, j as RichTypeFlowGraphInteger, F as FlowGraphInteger, b as RichTypeBoolean } from './declarationMapper-CyxdrUFP.esm.js';
import { R as RegisterClass } from './index-BvJBnIUK.esm.js';
import './flowGraphCachedOperationBlock-BYuTMQ0T.esm.js';
import './KHR_interactivity-BGk_Crki.esm.js';
import './objectModelMapping-BtiDAwYm.esm.js';

/** This file must only contain pure code and pure imports */
/**
 * A block that converts a boolean to a float.
 */
class FlowGraphBooleanToFloat extends FlowGraphUnaryOperationBlock {
    constructor(config) {
        super(RichTypeBoolean, RichTypeNumber, (a) => +a, "FlowGraphBooleanToFloat" /* FlowGraphBlockNames.BooleanToFloat */, config);
    }
}
/**
 * A block that converts a boolean to an integer
 */
class FlowGraphBooleanToInt extends FlowGraphUnaryOperationBlock {
    constructor(config) {
        super(RichTypeBoolean, RichTypeFlowGraphInteger, (a) => FlowGraphInteger.FromValue(+a), "FlowGraphBooleanToInt" /* FlowGraphBlockNames.BooleanToInt */, config);
    }
}
/**
 * A block that converts a float to a boolean.
 */
class FlowGraphFloatToBoolean extends FlowGraphUnaryOperationBlock {
    constructor(config) {
        super(RichTypeNumber, RichTypeBoolean, (a) => !!a, "FlowGraphFloatToBoolean" /* FlowGraphBlockNames.FloatToBoolean */, config);
    }
}
/**
 * A block that converts an integer to a boolean.
 */
class FlowGraphIntToBoolean extends FlowGraphUnaryOperationBlock {
    constructor(config) {
        super(RichTypeFlowGraphInteger, RichTypeBoolean, (a) => !!a.value, "FlowGraphIntToBoolean" /* FlowGraphBlockNames.IntToBoolean */, config);
    }
}
/**
 * A block that converts an integer to a float.
 */
class FlowGraphIntToFloat extends FlowGraphUnaryOperationBlock {
    constructor(config) {
        super(RichTypeFlowGraphInteger, RichTypeNumber, (a) => a.value, "FlowGraphIntToFloat" /* FlowGraphBlockNames.IntToFloat */, config);
    }
}
/**
 * A block that converts a float to an integer.
 */
class FlowGraphFloatToInt extends FlowGraphUnaryOperationBlock {
    constructor(config) {
        super(RichTypeNumber, RichTypeFlowGraphInteger, (a) => {
            const roundingMode = config?.roundingMode;
            switch (roundingMode) {
                case "floor":
                    return FlowGraphInteger.FromValue(Math.floor(a));
                case "ceil":
                    return FlowGraphInteger.FromValue(Math.ceil(a));
                case "round":
                    return FlowGraphInteger.FromValue(Math.round(a));
                default:
                    return FlowGraphInteger.FromValue(a);
            }
        }, "FlowGraphFloatToInt" /* FlowGraphBlockNames.FloatToInt */, config);
    }
}
let _Registered = false;
/**
 * Register side effects for flowGraphTypeToTypeBlocks.
 * Safe to call multiple times; only the first call has an effect.
 */
function RegisterFlowGraphTypeToTypeBlocks() {
    if (_Registered) {
        return;
    }
    _Registered = true;
    RegisterClass("FlowGraphBooleanToFloat" /* FlowGraphBlockNames.BooleanToFloat */, FlowGraphBooleanToFloat);
    RegisterClass("FlowGraphBooleanToInt" /* FlowGraphBlockNames.BooleanToInt */, FlowGraphBooleanToInt);
    RegisterClass("FlowGraphFloatToBoolean" /* FlowGraphBlockNames.FloatToBoolean */, FlowGraphFloatToBoolean);
    RegisterClass("FlowGraphIntToBoolean" /* FlowGraphBlockNames.IntToBoolean */, FlowGraphIntToBoolean);
    RegisterClass("FlowGraphIntToFloat" /* FlowGraphBlockNames.IntToFloat */, FlowGraphIntToFloat);
    RegisterClass("FlowGraphFloatToInt" /* FlowGraphBlockNames.FloatToInt */, FlowGraphFloatToInt);
}

/**
 * Re-exports pure implementation and applies runtime side effects.
 * Import flowGraphTypeToTypeBlocks.pure for tree-shakeable, side-effect-free usage.
 */
RegisterFlowGraphTypeToTypeBlocks();

export { FlowGraphBooleanToFloat, FlowGraphBooleanToInt, FlowGraphFloatToBoolean, FlowGraphFloatToInt, FlowGraphIntToBoolean, FlowGraphIntToFloat, RegisterFlowGraphTypeToTypeBlocks };
//# sourceMappingURL=flowGraphTypeToTypeBlocks-ZATqCKKj.esm.js.map
