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()

# Print lines around the key split points
split_candidates = [
    2441, # start of JS
    2555, # end of i18n
    2830, # end of iso math
    2945, # end of joystick
    3009, # end of audio/haptics
    3475, # end of combat skills
    4620, # end of canvas renderer
    4802, # end of meridian/vault
    5158, # end of shop
    5430, # end of seasonal reset
    5802, # end of agent orb
    6273, # end of worldmap/dungeons
    6479, # end of hideout
    6944, # end of endgame atlas
    7227, # end of feedback
    7619, # end of auth
    7688, # end of tooltips
    7788  # end of main
]

for s in split_candidates:
    print(f"--- Line {s+1} (idx {s}) ---")
    start = max(0, s - 2)
    end = min(len(lines), s + 3)
    for i in range(start, end):
        prefix = "-> " if i == s else "   "
        print(f"{prefix}{i+1}: {lines[i][:75]}")
