"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Unit_1 = require("../../../../Class/Unit");
const _ids_1 = require("../../../_ids");
class This extends Unit_1.Unit {
    constructor(system) {
        super({
            i: [],
            o: ['graph'],
        }, {
            output: {
                graph: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_THIS);
        this.addListener('parent', (parent) => {
            if (parent === null) {
                if (this._unlisten) {
                    this._unlisten();
                    this._unlisten = undefined;
                }
                this._output.graph.pull();
            }
            else {
                this._output.graph.push(parent);
            }
        });
    }
}
exports.default = This;
//# sourceMappingURL=index.js.map