"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const FlowValidationDragDrop_1 = __importDefault(require("./FlowValidationDragDrop"));
const FlowValidationConditionals_1 = __importDefault(require("./FlowValidationConditionals"));
const FlowValidationStepGroups_1 = __importDefault(require("./FlowValidationStepGroups"));
class FlowValidation {
    constructor() {
        this.validators = [
            new FlowValidationConditionals_1.default(),
            new FlowValidationDragDrop_1.default(),
            new FlowValidationStepGroups_1.default(),
        ];
    }
    processStep(step, humanizedStep, flow) {
        this.validators.forEach((v) => v.processStep(step, humanizedStep, flow));
        return humanizedStep;
    }
    finalizeValidations(humanizedSteps) {
        this.validators.forEach((v) => v.finalizeValidations(humanizedSteps));
        return humanizedSteps;
    }
    static validateStepsForSave(steps) {
        const combinedResults = {};
        steps.forEach((step) => {
            if (step.validation?.length) {
                combinedResults[step.visibleIndex] = step.validation;
            }
        });
        return combinedResults;
    }
}
exports.default = FlowValidation;
