Download tasks/breakoutgames-2/environment/reference/clone/static/app.js from TIGER-Lab/WebsiteBench: direct link, hf CLI and curl.
- Browser
- Download file 55.9 kB
-
https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/breakoutgames-2/environment/reference/clone/static/app.js
- Command line
-
hf download hf://datasets/TIGER-Lab/WebsiteBench/tasks/breakoutgames-2/environment/reference/clone/static/app.js
-
curl -L -o app.js https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/breakoutgames-2/environment/reference/clone/static/app.js
55.9 kB
| const rooms=[ | |
| ['CLUE','Uncover who is plotting the murder, with what weapon, and in what room in less than one hour.'], | |
| ['The Kidnapping','Wake up handcuffed and blindfolded. Use hidden clues and collective brainpower to free yourselves before the kidnapper returns.','/assets/icon-kidnapping.png'], | |
| ['Mystery Mansion',"Race the clock in an abandoned mansion and uncover the old house's secrets.",'/assets/icon-mansion.png'], | |
| ['Bomb Squad','Find and disarm a deadly bomb before Breakout City is destroyed.',null,'This room includes sudden flashes of light.'], | |
| ['Submarine Survival','Search the USS Odyssey for legendary treasure before the submarine runs out of oxygen.',null,'This room includes sudden flashes of light.'], | |
| ['Wild West',"Break into the Outhouse Kid's saloon, free your gang, and steal back your gold before dusk."], | |
| ['Runaway Train','Gain entry to the conductor’s cabin, stop the train, and free the passengers before time runs out.'], | |
| ['Museum Heist','Follow clues, find the stolen artwork, and escape before the gallery opening.'], | |
| ['Island Escape','Discover the keys to safety before lava from a waking volcano reaches the shore.']]; | |
| const page1=['learning-opportunities','aggressive-not-destructive','bringing-food-and-drinks','how-to-plan-a-corporate-team-building-escape-room-event','how-long-does-an-escape-room-take','how-much-does-an-escape-room-cost-for-a-group','how-do-escape-rooms-work','what-is-an-escape-room','who-makes-more-mistakes','best-escape-room-leaders','escape-room-prep','top-5-escape-room-tips','escape-room-mistakes','when-to-ask-for-a-hint-in-an-escape-room','team-building-that-your-team-wont-dread','myths-about-escape-rooms','team-appreciation','best-breakout-rooms-for-teens','tips-for-kids','5-lessons-kids-learn-from-escape-rooms']; | |
| const page2=['questions-your-game-master-wants-you-to-ask','escape-room-field-trip','best-advice-from-game-masters','how-to-never-lose-escape-rooms','why-escape-rooms-work-for-teams','why-escape-rooms-make-the-perfect-date','succeed-with-two-players','what-not-to-do','prioritizing-fun-in-an-escape-room','be-the-best-escape-room-player','best-breakout-rooms-for-kids','escape-room-guide-2026','unlocking-team-building-success','do-escape-rooms-lock','best-escape-room-players','what-to-wear-to-an-escape-room','beat-escape-rooms-fast','escape-room-beginners-guide','k2-officially-open','breakouts-newest-escape-room-2024']; | |
| let catalog={locations:[],blog_slugs:[],theme_slugs:[],routes:[]}; | |
| const title=s=>s.split('-').map(w=>w==='and'?'and':w.charAt(0).toUpperCase()+w.slice(1)).join(' '); | |
| const hero=(heading,sub,city='')=>`<section class="hero${city?' market-hero':''}"><video class="hero-video" src="/assets/hero-video-v2.mp4" poster="/assets/hero-poster.jpg" autoplay muted loop playsinline aria-hidden="true"></video><div><h1>${heading}</h1><p>${sub}</p><div class="actions"><a class="primary" href="${city?'/'+city+'/escape':'/company/bookings/locations'}">BOOK NOW</a><span class="or" aria-hidden="true">OR</span><a href="/${city?city+'/':''}team-building">TEAM BUILDING</a><a href="/${city?city+'/':'company/'}celebrate">CELEBRATIONS</a></div></div></section>`; | |
| const roomCards=()=>`<div class="rooms">${rooms.map((r,i)=>`<article class="room"><h3>${r[0]}</h3>${r[2]?`<img src="${r[2]}" alt="${r[0]} room icon">`:''}<h4>Your Mission:</h4><p>${r[1]}</p>${r[3]?`<p class="note"><b>Notes:</b> ${r[3]}</p>`:''}<a href="/company/design/${['clue','kidnapping','mansion','bomb-squad','submarine','wild-west','train','museum','island'][i]}">VIEW ROOM</a></article>`).join('')}</div>`; | |
| const roomIcons=()=>`<div class="room-icons">${rooms.map((r,i)=>`<a href="/company/design/${['clue','kidnapping','mansion','bomb-squad','submarine','wild-west','train','museum','island'][i]}">${r[2]?`<img src="${r[2]}" alt="">`:`<span class="line-icon">◎</span>`}<small>${r[0]}</small></a>`).join('')}</div>`; | |
| const roomRows=()=>`<div class="room-rows">${rooms.map((r,i)=>`<article><div class="room-media">${i===0?'<img src="/assets/clue-youtube-preview.jpg" alt="CLUE preview">':r[2]?`<img src="${r[2]}" alt="${r[0]} icon">`:''}</div><div><h2>${i===0?'<span class="clue-mark">Clue<small>HASBRO × <b>BREAKOUT</b></small></span>':''}<span>${r[0]}</span></h2><h4>Your Mission:</h4><p>${r[1]}</p>${r[3]?`<p class="note"><b>Notes:</b> ${r[3]}</p>`:''}<a href="/company/design/${['clue','kidnapping','mansion','bomb-squad','submarine','wild-west','train','museum','island'][i]}">PLAY NOW</a></div></article>`).join('')}</div>`; | |
| const info=(heading,body)=>`<section class="page-title"><h1>${heading}</h1></section><section class="section page-body">${body}</section>`; | |
| const locationOptions=()=>`<option value="">Select location</option>${catalog.locations.map(x=>`<option value="${x}">${title(x)}</option>`).join('')}`; | |
| const contactForm=()=>`<form class="form local-draft" data-endpoint="/api/drafts/contact"><label>First name*<input name="first_name" required></label><label>Last name*<input name="last_name" required></label><label>Email address*<input name="email" type="email" required placeholder="email@example.com"></label><label>Phone number<input name="phone" type="tel" placeholder="(123) 456-7890"></label><label>Location*<select name="location" required>${locationOptions()}</select></label><label>Message*<textarea name="message" required></textarea></label><label class="check"><input name="updates" type="checkbox"> Send me updates and exclusive deals</label><button class="btn">SAVE LOCAL DRAFT</button><p class="safe-note">Nothing is sent to Breakout Games.</p><p class="status"></p></form>`; | |
| const newsletter=()=>`<section class="section"><div class="intro"><h3>New worlds are waiting</h3><p>Save a local signup draft for updates about special offers and new rooms.</p></div><form class="newsletter local-draft" data-endpoint="/api/drafts/newsletter"><label>Email address*<input name="email" type="email" required placeholder="email@example.com"></label><button class="btn">SAVE LOCAL DRAFT</button><p class="safe-note">No subscription or email is created.</p><p class="status"></p></form></section>`; | |
| function home(){return hero('The escape room people recommend, again and again.','Play with family, friends, or coworkers - but never strangers.')+info('Choose Your Escape','<p>Explore an island, find the kidnapper, restore ancient relics. Each location has unique challenges.</p><a class="btn" href="/company/design/themes">SEE ROOMS</a>')+info('Ready to escape ordinary?','<p>Crack codes, solve puzzles and follow clues. Part problem solving, part adrenaline, end-to-end fun.</p>')+newsletter()} | |
| function market(city){const name=title(city);const offer=city==='louisville'?`<div class="offer-overlay"><div class="offer"><button aria-label="Close offer">×</button><div class="offer-photo"></div><div><h2>Unlock 10% off</h2><p>Main characters wanted. Join our mailing list to save 10% on your next Monday–Thursday game.</p><label>Email address<input placeholder="email@example.com"></label><label>Phone number<input placeholder="(123) 456-7890"></label><span class="offer-continue">CONTINUE</span></div></div></div>`:'';return offer+hero(`The escape room in ${name} people recommend, again and again.`,'Play with family, friends, or coworkers - but never strangers.',city)+`<section class="section market-escape"><div class="intro"><h5>Breakout Games - #1 Escape Room in ${name}</h5><h2>Choose Your Escape</h2><p>Play the top ${name} escape rooms. For 60 minutes, experience immersive entertainment with friends and family, escape normal life, and be the hero of the story.</p><a class="btn" href="/${city}/escape-rooms">SEE ${name.toUpperCase()} ROOMS</a></div>${roomIcons()}</section><section class="section ready"><h2>Ready to escape ordinary?</h2><p>Breakout Games has thrilling escape rooms with a variety of game themes that are perfect for friends, family, and team building.</p></section><section class="section how"><h2>How do Escape Rooms Work?</h2><p>A life-sized game of twists and turns where your team searches for clues and solves puzzles.</p></section>${newsletter()}<section class="section directions"><h2>Escape Room Directions</h2><h3>Breakout Games - ${name}</h3><p>${city==='louisville'?'1805 Cargo Ct, Louisville, KY 40299':'Visit the local directions page for arrival details.'}</p><a href="/${city}/directions">GET DIRECTIONS</a></section>`} | |
| function booking(city=''){if(city==='baltimore')return info('Play Now',`<p>Choose one of the two Baltimore-area locations. Game times and checkout remain on external providers.</p><div class="choice-grid"><article><h2>Timonium</h2><p>1840 York Road Suite J<br>Timonium, MD 21093</p><div class="boundary"><strong>External booking boundary</strong><p>Availability and payment are not reproduced locally.</p></div></article><article><h2>Columbia</h2><p>9017 Mendenhall Court Suite G<br>Columbia, MD 21045</p><div class="boundary"><strong>External booking boundary</strong><p>Availability and payment are not reproduced locally.</p></div></article></div>`);return info('Book a Room',`<p>Choose a location and save a game plan locally. No provider booking or payment occurs.</p><form id="booking" class="form"><label>Location<select name="location" required><option value="">Choose</option>${catalog.locations.map(x=>`<option>${title(x)}</option>`).join('')}</select></label><label>Room<select name="room" required><option value="">Choose</option>${rooms.map(r=>`<option>${r[0]}</option>`).join('')}</select></label><label>Party size<input name="party_size" type="number" min="2" max="12" required></label><label>Visit date<input name="visit_date" type="date" required></label><button class="btn">SAVE LOCAL GAME PLAN</button><p class="status"></p></form>`)} | |
| const faq=()=>info('Frequently Asked Questions in Louisville',`<div class="faq">${['What is an escape game?','How difficult are the escape rooms?','Is there a limit to the number of players?','What time should my group arrive?','Do I need to bring anything with me to escape?','Are you really going to lock us in?','Are there cameras in the escape rooms?',"What happens if we don't solve anything?",'How much does an experience cost?','Do I need to book in advance?'].map((q,i)=>`<details><summary>${q}</summary><p>${i===3?'Arrive 15 minutes before your scheduled game.':'Each private adventure is designed to be safe, collaborative, and explained by your game master.'}</p></details>`).join('')}</div>`); | |
| function blogIndex(){const page=new URLSearchParams(location.search).get('page')==='2'?2:1;const slugs=page===2?page2:page1;return `<section class="blog-index"><div class="blog-cover"><img src="/assets/hero-poster.jpg" alt=""><h1>INTO THE MAZE</h1><p>the official Breakout blog</p></div><div class="blog-search"><span>Search</span><b aria-hidden="true"></b></div><div class="blog-grid">${slugs.map((s,i)=>`<a class="blog-card article" href="/blog/${s}"><img src="/assets/${i===0&&page===1?'learning-opportunities-hero.jpg':i%2?'hero-poster.jpg':'clue-youtube-preview.jpg'}" alt=""><small>${i?'August 7, 2026':'August 21, 2026'}</small><h2>${i===0&&page===1?"Unlocking Your Student's Potential: Learning Opportunities in Escape Rooms":title(s)}</h2><b>BY HANNAH TAYLOR</b></a>`).join('')}</div><p class="pager">${page===2?'<a href="/blog?page=1">« Previous</a>':'<a href="/blog?page=2">Next »</a>'}</p></section>`} | |
| function themeDetail(slug){const mission=slug==='clue'?'Hasbro and Breakout Games have teamed up to bring you the first official “Clue: The Escape Room.” The mystery game millions have loved is reimagined for you and your friends to experience and solve in person. Save the day by uncovering who is plotting the murder, with what weapon, and in what room all in less than 1 hour. | CLUE and all related characters are trademarks of Hasbro and are used with permission. © 2026 Hasbro. All Rights Reserved. Licensed by Hasbro.':'Enter an immersive, story-driven world and work together to solve the mystery before time expires.';return `<section class="theme-detail"><div class="theme-lead"><div><img src="/assets/clue-youtube-preview.jpg" alt="CLUE preview"><h1>${title(slug)}</h1></div><div><h3>YOUR MISSION:</h3><p>${mission}</p><span class="theme-play">PLAY NOW</span></div></div><div class="theme-how"><div><h2>HOW DOES IT WORK?</h2><p>Each escape room is elaborately designed by professional set designers as well as a virtual reality team, so you'll find realistic props and hidden, story-driven technology.</p></div><img src="/assets/rooms-how-does-it-work.jpg" alt="4 people looking at clues on a brick wall at an escape room in Louisville, Kentucky"></div><section class="other-themes"><h2>OTHER ESCAPE ROOMS</h2></section></section>`} | |
| const themes=()=>`<section class="themes"><h1>ESCAPE ROOM THEMES</h1><p class="themes-intro">Breakout has created over 15 escape rooms all in house. Our most recent games have over 10,000 lines of code and movie quality production sets.</p><div class="theme-grid">${rooms.concat(rooms,rooms).slice(0,26).map((r,i)=>`<article class="room"><a href="/company/design/${['kidnapping','hostage','clue','mansion'][i%4]}"><img src="/assets/${i===0?'theme-kidnapping.jpg':i===1?'theme-hostage.jpg':i%4===2?'theme-clue.jpg':i%3===0?'clue-youtube-preview.jpg':'hero-poster.jpg'}" alt=""><h2>${i===0?'THE KIDNAPPING':i===1?'HOSTAGE':r[0]}</h2></a></article>`).join('')}</div></section>`; | |
| const waiverPage=()=>`<section class="page-title waiver-title"><h1>Fill Out Waiver</h1></section><section class="waiver-content"><p>Before your game, you’ll need to fill out a quick waiver. Save time on game day by filling out your waiver in advance.</p><p>If you’re part of a team with multiple rooms booked, you don’t need to select the exact room you’ll be playing.<br>Your organizer will assign teams, or we can assign you a room when you arrive.</p><span class="waiver-button">LOUISVILLE WAIVER</span></section><section class="waiver-skyline" aria-hidden="true"></section>`; | |
| const editorialIndex=()=>`<section class="editorial-index"><div class="editorial-title"><h1>WHAT ARE ESCAPE ROOMS?</h1></div><article class="editorial-opening"><div class="editorial-image"><img src="/assets/rooms-how-does-it-work.jpg" alt="Players exploring clues in an escape room"></div><div class="editorial-copy"><p>By now, you’ve probably seen your friends or family posting photos holding up an “I Broke Out” sign and bragging about an escape time. But if you’ve never played an escape room, you are probably asking yourself, “What on Earth is that?!” Escape Rooms have been one of the world’s most thrilling entertainment concepts for many years now, and Breakout Games is one of the largest (and most exciting!) escape rooms in the United States with over 35 locations!</p><p>You can think of an escape room like a live-action video game or a fully immersive strategy and puzzle game. You and your team will have an hour to discover clues, crack codes, and solve the mystery of your room. If you solve everything in time, you’ll break out!</p><p>Each room has a theme and is designed around a unique storyline. There’s something for everyone and every occasion. Whether you are celebrating a birthday, planning an office party, or going on a date, you will have the time of your life in this adrenaline-packed adventure!</p><p>Sounds like fun, right?</p><p>If you are ready to book your next adventure, <a href="/company/bookings/locations">click here</a>, but if you need a little more of an explanation, take a look below!</p></div><h2>WHAT DO YOU DO IN AN ESCAPE ROOM?</h2></article></section>`; | |
| function baltimoreChooser(heading,variant=''){return `<section class="chooser ${variant}"><h1>${heading}</h1><p>Pick a Breakout location in Baltimore</p><div class="chooser-links"><span>TIMONIUM</span><span>COLUMBIA</span></div><div class="chooser-panorama"></div><h2>ESCAPE ROOM DIRECTIONS</h2></section>`} | |
| function marketFamily(city,suffix){const name=title(city);if(suffix==='escape-rooms')return info(`Escape Rooms in ${name}`,roomRows());if(suffix==='prices')return team(city);if(suffix==='directions')return `<section class="directions-page"><h1>ESCAPE ROOM DIRECTIONS</h1><div class="directions-field"><form class="directions-form"><p>Looking for the best Louisville escape room experience? Provide your address below for directions:</p><label>Mailing Address<input aria-label="Mailing Address"></label><button type="button">SUBMIT</button></form></div><h2>ESCAPE ROOM ${name.toUpperCase()} DIRECTIONS</h2></section>`;if(suffix==='waivers')return waiverPage();if(suffix==='jobs')return `<section class="jobs"><h1>JOIN OUR ${name.toUpperCase()} TEAM</h1><img src="/assets/hero-poster.jpg" alt="Breakout team"><p>Breakout Games - #1 Escape Room in ${name} is looking for team members to help us run our ${name} escape games. It's a great environment, friendly and fun — never a dull moment. Apply now and we'll contact you soon.</p><div class="job-copy"><h2>BREAKOUT IS HIRING GAME MASTERS</h2><p>We are looking for a highly motivated individual to join our team. This is the perfect job for someone who loves problem-solving, working with people, and providing a rewarding customer experience.</p></div></section>`;if(suffix==='gift-cards'&&city==='baltimore')return baltimoreChooser('GIFT CARDS','gift-offer');if(suffix.includes('gift-cards')||suffix==='purchase')return gift(city);if(suffix.includes('book')||suffix==='escape')return city==='baltimore'?baltimoreChooser('PLAY NOW',suffix==='bookings'?'booking-fomo':''):booking(city);if(suffix==='team-building')return team(city);if(suffix==='celebrate')return celebrate(city);return info(title(suffix),`<p class="evidence-label">Sitemap-discovered route; representative body not directly observed.</p><p>Breakout Games ${name}: ${title(suffix)}.</p>`)} | |
| const team=(city='')=>`<section class="team-hero"><picture><source media="(max-width: 700px)" srcset="/assets/team-building-hero-mobile.webp"><img src="/assets/team-building-hero-desktop.webp" alt=""></picture></section><section class="team-intro"><p>CORPORATE & COMMUNITY TEAM-BUILDING</p><h1>EVERY MEMBER OF YOUR GROUP IS ESSENTIAL TO THE STORY.</h1><p>Level up your corporate team, school group, or youth group. In a Breakout escape room, you'll work together to solve problems in an immersive, story-driven world — with real-world benefits for your team.</p><a class="team-start" href="#team-details">GET STARTED</a></section><section id="team-details" class="section team-details"><h2>Escape Ordinary</h2><p>We've spent the last 10 years hosting corporate and community teams across a wide range of industries and organizations.</p><h2>Fun Comes First</h2><p>From the moment you walk in, your team is here to play, laugh, and celebrate together.</p><h2>What's Included</h2><p>All private rooms, post-game debriefing materials, and group photos.</p><h2>Choose Your Path to Adventure.</h2><p>Community teams include schools, churches, youth groups, sports teams and non-profits. Corporate teams focus on private collaboration, problem-solving, and fun.</p><form class="form local-draft" data-endpoint="/api/drafts/team-building"><label>Location<select name="location" required>${locationOptions()}</select></label><label>Group type<select name="group_type" required><option value="">Select</option><option>Community</option><option>Corporate</option></select></label><label>Your name*<input name="name" required></label><label>Email address*<input name="email" type="email" required></label><label>Organization/company name*<input name="organization" required></label><label>Phone*<input name="phone" required></label><label>How many people will play?*<input name="max_players" type="number" min="2" max="200" required></label><label>Preferred start*<input name="preferred_start" type="date" required></label><label>Preferred end*<input name="preferred_end" type="date" required></label><label>Message*<textarea name="message" required></textarea></label><button class="btn">SAVE LOCAL INQUIRY DRAFT</button><p class="safe-note">Nothing is sent and no reservation is made.</p><p class="status"></p></form></section>`; | |
| const celebrate=(city='')=>info(city?'Celebrate at Breakout':'Breakout for Celebrations',`<p>${city?"Looking for a unique, unforgettable way to celebrate your next birthday or big moment? Challenge your crew with an immersive adventure, work together to solve puzzles, and create memories you'll talk about for years to come.":'Challenge your crew with an immersive adventure and create memories for birthdays, anniversaries, bachelor or bachelorette parties, proposals, and other big moments.'}</p>${city?`<a class="celebration-start" href="#get-started">GET STARTED</a><form id="get-started" class="form local-draft celebration-plan" data-endpoint="/api/drafts/celebration"><label>Your name*<input name="name" required></label><label>Email address*<input name="email" type="email" required></label><label>Location*<select name="location" required>${locationOptions()}</select></label><label>Occasion*<input name="occasion" required></label><label>Party size*<input name="party_size" type="number" min="2" max="200" required></label><label>Message*<textarea name="message" required></textarea></label><button class="btn">SAVE LOCAL INQUIRY DRAFT</button><p class="safe-note">Nothing is sent and no quote is requested.</p><p class="status"></p></form>`:'<a class="btn" href="/company/bookings/locations">CHOOSE YOUR LOCATION</a>'}`); | |
| const gift=(city='')=>info(city?`Purchase Gift Card for ${title(city)}`:'Escape Room Gift Cards',`<p>Escape rooms make great gifts. Prepare a local review plan below; no gift card is issued and no payment is taken.</p><form class="form local-draft gift-plan" data-endpoint="/api/gift-card-plan"><label>Location*<select name="location" required>${locationOptions()}</select></label><label>Amount*<select name="amount_cents" required><option value="">Choose</option><option value="2500">$25</option><option value="5000">$50</option><option value="7500">$75</option><option value="10000">$100</option><option value="15000">$150</option><option value="20000">$200</option></select></label><label>Recipient name<input name="recipient_name"></label><button class="btn">SAVE LOCAL REVIEW PLAN</button><p class="safe-note">No checkout or payment exists in this clone.</p><p class="status"></p></form>`); | |
| const sandboxHeaders={'content-type':'application/json','X-WebsiteBench-Action':'local-sandbox'}; | |
| const money=cents=>new Intl.NumberFormat('en-US',{style:'currency',currency:'USD'}).format(cents/100); | |
| function taskBooking(){ | |
| return `<section class="page-title"><h1>Book a Room</h1></section><section class="section page-body booking-flow"> | |
| <p class="sandbox-banner"><strong>Local sandbox:</strong> this flow never contacts Breakout Games, takes payment, or creates a real reservation.</p> | |
| <ol class="booking-steps" aria-label="Booking progress"><li data-booking-step="1" aria-current="step"><span>1</span>Choose adventure</li><li data-booking-step="2"><span>2</span>Add guest details</li><li data-booking-step="3"><span>3</span>Review locally</li></ol> | |
| <div class="booking-layout"> | |
| <div class="booking-builder"> | |
| <div id="nearest" class="nearest" role="note"><strong>Finding the nearest location to Downtown Toronto…</strong></div> | |
| <form id="booking" class="form" aria-describedby="booking-help"> | |
| <p id="booking-help">Choose a horror or thriller room for 4 people on the upcoming Saturday, between 7 PM and 9 PM.</p> | |
| <label>Location<input name="location_name" readonly aria-describedby="nearest"></label> | |
| <label>Theme<select name="theme" required disabled><option value="">Choose theme</option><option value="horror">Horror</option><option value="thriller">Thriller</option></select></label> | |
| <label>Room<select name="room_id" required disabled><option value="">Choose a theme first</option></select></label> | |
| <label>Party size<input name="party_size" type="number" value="4" readonly></label> | |
| <label>Visit date<input name="visit_date" type="date" readonly></label> | |
| <label>Evening time<select name="time_slot" required disabled><option value="">Choose time</option></select></label> | |
| <label>Package<select name="package_id" required><option value="private-room">Private room package</option><option value="standard">Standard private room</option></select></label> | |
| <label>Attendee name<input name="customer_name" value="Local Sandbox Guest" required maxlength="120"></label> | |
| <label>Customer email<input name="customer_email" type="email" value="guest@example.test" required></label> | |
| <label>Customer phone<input name="customer_phone" type="tel" value="+1 416 555 0199" required></label> | |
| <label>Special requests<textarea name="special_requests" maxlength="1000">No special requests.</textarea></label> | |
| <label>Sandbox payment scenario<select name="payment_scenario" required><option value="sandbox-approved">Simulated approval</option><option value="sandbox-declined">Simulated decline</option><option value="sandbox-retry">Simulated retry</option></select></label> | |
| <p class="safe-note">Do not enter a card number. This adapter records only a named local simulation outcome.</p> | |
| <button class="btn review-submit" disabled>REVIEW LOCAL BOOKING</button> | |
| <p class="status" role="status" aria-live="polite"></p> | |
| </form> | |
| </div> | |
| <aside class="booking-sidebar" aria-label="Booking review"> | |
| <section id="bookingEmpty" class="booking-empty"><span class="sidebar-kicker">Step 3 · Review</span><h2>Your booking</h2><p>Complete the room and guest details. The server will verify availability and price before confirmation.</p><dl><div><dt>Nearest location</dt><dd data-live="location">Finding…</dd></div><div><dt>Room</dt><dd data-live="room">Not selected</dd></div><div><dt>Date</dt><dd data-live="date">Upcoming Saturday</dd></div><div><dt>Time</dt><dd data-live="time">7–9 PM</dd></div></dl></section> | |
| <section id="bookingReview" class="booking-review" hidden aria-labelledby="reviewHeading"> | |
| <span class="sidebar-kicker">Server verified</span><h2 id="reviewHeading" tabindex="-1">Review your local booking</h2> | |
| <dl><div><dt>Location</dt><dd data-review="location"></dd></div><div><dt>Room</dt><dd data-review="room"></dd></div><div><dt>Theme</dt><dd data-review="theme"></dd></div><div><dt>Package</dt><dd data-review="package"></dd></div><div><dt>Attendee</dt><dd data-review="customer"></dd></div><div><dt>Special requests</dt><dd data-review="special"></dd></div><div><dt>Party</dt><dd data-review="party"></dd></div><div><dt>Date and time</dt><dd data-review="datetime"></dd></div><div><dt>Payment</dt><dd data-review="payment"></dd></div><div><dt>Total</dt><dd data-review="total"></dd></div></dl> | |
| <p>No real inventory, booking, payment, email, or text message will be created.</p> | |
| <div class="review-actions"><button id="editBooking" class="btn btn-secondary" type="button">EDIT DETAILS</button><button id="confirmBooking" class="btn" type="button">CONFIRM IN LOCAL SANDBOX</button></div> | |
| </section> | |
| <section id="bookingResult" class="booking-result" role="status" aria-live="polite" hidden></section> | |
| </aside> | |
| </div> | |
| </section>`; | |
| } | |
| async function sandboxApi(path,payload){ | |
| const response=await fetch(path,{method:'POST',headers:sandboxHeaders,body:JSON.stringify(payload)}); | |
| let body={error:'Unexpected server response.'}; | |
| try{body=await response.json()}catch{} | |
| if(!response.ok)throw Object.assign(new Error(body.error||'Request failed.'),{status:response.status}); | |
| return body; | |
| } | |
| function wireTaskBooking(){ | |
| const form=document.querySelector('#booking'); | |
| if(!form||!form.elements.theme)return; | |
| const status=form.querySelector('.status'),theme=form.elements.theme,room=form.elements.room_id; | |
| const review=document.querySelector('#bookingReview'),result=document.querySelector('#bookingResult'),empty=document.querySelector('#bookingEmpty'); | |
| let bookingCatalog,preview,manage,idempotency=crypto.randomUUID(); | |
| const fail=error=>{status.textContent=error.message||String(error);status.className='status error';status.setAttribute('role','alert')}; | |
| const setStep=step=>document.querySelectorAll('[data-booking-step]').forEach(item=>item.toggleAttribute('aria-current',item.dataset.bookingStep===String(step))); | |
| const live=(key,value)=>{const node=document.querySelector(`[data-live="${key}"]`);if(node)node.textContent=value}; | |
| const updateLive=()=>{const selectedRoom=room.selectedOptions[0],selectedTime=form.elements.time_slot.selectedOptions[0];live('location',form.elements.location_name.value||'Finding…');live('room',room.value?selectedRoom.textContent:'Not selected');live('date',form.elements.visit_date.value||'Upcoming Saturday');live('time',form.elements.time_slot.value?selectedTime.textContent:'7–9 PM');if(!preview)setStep(theme.value&&room.value&&form.elements.time_slot.value?2:1)}; | |
| const invalidatePreview=()=>{if(!preview)return;preview=null;review.hidden=true;result.hidden=true;empty.hidden=false;status.textContent='Details changed. Review the updated selection again.';status.className='status';updateLive()}; | |
| fetch('/api/booking-catalog?party_size=4').then(async response=>{const body=await response.json();if(!response.ok)throw new Error(body.error||'Catalog unavailable.');return body}).then(data=>{ | |
| bookingCatalog=data; | |
| const nearest=document.querySelector('#nearest'),heading=document.createElement('strong'),detail=document.createElement('p'); | |
| heading.textContent=`${data.recommended_location.name} is the nearest available location.`; | |
| detail.textContent=`${data.recommended_location.explanation} Approximate distance: ${data.recommended_location.distance_km} km. Candidates checked: ${Object.entries(data.recommended_location.candidate_distances_km).map(([name,distance])=>`${title(name)} ${distance} km`).join(', ')}.`; | |
| nearest.replaceChildren(heading,detail);form.elements.location_name.value=data.recommended_location.name;form.elements.visit_date.value=data.upcoming_saturday; | |
| for(const slot of data.time_slots)form.elements.time_slot.add(new Option(`${slot.start}–${slot.end}`,slot.id)); | |
| theme.disabled=false;form.elements.time_slot.disabled=false;form.querySelector('button').disabled=false; | |
| status.textContent=`Times shown in ${data.timezone}. Availability, package, price, and sandbox outcome are checked by the server.`; | |
| updateLive(); | |
| }).catch(fail); | |
| theme.onchange=()=>{room.replaceChildren(new Option('Choose room',''));for(const item of bookingCatalog.rooms.filter(item=>item.theme===theme.value))room.add(new Option(`${item.name} (${title(item.theme)})`,item.id));room.disabled=!theme.value}; | |
| form.addEventListener('input',()=>{invalidatePreview();updateLive()});form.addEventListener('change',()=>{invalidatePreview();updateLive()}); | |
| form.onsubmit=async event=>{ | |
| event.preventDefault();if(!form.reportValidity())return; | |
| const selection={location_id:bookingCatalog.recommended_location.id,room_id:room.value,party_size:4,visit_date:form.elements.visit_date.value,time_slot:form.elements.time_slot.value,package_id:form.elements.package_id.value,customer_name:form.elements.customer_name.value,customer_email:form.elements.customer_email.value,customer_phone:form.elements.customer_phone.value,special_requests:form.elements.special_requests.value,payment_scenario:form.elements.payment_scenario.value}; | |
| try{ | |
| preview=await sandboxApi('/api/bookings/preview',selection); | |
| const values={location:preview.location.name,room:preview.room.name,theme:title(preview.room.theme),package:preview.package.name,customer:`${preview.customer.name} · ${preview.customer.email} · ${preview.customer.phone}`,special:preview.customer.special_requests,party:`${preview.party_size} people`,datetime:`${preview.visit_date}, ${preview.time_slot.start}–${preview.time_slot.end} (${preview.timezone})`,payment:`${preview.payment.scenario} → ${preview.payment.outcome}; local sandbox only`,total:`${money(preview.total_cents)} ${preview.currency}`}; | |
| for(const [key,value] of Object.entries(values))document.querySelector(`[data-review="${key}"]`).textContent=value; | |
| empty.hidden=true;review.hidden=false;result.hidden=true;setStep(3);status.textContent='Review the server-verified details in the right panel.';status.className='status success';document.querySelector('#reviewHeading').focus(); | |
| }catch(error){fail(error)} | |
| }; | |
| document.querySelector('#editBooking').onclick=()=>{invalidatePreview();theme.focus()}; | |
| document.querySelector('#confirmBooking').onclick=async()=>{if(!preview)return fail(new Error('Review the current details before confirming.')); | |
| try{ | |
| const confirmed=await sandboxApi('/api/bookings',{location_id:preview.location.id,room_id:preview.room.id,party_size:preview.party_size,visit_date:preview.visit_date,time_slot:preview.time_slot.id,package_id:preview.package.id,customer_name:preview.customer.name,customer_email:preview.customer.email,customer_phone:preview.customer.phone,special_requests:preview.customer.special_requests,payment_scenario:preview.payment.scenario,idempotency_key:idempotency}); | |
| manage={confirmation_code:confirmed.confirmation_code,manage_token:confirmed.manage_token}; | |
| result.innerHTML='<h2 tabindex="-1">Local sandbox confirmation</h2><p class="confirmation"></p><p class="result-message"></p><div class="result-actions"><button class="btn" data-action="reschedule">RESCHEDULE TO OTHER SLOT</button><button class="btn" data-action="contact">CONTACT LOCALLY</button><button class="btn" data-action="review">SAVE LOCAL REVIEW</button><button class="btn" data-action="book-again">BOOK AGAIN</button><a class="btn" data-action="start-new-booking" href="/book" hidden>START NEW BOOKING</a><button class="btn" data-action="cancel">CANCEL LOCAL BOOKING</button><button class="btn" data-action="restore" hidden>RESTORE LOCAL BOOKING</button></div>'; | |
| result.querySelector('.confirmation').textContent=`Confirmation: ${confirmed.confirmation_code} · ${confirmed.visit_date} · ${confirmed.time_slot} · ${money(confirmed.total_cents)} USD`; | |
| for(const field of form.elements)field.disabled=true; | |
| result.querySelector('.result-message').textContent=confirmed.message;result.hidden=false;review.hidden=true;result.querySelector('h2').focus();wireManageButtons(); | |
| }catch(error){fail(error)} | |
| }; | |
| function wireManageButtons(){ | |
| const message=result.querySelector('.result-message'),cancel=result.querySelector('[data-action="cancel"]'),restore=result.querySelector('[data-action="restore"]'); | |
| cancel.onclick=async()=>{try{const data=await sandboxApi('/api/bookings/cancel',manage);message.textContent=`Status: ${data.status}. This remains local only.`;cancel.hidden=true;restore.hidden=false;restore.focus()}catch(error){fail(error)}}; | |
| restore.onclick=async()=>{try{const data=await sandboxApi('/api/bookings/restore',manage);message.textContent=`Status: ${data.status}. No real reservation was made.`;restore.hidden=true;cancel.hidden=false;cancel.focus()}catch(error){fail(error)}}; | |
| result.querySelector('[data-action="reschedule"]').onclick=async()=>{try{const alternative=bookingCatalog.time_slots.find(item=>item.id!==preview.time_slot.id);const data=await sandboxApi('/api/bookings/reschedule',{...manage,visit_date:preview.visit_date,time_slot:alternative.id});preview.time_slot=alternative;message.textContent=`Rescheduled locally to ${data.time_slot}.`}catch(error){fail(error)}}; | |
| result.querySelector('[data-action="contact"]').onclick=async()=>{try{const data=await sandboxApi('/api/bookings/post-action',{...manage,action:'contact',message:'Please confirm accessibility for this local sandbox fixture.'});message.textContent=data.message}catch(error){fail(error)}}; | |
| result.querySelector('[data-action="review"]').onclick=async()=>{try{const data=await sandboxApi('/api/bookings/post-action',{...manage,action:'review',rating:5,message:'Great local sandbox experience.'});message.textContent=data.message}catch(error){fail(error)}}; | |
| result.querySelector('[data-action="book-again"]').onclick=async()=>{try{await sandboxApi('/api/bookings/post-action',{...manage,action:'book-again'});const startNew=result.querySelector('[data-action="start-new-booking"]');message.textContent='Book-again selection prepared locally. Your current booking remains manageable on this page.';startNew.hidden=false;startNew.focus()}catch(error){fail(error)}}; | |
| } | |
| } | |
| function wireSafeDrafts(){ | |
| document.querySelectorAll('form.local-draft').forEach(form=>form.onsubmit=async event=>{ | |
| event.preventDefault();const status=form.querySelector('.status');if(!form.reportValidity())return; | |
| try{const data=await sandboxApi(form.dataset.endpoint,Object.fromEntries(new FormData(form)));status.textContent=data.message;status.className='status success';status.setAttribute('role','status');status.setAttribute('aria-live','polite')} | |
| catch(error){status.textContent=error.message;status.className='status error';status.setAttribute('role','alert')} | |
| }); | |
| } | |
| function experiencesPage(){ | |
| return info('Find an Experience',`<p class="canonical-path">Experience records and actions · <code>/experiences</code></p> | |
| <form id="experienceSearch" class="form experience-search" role="search"> | |
| <label>Search by location or theme<input name="q" type="search" placeholder="Try horror or Pittsburgh"></label> | |
| <label>Sort results<select name="sort"><option value="distance">Nearest to Downtown Toronto</option><option value="rating">Highest rating</option><option value="price">Lowest price</option></select></label> | |
| <label>Maximum price per person<select name="max_price_cents"><option value="0">Any price</option><option value="4000">$40</option><option value="4500">$45</option></select></label> | |
| <label class="check"><input name="available" type="checkbox"> Available experiences only</label> | |
| <button class="btn">SEARCH EXPERIENCES</button> | |
| </form> | |
| <p id="experienceStatus" role="status" aria-live="polite"></p><div id="experienceResults" class="experience-grid"></div> | |
| <p><a href="/account/bookings">Open booking history</a> · <a href="/account/sign-in">Sign in</a></p>`); | |
| } | |
| function experienceDetailPage(){return info('Pittsburgh Experience',`<p class="canonical-path"><code>/experiences/pittsburgh</code></p><article id="experienceDetail" class="experience-detail" aria-live="polite"><p>Loading server-authoritative experience details…</p></article><section class="availability-compare"><h2>Compare Available Slots</h2><form id="availabilityCompare" class="form"><label>Date<input name="visit_date" type="date" required></label><label>Party size<input name="party_size" type="number" min="2" max="8" value="4" required></label><label>Room / service<select name="room_id" required><option value="the-kidnapping">The Kidnapping · Thriller</option><option value="mystery-mansion">Mystery Mansion · Horror</option></select></label><button class="btn">COMPARE SLOTS</button></form><div id="availabilityResults" role="status" aria-live="polite"></div></section><p><a href="/experiences">Back to all experiences</a></p>`)} | |
| function signInPage(){return info('Sign in',`<p>Use a local account only. No identity provider or source credential is accepted.</p><form id="signInForm" class="form account-form"><label>Email or username<input name="email" type="email" autocomplete="username" required></label><label>Password<input name="password" type="password" autocomplete="current-password" required minlength="8"></label><button class="btn">SIGN IN LOCALLY</button><p class="status" role="status" aria-live="polite"></p></form><p>Identity-provider choice: <button type="button" disabled aria-disabled="true">Source IdP unavailable offline</button></p><p><a href="/account/recovery">Forgot password?</a> · <a href="/account/register">Create a local account</a> · <a href="/experiences">Return to experiences</a></p>`)} | |
| function registerPage(){return info('Create a local account',`<p>Verification guidance: this offline sandbox creates a site-local verified fixture and sends no email, SMS, or source request.</p><form id="registerForm" class="form account-form"><label>Display name<input name="display_name" required maxlength="120"></label><label>Email address<input name="email" type="email" autocomplete="username" required></label><label>Contact phone<input name="phone" type="tel" required></label><label>Password<input name="password" type="password" autocomplete="new-password" required minlength="8"></label><label class="check"><input name="accepted_terms" type="checkbox" required> I accept the <a href="/company/privacy-policy">local sandbox terms and privacy notice</a>.</label><button class="btn">CREATE LOCAL ACCOUNT</button><p class="status" role="status" aria-live="polite"></p></form><p><a href="/account/sign-in">Return to sign in</a></p>`)} | |
| function recoveryPage(){return info('Password recovery',`<p>Enter a reset address to validate the local recovery request. Delivery is disabled: no email or message will be sent.</p><form id="recoveryForm" class="form account-form"><label>Reset email address<input name="email" type="email" required aria-describedby="resetGuidance"></label><p id="resetGuidance">Use a valid email format. The public response never reveals whether an account exists.</p><button class="btn">VALIDATE LOCAL RECOVERY</button><p class="status" role="status" aria-live="polite"></p></form><p><a href="/account/sign-in">Return to sign in</a></p>`)} | |
| function historyPage(){return info('Booking History',`<p>Private local account history only. Signed-out users receive a permission prompt.</p><div id="historyStatus" role="status" aria-live="polite">Loading private history…</div><button id="seedHistory" class="btn" hidden>LOAD SEEDED OFFLINE HISTORY</button><div id="bookingHistory" class="history-list"></div><p><a href="/experiences">Back to experience records and actions</a></p>`)} | |
| let sessionState=null; | |
| async function getSession(){const response=await fetch('/api/session',{cache:'no-store'});sessionState=await response.json();return sessionState} | |
| async function sessionApi(path,payload){const session=await getSession();const response=await fetch(path,{method:'POST',headers:{...sandboxHeaders,'X-CSRF-Token':session.csrf_token},body:JSON.stringify(payload)});const body=await response.json().catch(()=>({error:'Unexpected server response.'}));if(!response.ok)throw Object.assign(new Error(body.error||'Request failed.'),{status:response.status,body});sessionState=null;return body} | |
| function showFormStatus(form,message,error=false){const status=form.querySelector('.status');status.textContent=message;status.className=`status ${error?'error':'success'}`;status.setAttribute('role',error?'alert':'status')} | |
| function wireExperiences(){ | |
| const form=document.querySelector('#experienceSearch'),results=document.querySelector('#experienceResults'),status=document.querySelector('#experienceStatus'); | |
| if(form){ | |
| const run=async()=>{const params=new URLSearchParams(new FormData(form));if(!form.elements.available.checked)params.delete('available');else params.set('available','true');if(params.get('max_price_cents')==='0')params.delete('max_price_cents');status.textContent='Searching local experiences…';const response=await fetch(`/api/experiences?${params}`);const data=await response.json();results.replaceChildren();if(!data.results.length){const empty=document.createElement('section');empty.className='no-results';const heading=document.createElement('h2');heading.textContent='No experiences match your search.';const link=document.createElement('a');link.href='/experiences';link.textContent='Return to available experience records and actions';empty.append(heading,link);results.append(empty);status.textContent='0 results.';return}for(const item of data.results){const card=document.createElement('article');const heading=document.createElement('h2');const link=document.createElement('a');link.href=`/experiences/${item.id}`;link.textContent=item.name;heading.append(link);const meta=document.createElement('p');meta.textContent=`${item.rating} rating · ${money(item.price_cents)} per person · ${item.distance_km} km from Downtown Toronto · ${item.available?'Available':'Unavailable'}`;const themes=document.createElement('p');themes.textContent=`Themes: ${item.themes.map(title).join(', ')}`;const save=document.createElement('button');save.className='btn';save.textContent='SAVE LOCATION';save.onclick=async()=>{try{await sessionApi('/api/favorites',{location_id:item.id});save.textContent='SAVED';save.disabled=true}catch(error){status.textContent=error.message;status.setAttribute('role','alert')}};card.append(heading,meta,themes,save);results.append(card)}status.textContent=`${data.count} experience${data.count===1?'':'s'} found.`}; | |
| form.onsubmit=event=>{event.preventDefault();run().catch(error=>{status.textContent=error.message;status.setAttribute('role','alert')})}; | |
| const q=new URLSearchParams(location.search).get('q');if(q)form.elements.q.value=q;run(); | |
| } | |
| const detail=document.querySelector('#experienceDetail'); | |
| if(detail){ | |
| fetch('/api/experiences/pittsburgh').then(response=>response.json()).then(item=>{detail.replaceChildren();const description=document.createElement('p');description.textContent=item.description;detail.append(description);for(const [heading,value] of Object.entries({Pricing:item.pricing,Reviews:item.reviews,Policies:item.policies,Availability:item.availability})){const section=document.createElement('section');const h=document.createElement('h2');h.textContent=heading;const p=document.createElement('p');p.textContent=value;section.append(h,p);detail.append(section)}}).catch(()=>{detail.textContent='Experience details are temporarily unavailable.'}); | |
| const availabilityForm=document.querySelector('#availabilityCompare'),availabilityResults=document.querySelector('#availabilityResults'); | |
| fetch('/api/booking-catalog?party_size=4').then(response=>response.json()).then(data=>{availabilityForm.elements.visit_date.value=data.upcoming_saturday}); | |
| availabilityForm.onsubmit=async event=>{event.preventDefault();if(!availabilityForm.reportValidity())return;const params=new URLSearchParams(new FormData(availabilityForm));params.set('location_id','pittsburgh');const response=await fetch(`/api/availability?${params}`);const data=await response.json();if(!response.ok){availabilityResults.textContent=data.error;availabilityResults.setAttribute('role','alert');return}availabilityResults.replaceChildren();const heading=document.createElement('h3');heading.textContent=`${data.visit_date} · ${data.party_size} people · ${data.timezone}`;availabilityResults.append(heading);for(const slot of data.slots){const row=document.createElement('p');row.textContent=`${slot.start}–${slot.end}: ${slot.available?'Available':'Taken'}`;availabilityResults.append(row)}}; | |
| } | |
| } | |
| function wireAccounts(){ | |
| const register=document.querySelector('#registerForm');if(register)register.onsubmit=async event=>{event.preventDefault();if(!register.reportValidity())return;const payload=Object.fromEntries(new FormData(register));payload.accepted_terms=register.elements.accepted_terms.checked;try{await sessionApi('/api/auth/register',payload);showFormStatus(register,'Local account created. Open your private booking history.');}catch(error){showFormStatus(register,error.message,true)}}; | |
| const signIn=document.querySelector('#signInForm');if(signIn)signIn.onsubmit=async event=>{event.preventDefault();if(!signIn.reportValidity())return;try{await sessionApi('/api/auth/sign-in',Object.fromEntries(new FormData(signIn)));showFormStatus(signIn,'Signed in locally.');}catch(error){showFormStatus(signIn,error.message,true)}}; | |
| const recovery=document.querySelector('#recoveryForm');if(recovery)recovery.onsubmit=async event=>{event.preventDefault();if(!recovery.reportValidity())return;try{const data=await sessionApi('/api/auth/recovery',Object.fromEntries(new FormData(recovery)));showFormStatus(recovery,data.message||'Local recovery request validated. Nothing was sent.');}catch(error){showFormStatus(recovery,error.message,true)}}; | |
| const history=document.querySelector('#bookingHistory'),historyStatus=document.querySelector('#historyStatus'),seed=document.querySelector('#seedHistory');if(history){const load=async()=>{const response=await fetch('/api/account/bookings',{cache:'no-store'});const data=await response.json();history.replaceChildren();if(response.status===401){historyStatus.textContent=data.error;const link=document.createElement('a');link.href='/account/sign-in';link.textContent='Open sign-in';history.append(link);return}seed.hidden=false;if(!data.results.length){historyStatus.textContent='No bookings yet. Load seeded offline history to exercise management.';return}historyStatus.textContent=`${data.results.length} local booking record${data.results.length===1?'':'s'}.`;for(const item of data.results){const card=document.createElement('article');const h=document.createElement('h2');h.textContent=item.confirmation_code;const summary=document.createElement('p');summary.textContent=`${item.status} · ${item.visit_date} · ${item.time_slot} · ${item.location_id} · ${money(item.total_cents)}`;const actions=document.createElement('p');actions.textContent=`Details available · Edit: ${item.can_edit?'available':'unavailable'} · Cancel: ${item.can_cancel?'available':'unavailable'}`;card.append(h,summary,actions);history.append(card)}};seed.onclick=async()=>{try{await sessionApi('/api/account/seed-history',{});await load()}catch(error){historyStatus.textContent=error.message;historyStatus.setAttribute('role','alert')}};load().catch(error=>{historyStatus.textContent=error.message})} | |
| } | |
| function render(){ | |
| let p=location.pathname; | |
| const mobileHome=p==='/' && matchMedia('(max-width: 700px)').matches; | |
| if(p==='/louisville/prices'){history.replaceState({},'', '/louisville/team-building');p='/louisville/team-building'} | |
| const parts=p.split('/').filter(Boolean);let out=null; | |
| document.querySelector('#currentLocation').textContent=p==='/'?'Select Location':parts[0]==='baltimore'?'MD - Baltimore':'KY - Louisville'; | |
| if(p==='/')out=home(); | |
| else if(p==='/company/bookings/locations'||p==='/book')out=taskBooking(); | |
| else if(p==='/experiences')out=experiencesPage(); | |
| else if(p==='/experiences/pittsburgh')out=experienceDetailPage(); | |
| else if(p==='/account/sign-in')out=signInPage(); | |
| else if(p==='/account/register')out=registerPage(); | |
| else if(p==='/account/recovery')out=recoveryPage(); | |
| else if(p==='/account/bookings')out=historyPage(); | |
| else if(p==='/company/faq')out=faq(); | |
| else if(p==='/company/contact')out=info('Help & Contact Breakout Games',`<div class="help-grid"><section><h2>Experience records and actions</h2><p>Search availability, review local booking choices, or return to <a href="/experiences">available experiences</a>.</p></section><section><h2>Account access</h2><p>Use <a href="/account/sign-in">local sign in</a> or <a href="/account/recovery">password recovery</a>. No private account data appears on this public page.</p></section><section><h2>Failed actions</h2><p>Validation, inventory conflicts, and simulated payment failures preserve your local choices and never create a real effect.</p></section></div>${contactForm()}`); | |
| else if(p==='/company/privacy-policy')out=info('Cookie & Privacy Policy','<h2>Privacy Notice</h2><p>This local clone does not contact the source site. Local game plans and drafts remain in the site-bound database.</p><h2>Your Privacy Rights</h2><p>No credentials, payment data, source cookies, or sensitive values are collected.</p>'); | |
| else if(p==='/company/jobs')out=info('Join Our Team','<p>Choose a location to learn about game master and general manager opportunities.</p><div class="boundary" role="note"><strong>External application boundary</strong><p>Applications are not collected locally.</p></div>'); | |
| else if(p==='/company/celebrate')out=celebrate(); | |
| else if(p==='/company/gift-cards')out=gift(); | |
| else if(p==='/waiver')out=waiverPage(); | |
| else if(p==='/team-building')out=team(); | |
| else if(p==='/blog')out=blogIndex(); | |
| else if(parts[0]==='blog'&&catalog.blog_slugs.includes(parts[1]))out=parts[1]==='learning-opportunities'?`<article class="blog-detail"><img src="/assets/learning-opportunities-hero.jpg" alt="Learning opportunities"><h1>UNLOCKING YOUR STUDENT'S POTENTIAL: LEARNING OPPORTUNITIES IN ESCAPE ROOMS</h1><small>Posted on August 21, 2026<br>by Hannah Taylor</small><p>One of our favorite experiences to offer the communities we serve is a hands-on environment for practicing skills beyond the classroom.</p><h2>1. COLLABORATION & TEAM WORK</h2><p>Players share discoveries and combine ideas.</p></article>`:info(title(parts[1]),'<p class="evidence-label">Sitemap-discovered article; representative detail body not directly observed.</p>'); | |
| else if(parts.slice(0,2).join('/')==='company/design'&&parts[2]&&parts[2]!=='themes')out=themeDetail(parts[2]); | |
| else if(p==='/company/design/themes')out=themes(); | |
| else if(p==='/escape-rooms')out=editorialIndex(); | |
| else if(p==='/escape-rooms/strategy')out=info('10 Strategies for Winning in Escape Rooms','<ol class="strategy"><li>Pick the right team.</li><li>Communicate every discovery.</li><li>Search carefully.</li><li>Keep used clues organized.</li><li>Work on different puzzles.</li><li>Listen to every idea.</li><li>Ask for a hint when needed.</li><li>Do not overthink.</li><li>Watch the clock.</li><li>Have fun together.</li></ol>'); | |
| else if(parts[0]==='escape-rooms')out=info(title(parts.slice(1).join('-')),'<p class="evidence-label">Sitemap-discovered editorial route; representative detail body not directly observed.</p>'); | |
| else if(catalog.locations.includes(parts[0]))out=parts.length===1?market(parts[0]):marketFamily(parts[0],parts.slice(1).join('/')); | |
| else if(catalog.routes.includes(p))out=info(title(parts.join('-')),'<p class="evidence-label">This route is sitemap-discovered and structurally available, but its body has not yet been directly compared.</p>'); | |
| else out='<section class="notfound"><h1>404 (You’ve Journeyed Too Far)</h1><p>Sorry, the page you are looking for could not be found.</p><p><a href="/experiences">Return to experience records and actions</a> · <a href="/">Return home</a></p></section>'; | |
| document.querySelector('#app').innerHTML=out+(mobileHome?'<div class="social-proof"><b>ⓑ</b><span>David from Indiana just booked a<br>Breakout experience<br><small>about 48 minutes ago</small></span></div>':'');wireForms() | |
| } | |
| function wireForms(){ | |
| const video=document.querySelector('.hero-video'); | |
| if(video){const target=matchMedia('(max-width: 700px)').matches?1:1.5;const seek=()=>{video.pause();video.currentTime=target};video.readyState?seek():video.addEventListener('loadedmetadata',seek,{once:true});video.addEventListener('seeked',()=>video.pause())} | |
| document.querySelector('.offer button')?.addEventListener('click',()=>document.querySelector('.offer-overlay').remove()); | |
| wireSafeDrafts(); | |
| wireTaskBooking(); | |
| wireExperiences(); | |
| wireAccounts(); | |
| } | |
| document.querySelector('#currentLocation').textContent='KY - Louisville';document.querySelector('#menuBtn').onclick=()=>{const n=document.querySelector('#menu'),open=n.hidden;n.hidden=!open;document.querySelector('#menuBtn').setAttribute('aria-expanded',open)};document.querySelector('#locationBtn').onclick=()=>document.querySelector('#locations').showModal();document.querySelector('#locations .close').onclick=()=>document.querySelector('#locations').close();fetch('/catalog.json').then(r=>r.json()).then(x=>{catalog=x;render()}).catch(()=>render()); | |