"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureBaseTelemetry = ensureBaseTelemetry;
const get_prop_1 = require("../../objects/get-prop");
const util_1 = require("../../util");
/**
 * During a period in late 2023 and early 2024, the python api
 * was writing a bad confirmation for basemaps as part of the site
 * cloning process. This migration will fix that.
 * @param {Object} model Site Model
 * @private
 */
function ensureBaseTelemetry(model) {
    // Unlike other migrations, this is not based on a version
    // rather it checks for a missing telemetry property.
    // Early exit if the telemetry is there
    if ((0, get_prop_1.getProp)(model, "data.telemetry")) {
        return model;
    }
    const clone = (0, util_1.cloneObject)(model);
    clone.data.telemetry = {};
    return clone;
}
//# sourceMappingURL=ensureBaseTelemetry.js.map