import { b as RichTypeBoolean, R as RichTypeAny } from './declarationMapper-CyxdrUFP.esm.js';
import { F as FlowGraphCachedOperationBlock } from './flowGraphCachedOperationBlock-BYuTMQ0T.esm.js';
import { R as RegisterClass } from './index-BvJBnIUK.esm.js';
import './KHR_interactivity-BGk_Crki.esm.js';
import './objectModelMapping-BtiDAwYm.esm.js';

/** This file must only contain pure code and pure imports */
/**
 * @experimental
 * A data block that checks whether an Audio V2 sound is currently playing.
 */
class FlowGraphIsSoundPlayingBlock extends FlowGraphCachedOperationBlock {
    /**
     * Constructs a new FlowGraphIsSoundPlayingBlock.
     * @param config - optional configuration for the block
     */
    constructor(config) {
        super(RichTypeBoolean, config);
        this.sound = this.registerDataInput("sound", RichTypeAny);
    }
    /**
     * @internal
     */
    _doOperation(context) {
        const soundValue = this.sound.getValue(context);
        if (!soundValue) {
            return undefined;
        }
        return soundValue.state === 3 /* SoundState.Started */ || soundValue.state === 2 /* SoundState.Starting */;
    }
    /**
     * @returns class name of the block.
     */
    getClassName() {
        return "FlowGraphIsSoundPlayingBlock" /* FlowGraphBlockNames.AudioIsSoundPlaying */;
    }
}
let _Registered = false;
/**
 * Register side effects for flowGraphIsSoundPlayingBlock.
 * Safe to call multiple times; only the first call has an effect.
 */
function RegisterFlowGraphIsSoundPlayingBlock() {
    if (_Registered) {
        return;
    }
    _Registered = true;
    RegisterClass("FlowGraphIsSoundPlayingBlock" /* FlowGraphBlockNames.AudioIsSoundPlaying */, FlowGraphIsSoundPlayingBlock);
}

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

export { FlowGraphIsSoundPlayingBlock, RegisterFlowGraphIsSoundPlayingBlock };
//# sourceMappingURL=flowGraphIsSoundPlayingBlock-BMEyes8o.esm.js.map
