from pathlib import Path
from bs4 import BeautifulSoup, NavigableString
p=Path('/Users/iggy/.hermes/profiles/ignite_team/outbound/st-catherines-rendered-template-text-only.html')
html=p.read_text(errors='ignore')
repl={
'Zeekr 7X':'Senior School','Zeekr 009':'Boarding','Tech Drive':'Future Ready','Zeekr X RWD':'Junior School','Zeekr X AWD':'Senior School',
'Zeekr X built on the Sustainable Experience Architecture (SEA), integrating nearly 30 years of vehicle manufacturing expertise. This global pure electric platform is developed by a 2000+ strong international engineering team.':'St Catherine’s is grounded in more than 125 years of girls’ education, combining strong academic programs with contemporary teaching, wellbeing and leadership experiences that prepare students to contribute with confidence.',
'The RWD model supports 11kW AC and 230kW DC fast charging, while the AWD steps up to 22kW AC and 150kW DC, getting you back on the road faster whatever your lifestyle demands.':'Flexible pathways, enrichment opportunities and targeted support help each student move at the right pace, building confidence while preparing for senior study, tertiary options and life beyond school.',
'Equipped with a braking system that enables the vehicle to achieve a 100km/h-0 stopping distance of only 34.5m.':'Students learn to meet pressure with calm thinking, strong preparation and the support of teachers who understand both academic ambition and personal wellbeing.',
'365 Kw (496 hp) with 573 Nm is brought by a dual-motor system, which allows 0-100 km/h acceleration in only 3.7 second (AWD)':'A culture of high expectation gives students the momentum to pursue excellence in academics, sport, performing arts, service and leadership.',
'The factory-fitted dual-mode fridge comes standard on the AWD model, keeping drinks cold and snacks warm with a temperature range from -15 to 50 degrees. Luxury built in.':'Boarding students are supported by caring staff, purposeful routines and strong friendships, creating a warm Melbourne base for girls from regional Victoria, interstate and overseas.',
'50W wireless charging panels. Centre console fast charges devices, with a non-slip design and advanced heat management for stable, efficient performance.':'Sport, music, drama, debating, outdoor education and service programs help students test interests, build friendships and develop skills beyond the classroom.',
'Intelligent battery management limits charge stress and improves thermal control, extending long-term battery life and ensuring your Zeekr X delivers consistent performance every drive.':'Students are encouraged to balance challenge with rest, curiosity with discipline and ambition with care, building sustainable habits for lifelong learning.',
'With a 3.3 kWh V2L capability, the Zeekr X can power camping gear or household essentials during an outtage, turning your SUV into a portable power source.':'The school experience becomes a launchpad for future study, leadership, alumnae connection and purposeful contribution beyond Heyington Place.',
'Key information displayed on the B-pillar before you even enter, showing charge status, door lock and special features like pet mode. Standard on the AWD model, simplifying every part of your day.':'Families can follow key dates, learning progress, events and communications through a connected school experience that keeps home and campus aligned.',
'Seven advanced airbags, including a unique front centre airbag and side curtains that stay inflated for six seconds, surround every occupant with a shield of cutting-edge protection.':'A strong wellbeing framework, child-safe culture and trusted staff relationships help every student feel noticed, protected and ready to participate fully.',
'5 HD cameras, 5 millimetre-wave radars and 12 ultrasonic sensors powered by a Mobileye EyeQ4 chip give the Zeekr X 220-metre vision, continuously monitoring lanes, traffic and pedestrians.':'Teachers, mentors and wellbeing staff work together to notice progress, guide decisions and help students navigate each stage with confidence and care.',
'The 360° camera delivers a complete bird\'s-eye view, making every park effortless and precise, whether navigating tight city spaces or squeezing into that last spot on a busy street.':'Personalised transition support and guided enrolment conversations help families understand the right entry point and next step for their daughter.',
'Internal anti-collision beams utilise an 8-tube multi-layer structure, enabling the vehicle to withstand a lateral impact force of 65 tons, enhancing both battery and passenger protection.':'St Catherine’s values of integrity, curiosity, perseverance, gratitude and empathy give students a steady foundation for learning, relationships and life beyond school.',
'Disclaimers <br/><br/>Videos and photographs on this website may include overseas models and features not available in Australia. <br/><br/>*Figures shown are based on WLTP (Worldwide Harbomised Light-Duty Vehicles Test Procedure). Real-life results may vary depending on driving style, road and traffic conditions, environmental influences, vehicle condition, use of ancillary features, and accessories fitted. The figures advertised are only to be for comparison amongst vehicles only. <br/><br/>^Real-life results may vary depending on driving style, road and traffic conditions, environmental influences, vehicle conditions, use of ancillary features, and accessories fitted. The figures advertised are only to be for comparison amongst vehicles only. <br/><br/>[A1] Warranty terms, conditions and exclusions apply. Warranty coverage (including kilometre limits) may vary depending on vehicle usage (e.g. private vs commercial use). Please refer to the full warranty terms for details.':'Concept note: copy has been rewritten for St Catherine’s School, Toorak, while retaining the supplied page layout and imagery for review only. School details should be verified before publication.',
'Disclaimers':'Concept note','Battery':'Pathways','Performance':'Learning','Range':'Journey','Exterior Colours':'Entry Points','Wheels':'Programs','Interior Colours':'Wellbeing','Electric Motor':'Program Pathway','Battery Capacity':'Student Values','Battery Type':'Learning Stage','AC Charge':'Support','DC Charge':'Opportunities','Peak Power':'Academic Focus','Drive Train':'Campus Life','WLTP Cruising Range*':'School Journey','0-100 km/h Acceleration^':'Learning Confidence','Crystal White':'Junior School','Palace Beige':'Senior School','Grid Grey':'Boarding','Onyx Black':'Co-curricular','Khaki Green':'Wellbeing','With Black Roof':'Available','With Coloured Roof':'Available','Silver':'Core Program','Black':'Extension','PU Leather':'Pastoral Care','PU Leather with Red Highlights':'Leadership Focus','5 Years or Unlimited kms, whichever comes first [A1]':'Book a tour or speak with Admissions about entry years and availability.','8 Years or 160,000 kms, whichever comes first [A1]':'Request the prospectus and explore the pathway that best suits your daughter.'
}
soup=BeautifulSoup(html,'html.parser')
for node in soup.find_all(string=True):
    if not isinstance(node,NavigableString): continue
    if node.parent and node.parent.name in {'style'}: continue
    text=str(node)
    for a,b in repl.items():
        text=text.replace(a,b)
    if text != str(node): node.replace_with(text)
p.write_text(str(soup), encoding='utf-8')
print('patched',p.stat().st_size)