"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const Graph_1 = require("../../Class/Graph");
const debug_1 = require("../../debug");
const _ids_1 = require("../../system/_ids");
const system_1 = require("../util/system");
const spec = system_1.system.emptySpec();
const composition0 = new Graph_1.Graph(spec, {}, system_1.system);
false && (0, debug_1.watchUnitAndLog)(composition0);
false && (0, debug_1.watchGraphAndLog)(composition0);
const id0 = 'id0';
const id1 = 'id1';
const id2 = 'id2';
composition0.play();
composition0.addUnitSpecs({
    [id0]: {
        id: _ids_1.ID_IDENTITY,
        input: {
            a: {
                data: '0',
            },
        },
        output: {},
    },
    [id1]: {
        id: _ids_1.ID_IDENTITY,
    },
    [id2]: {
        id: _ids_1.ID_IDENTITY,
    },
});
composition0.addMerge({
    [id0]: {
        output: {
            a: true,
        },
    },
    [id1]: {
        input: {
            a: true,
        },
    },
    [id2]: {
        input: {
            a: true,
        },
    },
}, 'merge0');
composition0.addMerge({
    [id1]: {
        output: {
            a: true,
        },
    },
    [id0]: {
        input: {
            a: true,
        },
    },
}, 'merge1');
composition0.exposePinSet('output', 'a', { plug: { 0: { mergeId: 'merge0' } } });
composition0.removeMerge('merge0');
assert.deepEqual(composition0.getExposedPinSpec('output', 'a'), {
    plug: {
        '0': {},
    },
    ref: false,
});
composition0.exposePinSet('output', 'b', {
    plug: { 0: { unitId: id0, pinId: 'a' } },
});
composition0.removeUnit(id0);
assert.deepEqual(composition0.getExposedPinSpec('output', 'b'), {
    plug: {
        '0': {},
    },
    ref: false,
});
//# sourceMappingURL=exposed.js.map