"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../Class/Functional");
const _ids_1 = require("../../../../_ids");
class Prompt extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['message', 'default'],
            o: ['answer'],
        }, {}, system, _ids_1.ID_PROMPT);
    }
    f({ message, default: default_ }, done, fail) {
        const { api: { alert: { prompt }, }, } = this.__system;
        const answer = prompt(message, default_);
        if (answer === null) {
            fail('user cancelled prompt');
            return;
        }
        done({ answer });
    }
}
exports.default = Prompt;
//# sourceMappingURL=index.js.map