"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.migrateEnsureHeaderComponentName = migrateEnsureHeaderComponentName;
const get_prop_1 = require("../../objects/get-prop");
/**
 * Ensure the header component has a name.
 * Starting ~Sept 15, 2025, up to Nov 4, 2025, Sites created via
 * the "Add Content" flow, had a header component without a name.
 * This resulted in the header not being rendered in the site, but
 * was renderered in the editor. This migration ensures that
 * the header component has a name of "site-header" if it is missing.
 * @param siteModel
 * @returns
 */
function migrateEnsureHeaderComponentName(siteModel) {
    const clone = Object.assign({}, siteModel);
    const header = (0, get_prop_1.getProp)(clone, "data.values.layout.header");
    if (header && header.component && !header.name) {
        header.name = "site-header";
    }
    return clone;
}
//# sourceMappingURL=migrateEnsureHeaderComponentName.js.map