"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EndStep = void 0;
const MablStepV2_1 = require("../MablStepV2");
class EndStep extends MablStepV2_1.MablStepV2 {
    static stepName = 'End';
    static actionCode = 'conditional_end';
    static mablScriptStepNames = [EndStep.actionCode];
    static yamlMablScriptNames = [EndStep.stepName];
    constructor(descriptor) {
        super(EndStep.stepName, descriptor, EndStep.actionCode);
    }
    getStepName() {
        return EndStep.stepName;
    }
    static fromYaml(_stepName, stepArgs) {
        return new EndStep(stepArgs);
    }
    static fromLegacyMablscript(_args, _actions) {
        const stepDescriptor = {
            actionCode: EndStep.actionCode,
        };
        const step = new EndStep(stepDescriptor);
        step.actions = _actions;
        return step;
    }
    toMablscript() {
        return `conditional_end()`;
    }
    stepDescription() {
        return 'END';
    }
    static create(descriptor) {
        descriptor.id = descriptor.id ?? MablStepV2_1.MablStepV2.generateStepId();
        return new EndStep(descriptor);
    }
}
exports.EndStep = EndStep;
