"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromUnitBundle = fromUnitBundle;
const weakMerge_1 = require("../weakMerge");
const bundleClass_1 = require("./bundleClass");
const fromId_1 = require("./fromId");
function fromUnitBundle(bundle, specs, classes) {
    const { unit } = bundle;
    const { id } = unit;
    const specs_ = (0, weakMerge_1.weakMerge)(specs, bundle.specs ?? {});
    const Class = (0, fromId_1.classFromId)(id, specs_, classes, {});
    const Bundle = (0, bundleClass_1.bundleClass)(Class, bundle, specs_);
    return Bundle;
}
//# sourceMappingURL=fromUnitBundle.js.map