import sys
if hasattr(sys.stdout, "reconfigure"):
    sys.stdout.reconfigure(encoding="utf-8")
from pathlib import Path

html_path = Path(r"C:\Projects\FreeExile\client\webapp\index.html")
lines = html_path.read_text(encoding="utf-8").splitlines()

script_start = 2441 # 0-indexed: line 2442
script_end = 7788   # line 7789

headers = []
for i in range(script_start, script_end):
    line = lines[i].strip()
    if line.startswith("// ========================================================================="):
        if i + 1 < script_end:
            title = lines[i+1].strip()
            if title.startswith("//"):
                headers.append((i + 1, title))

print(f"Found {len(headers)} major section headers in JavaScript:")
for line_no, title in headers:
    print(f"  Line {line_no}: {title}")
