"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Holder_1 = require("../../../../../Class/Holder");
const _ids_1 = require("../../../../_ids");
class AttachDropTarget extends Holder_1.Holder {
    constructor(system) {
        super({
            fi: ['component', 'opt'],
            i: [],
            o: ['items'],
        }, {
            input: {
                component: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_ATTACH_DROP_TARGET);
    }
    async f({ component, opt }, done) {
        this._unlisten = component.attachDropTarget();
        component.addListener('drop_', (items) => {
            this._output.items.push(items);
        });
    }
    d() {
        if (this._unlisten) {
            this._unlisten();
            this._done();
        }
    }
}
exports.default = AttachDropTarget;
//# sourceMappingURL=index.js.map