"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cloneBundle = cloneBundle;
const Graph_1 = require("../Class/Graph");
const bundleClass_1 = require("./bundleClass");
function cloneBundle(unit, deep = false, specs) {
    const __bundle = unit.getUnitBundleSpec(deep);
    let Class = unit.constructor;
    if (unit instanceof Graph_1.Graph) {
        const spec = unit.getSpec();
        Class = class Bundle extends Class {
            constructor(system, id) {
                super(spec, {}, system, id);
            }
        };
    }
    return (0, bundleClass_1.bundleClass)(Class, __bundle, specs);
}
//# sourceMappingURL=cloneBundle.js.map