const fs = require('fs');
const path = 'c:/Users/JohannesBaumeister/Enwelo GmbH & Co. KG/1.016_BW_Scheddebrock - General/07 AutoCAD_QGis/Planungstool/index.html';
let content = fs.readFileSync(path, 'utf8');
// 1. Move/Add Checkbox above Search
const searchBlock = `
`;
const newToggleBlock = `
` + searchBlock;
if (!content.includes('id="sidebar-toggle-owner-status"')) {
content = content.replace(searchBlock, newToggleBlock);
}
// 2. Add Legend Container below Owner List
const ownerListEnd = `
\n \n
\s+<\/div>\s+
{
return legendBlock;
});
}
// Ensure owner-list is scrollable and sidebar is flex
content = content.replace('id="owner-list">', 'id="owner-list" style="flex: 1; overflow-y: auto;">');
fs.writeFileSync(path, content);
console.log("UI layout for Sicherungsstand toggle and Legend applied.");