"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../Class/Functional");
const _ids_1 = require("../../../../_ids");
class CopyToClipboard extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['text'],
            o: [],
        }, {}, system, _ids_1.ID_COPY_TO_CLIPBOARD);
    }
    async f({ text }, done, fail) {
        const { api: { clipboard: { writeText }, }, } = this.__system;
        try {
            await writeText(text);
        }
        catch (err) {
            fail(err.message);
            return;
        }
        done();
    }
}
exports.default = CopyToClipboard;
//# sourceMappingURL=index.js.map