"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const start_1 = require("../../../start");
const AsyncGraph_1 = require("../../../types/interface/async/AsyncGraph");
const callAll_1 = require("../../../util/call/callAll");
const render_1 = require("../../render");
const boot_1 = require("./boot");
const init_1 = require("./init");
function webRender(bundle) {
    const { spec = {}, specs } = bundle;
    const system = (0, boot_1.default)({
        specs,
    });
    if (!spec.id || !system.hasSpec(spec.id)) {
        system.newSpec(spec);
    }
    const graph = (0, start_1.start)(system, spec);
    const $graph = (0, AsyncGraph_1.AsyncGraph)(graph);
    const webUnlisten = (0, init_1.default)(system, window, system.root);
    const renderUnlisten = (0, render_1.render)(system, $graph);
    const unlisten = (0, callAll_1.callAll)([webUnlisten, renderUnlisten]);
    return [graph, system, unlisten];
}
exports.default = webRender;
//# sourceMappingURL=render.js.map