with open("app/static/bim/index.html", "r", encoding="utf-8") as f:
    lines = f.readlines()

new_lines = []
skip = False
for i, line in enumerate(lines):
    if line.strip().startswith('}nitial-scale=1.0">'):
        # This is line 994. Keep the brace and start skipping.
        new_lines.append("      }\n")
        skip = True
        continue
    
    if skip:
        # Check if this is the end of the old block we want to skip.
        # It's line 1980 which is `    }` followed by `    // D. Móng cống`
        # Let's just look for the first line that is `    // D.` after we start skipping
        if line.strip().startswith('// D.'):
            # We found the end of the skipped section!
            # Stop skipping and add this line.
            skip = False
            new_lines.append("\n")
            new_lines.append(line)
        continue
    
    # Normal lines
    new_lines.append(line)

with open("app/static/bim/index.html", "w", encoding="utf-8") as f:
    f.writelines(new_lines)

print("Duplicates removed successfully!")
