"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.watchGraphInternal = exports.GRAPH_EVENT_TO_WATCHER = void 0;
const callAll_1 = require("../../util/call/callAll");
const watchGraphBulkEditEvent_1 = require("./watchGraphBulkEditEvent");
const watchGraphExposedPinEvent_1 = require("./watchGraphExposedPinEvent");
const watchGraphExposedPinSetEvent_1 = require("./watchGraphExposedPinSetEvent");
const watchGraphForkEvent_1 = require("./watchGraphForkEvent");
const watchGraphMergeEvent_1 = require("./watchGraphMergeEvent");
const watchGraphMoveSubComponentRoot_1 = require("./watchGraphMoveSubComponentRoot");
const watchGraphMoveSubgraphIntoEvent_1 = require("./watchGraphMoveSubgraphIntoEvent");
const watchGraphPinMergeEvent_1 = require("./watchGraphPinMergeEvent");
const watchGraphPlugEvent_1 = require("./watchGraphPlugEvent");
const watchGraphRemoveUnitPinDataEvent_1 = require("./watchGraphRemoveUnitPinDataEvent");
const watchGraphReorderSubComponent_1 = require("./watchGraphReorderSubComponent");
const watchGraphSetPinSetFunctionalEvent_1 = require("./watchGraphSetPinSetFunctionalEvent");
const watchGraphSetPinSetIdEvent_1 = require("./watchGraphSetPinSetIdEvent");
const watchGraphSetUnitIdEvent_1 = require("./watchGraphSetUnitIdEvent");
const watchGraphSetUnitPinConstantEvent_1 = require("./watchGraphSetUnitPinConstantEvent");
const watchGraphSetUnitPinDataEvent_1 = require("./watchGraphSetUnitPinDataEvent");
const watchGraphSetUnitPinIgnoredEvent_1 = require("./watchGraphSetUnitPinIgnoredEvent");
const watchGraphSetUnitPinSetIdEvent_1 = require("./watchGraphSetUnitPinSetIdEvent");
const watchGraphUnitComponentAppendEvent_1 = require("./watchGraphUnitComponentAppendEvent");
const watchGraphUnitComponentRemoveEvent_1 = require("./watchGraphUnitComponentRemoveEvent");
const watchGraphUnitEvent_1 = require("./watchGraphUnitEvent");
const watchGraphUnitMoveEvent_1 = require("./watchGraphUnitMoveEvent");
exports.GRAPH_EVENT_TO_WATCHER = {
    fork: watchGraphForkEvent_1.watchGraphForkEvent,
    add_unit: watchGraphUnitEvent_1.watchGraphUnitEvent,
    remove_unit: watchGraphUnitEvent_1.watchGraphUnitEvent,
    clone_unit: watchGraphUnitEvent_1.watchGraphCloneUnitEvent,
    move_unit: watchGraphUnitMoveEvent_1.watchGraphUnitMoveEvent,
    component_append: watchGraphUnitComponentAppendEvent_1.watchGraphUnitComponentAppendEvent,
    component_remove: watchGraphUnitComponentRemoveEvent_1.watchGraphUnitComponentRemoveEvent,
    add_merge: watchGraphMergeEvent_1.watchGraphMergeEvent,
    remove_merge: watchGraphMergeEvent_1.watchGraphMergeEvent,
    add_pin_to_merge: watchGraphPinMergeEvent_1.watchGraphPinMergeEvent,
    remove_pin_from_merge: watchGraphPinMergeEvent_1.watchGraphPinMergeEvent,
    expose_pin: watchGraphExposedPinEvent_1.watchGraphExposePinEvent,
    cover_pin: watchGraphExposedPinEvent_1.watchGraphExposePinEvent,
    expose_pin_set: watchGraphExposedPinSetEvent_1.watchGraphExposedPinSetEvent,
    cover_pin_set: watchGraphExposedPinSetEvent_1.watchGraphExposedPinSetEvent,
    plug_pin: watchGraphPlugEvent_1.watchGraphPlugEvent,
    unplug_pin: watchGraphPlugEvent_1.watchGraphPlugEvent,
    move_subgraph_into: watchGraphMoveSubgraphIntoEvent_1.watchGraphMoveSubgraphEvent,
    move_subgraph_out_of: watchGraphMoveSubgraphIntoEvent_1.watchGraphMoveSubgraphEvent,
    reorder_sub_component: watchGraphReorderSubComponent_1.watchGraphReorderSubComponent,
    move_sub_component_root: watchGraphMoveSubComponentRoot_1.watchGraphMoveSubComponentRoot,
    set_unit_pin_constant: watchGraphSetUnitPinConstantEvent_1.watchGraphSetUnitPinConstant,
    set_unit_pin_set_id: watchGraphSetUnitPinSetIdEvent_1.watchGraphSetUnitPinSetId,
    set_unit_pin_ignored: watchGraphSetUnitPinIgnoredEvent_1.watchGraphSetUnitPinIgnored,
    set_pin_set_functional: watchGraphSetPinSetFunctionalEvent_1.watchGraphSetUnitPinFunctional,
    set_pin_set_id: watchGraphSetPinSetIdEvent_1.watchGraphSetPinSetId,
    set_unit_pin_data: watchGraphSetUnitPinDataEvent_1.watchGraphSetUnitPinData,
    remove_unit_pin_data: watchGraphRemoveUnitPinDataEvent_1.watchGraphRemoveUnitPinData,
    set_unit_id: watchGraphSetUnitIdEvent_1.watchGraphSetUnitIdEvent,
    bulk_edit: watchGraphBulkEditEvent_1.watchGraphBulkEditEvent,
};
function watchGraphInternal(graph, events, callback) {
    const all = [];
    for (const event in exports.GRAPH_EVENT_TO_WATCHER) {
        if (events.includes(event)) {
            const watchEvent = exports.GRAPH_EVENT_TO_WATCHER[event];
            all.push(watchEvent(event, graph, callback));
        }
    }
    const unlisten = (0, callAll_1.callAll)(all);
    return unlisten;
}
exports.watchGraphInternal = watchGraphInternal;
//# sourceMappingURL=watchGraphInternal.js.map