import { evaluateActionInputPredicate } from './actionInputPredicates.js';
export function resolveEffectiveActionInputFields(spec, input) {
    const hints = spec.inputHints;
    const fields = Array.isArray(hints?.fields) ? hints.fields : [];
    const out = [];
    for (const field of fields) {
        const visibleWhen = field.visibleWhen;
        const requiredWhen = field.requiredWhen;
        const disabledWhen = field.disabledWhen;
        const visible = visibleWhen ? evaluateActionInputPredicate(visibleWhen, input) : true;
        if (!visible)
            continue;
        const required = Boolean(field.required === true) || (requiredWhen ? evaluateActionInputPredicate(requiredWhen, input) : false);
        const disabled = disabledWhen ? evaluateActionInputPredicate(disabledWhen, input) : false;
        out.push({ ...field, visible, required, disabled });
    }
    return out;
}
//# sourceMappingURL=actionInputHintsRuntime.js.map