"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Observer_1 = require("./Observer");
class FindResultObserver extends Observer_1.AfterObserver {
    constructor(dispatcher) {
        super(Observer_1.ObservationType.FIND_RESULT, dispatcher);
        this.observeAfterFunction = (_context) => Promise.resolve({});
    }
    observeAfter(options) {
        const isIntermediateAction = options.properties?.isIntermediateAction;
        const line = options.properties?.line;
        const metadata = options.properties?.metadata;
        if (isIntermediateAction && line && metadata) {
            const deferredAction = () => {
                options.executionContext.log.info(line, metadata);
                return Promise.resolve();
            };
            this.messagesToSend.push(deferredAction);
        }
        return Promise.resolve();
    }
}
exports.default = FindResultObserver;
