import mapValues from 'lodash/mapValues.js';
const migrate = async (_, projectSchema) => {
    const newShapes = mapValues(projectSchema.shapes, (shape) => {
        // Set includeDeprecated to true for shapes to preserve behavior when indexing shapes by maxDepth
        if (shape.cache?.fragment?.maxDepth !== undefined) {
            const newShape = {
                ...shape,
                cache: {
                    ...shape.cache,
                    fragment: {
                        ...shape.cache.fragment,
                        includeDeprecated: true
                    }
                }
            };
            return newShape;
        }
        return shape;
    });
    return {
        ...projectSchema,
        shapes: newShapes,
        schemaVersion: '3.40.0'
    };
};
export default migrate;
