static POST_PROCESS_BLOCKS(blocks, uniqueMapId) {
        if (blocks[TYPE_FLAGS.MAP_IMAGE]?.pixels) {
            const mapWidth = blocks[TYPE_FLAGS.MAP_IMAGE].dimensions.width;
            const mapHeight = blocks[TYPE_FLAGS.MAP_IMAGE].dimensions.height;
            const pixelSize = blocks[TYPE_FLAGS.MAP_IMAGE].pixelSize;

            const layers = [];
            const entities = [];

            let pathPoints = [];
            let calculatedRobotAngle;

            if (blocks[TYPE_FLAGS.MAP_IMAGE].pixels.floor.length > 0) {
                layers.push(new mapEntities.MapLayer({
                    pixels: blocks[TYPE_FLAGS.MAP_IMAGE].pixels.floor.sort(mapEntities.MapLayer.COORDINATE_TUPLE_SORT).flat(),
                    type: mapEntities.MapLayer.TYPE.FLOOR
                }));
            }

            if (blocks[TYPE_FLAGS.MAP_IMAGE].pixels.wall.length > 0) {
                layers.push(new mapEntities.MapLayer({
                    pixels: blocks[TYPE_FLAGS.MAP_IMAGE].pixels.wall.sort(mapEntities.MapLayer.COORDINATE_TUPLE_SORT).flat(),
                    type: mapEntities.MapLayer.TYPE.WALL
                }));
            }

            Object.keys(blocks[TYPE_FLAGS.MAP_IMAGE].pixels.segments).forEach((segmentId) => {
                const name = blocks[TYPE_FLAGS.SEGMENT_NAMES]?.[segmentId];

                layers.push(new mapEntities.MapLayer({
                    pixels: blocks[TYPE_FLAGS.MAP_IMAGE].pixels.segments[segmentId].sort(mapEntities.MapLayer.COORDINATE_TUPLE_SORT).flat(),
                    type: mapEntities.MapLayer.TYPE.SEGMENT,
                    metaData: {
                        segmentId: segmentId,
                        active: !!blocks[TYPE_FLAGS.MAP_IMAGE].activeSegments[segmentId],
                        name: name
                    }
                }));
            });


            if (blocks[TYPE_FLAGS.PATH]?.length > 0) {
                pathPoints = ThreeIRobotixMapParser.CONVERT_TO_VALETUDO_COORDINATES(blocks[TYPE_FLAGS.PATH], mapWidth, mapHeight, pixelSize);

                entities.push(new mapEntities.PathMapEntity({
                    points: pathPoints,
                    type: mapEntities.PathMapEntity.TYPE.PATH
                }));

                // Calculate robot angle from path if possible - the robot-reported angle is inaccurate
                if (pathPoints.length >= 4) {
                    calculatedRobotAngle = (Math.round(Math.atan2(
                        pathPoints[pathPoints.length - 1] -
                        pathPoints[pathPoints.length - 3],

                        pathPoints[pathPoints.length - 2] -
                        pathPoints[pathPoints.length - 4]
                    ) * 180 / Math.PI) + 90) % 360; //TODO: No idea why
                }
            }

            if (blocks[TYPE_FLAGS.ROBOT_POSITION]) {
                const x = blocks[TYPE_FLAGS.ROBOT_POSITION].x;
                const y = blocks[TYPE_FLAGS.ROBOT_POSITION].y;

                entities.push(new mapEntities.PointMapEntity({
                    points: ThreeIRobotixMapParser.CONVERT_TO_VALETUDO_COORDINATES([x, y], mapWidth, mapHeight, pixelSize),
                    metaData: {
                        angle: calculatedRobotAngle ?? blocks[TYPE_FLAGS.ROBOT_POSITION].angle
                    },
                    type: mapEntities.PointMapEntity.TYPE.ROBOT_POSITION
                }));
            } else if (uniqueMapId === 0 && pathPoints.length >= 2) {
                entities.push(new mapEntities.PointMapEntity({
                    points: [
                        pathPoints[pathPoints.length - 2],
                        pathPoints[pathPoints.length - 1]
                    ],
                    metaData: {
                        angle: calculatedRobotAngle ?? 0
                    },
                    type: mapEntities.PointMapEntity.TYPE.ROBOT_POSITION
                }));
            }

            if (blocks[TYPE_FLAGS.CHARGER_LOCATION]) {
                const x = blocks[TYPE_FLAGS.CHARGER_LOCATION].x;
                const y = blocks[TYPE_FLAGS.CHARGER_LOCATION].y;

                entities.push(new mapEntities.PointMapEntity({
                    points: ThreeIRobotixMapParser.CONVERT_TO_VALETUDO_COORDINATES([x, y], mapWidth, mapHeight, pixelSize),
                    metaData: {
                        angle: blocks[TYPE_FLAGS.CHARGER_LOCATION].angle
                    },
                    type: mapEntities.PointMapEntity.TYPE.CHARGER_LOCATION
                }));
            }

            if (blocks[TYPE_FLAGS.VIRTUAL_RESTRICTIONS]) {
                blocks[TYPE_FLAGS.VIRTUAL_RESTRICTIONS].walls.forEach((wall) => {
                    entities.push(new mapEntities.LineMapEntity({
                        points: ThreeIRobotixMapParser.CONVERT_TO_VALETUDO_COORDINATES(wall, mapWidth, mapHeight, pixelSize),
                        type: mapEntities.LineMapEntity.TYPE.VIRTUAL_WALL
                    }));
                });

                blocks[TYPE_FLAGS.VIRTUAL_RESTRICTIONS].areas.forEach((area) => {
                    entities.push(new mapEntities.PolygonMapEntity({
                        points: ThreeIRobotixMapParser.CONVERT_TO_VALETUDO_COORDINATES(area, mapWidth, mapHeight, pixelSize),
                        type: mapEntities.PolygonMapEntity.TYPE.NO_GO_AREA
                    }));
                });
            }

            if (blocks[TYPE_FLAGS.ACTIVE_ZONES]) {
                blocks[TYPE_FLAGS.ACTIVE_ZONES].areas.forEach((activeZone) => {
                    entities.push(new mapEntities.PolygonMapEntity({
                        points: ThreeIRobotixMapParser.CONVERT_TO_VALETUDO_COORDINATES(activeZone, mapWidth, mapHeight, pixelSize),
                        type: mapEntities.PolygonMapEntity.TYPE.ACTIVE_ZONE
                    }));
                });
            }

            if (layers.length > 0) {
                return new mapEntities.ValetudoMap({
                    metaData: {
                        vendorMapId: uniqueMapId
                    },
                    size: {
                        x: blocks[TYPE_FLAGS.MAP_IMAGE].dimensions.width * blocks[TYPE_FLAGS.MAP_IMAGE].pixelSize,
                        y: blocks[TYPE_FLAGS.MAP_IMAGE].dimensions.height * blocks[TYPE_FLAGS.MAP_IMAGE].pixelSize
                    },
                    pixelSize: blocks[TYPE_FLAGS.MAP_IMAGE].pixelSize,
                    layers: layers,
                    entities: entities
                });
            } else {
                return null;
            }
        } else {
            return null;
        }
    }
@param {object} blocks
@param {number} uniqueMapId
@returns {null|import("../../entities/map/ValetudoMap")}