"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const debug_1 = require("../../../../debug");
const fromBundle_1 = require("../../../../spec/fromBundle");
const _ids_1 = require("../../../../system/_ids");
const Bundle_1 = __importDefault(require("../../../../system/f/meta/Bundle"));
const assert_1 = require("../../../../util/assert");
const system_1 = require("../../../util/system");
const bundle = new Bundle_1.default(system_1.system);
bundle.play();
false && (0, debug_1.watchUnitAndLog)(bundle);
const Class = (0, fromBundle_1.fromBundle)({
    spec: {},
    specs: {},
}, system_1.system.specs, system_1.system.classes);
const graph = new Class(system_1.system);
graph.play();
bundle.push('opt', {});
bundle.push('graph', graph);
assert_1.assert.deepEqual(bundle.take('bundle'), {
    spec: {
        id: graph.id,
    },
    specs: {},
});
graph.addUnitSpec('identity', {
    unit: {
        id: _ids_1.ID_IDENTITY,
        input: {
            a: {
                data: '1',
                ignored: false,
            },
        },
        output: {
            a: {
                constant: false,
                ignored: false,
            },
        },
    },
});
bundle.push('opt', {});
bundle.push('graph', graph);
assert_1.assert.deepEqual(bundle.take('bundle'), {
    spec: {
        id: graph.id,
        units: {
            identity: {
                id: '260d774e-bc89-4027-aa92-cb1985fb312b',
                input: {
                    a: {
                        data: '1',
                        ignored: false,
                    },
                },
                output: {
                    a: {
                        constant: false,
                        ignored: false,
                    },
                },
            },
        },
    },
    specs: {},
});
const identity = graph.getUnit('identity');
identity.push('a', 1);
bundle.push('opt', { deep: true });
bundle.push('graph', graph);
assert_1.assert.deepEqual(bundle.take('bundle'), {
    spec: {
        id: graph.id,
        units: {
            identity: {
                id: '260d774e-bc89-4027-aa92-cb1985fb312b',
                memory: {
                    input: {
                        a: {
                            _register: '1',
                            _idle: 'false',
                        },
                    },
                    output: {
                        a: {
                            _register: '1',
                            _idle: 'false',
                        },
                    },
                    memory: {
                        _looping: 'true',
                    },
                },
                input: {
                    a: {
                        ignored: false,
                        data: '1',
                    },
                },
                output: {
                    a: {
                        ignored: false,
                        constant: false,
                    },
                },
            },
        },
    },
    specs: {},
});
//# sourceMappingURL=Bundle.js.map