const { Button, Select, Input, Icon } = window.FriendsCarsDesignSystem_f69f0e;
const HERO_SLIDES = ["gle", "thar", "e250", "520d", "crysta", "creta-new", "sonet", "fronx"].map((id) => window.FLEET.find((c) => c.id === id)).filter(Boolean);
const SLIDE_MS = 6400;
const splitName = (c) => {
const model = c.name.replace(c.marque, "").replace(/[()]/g, "").trim();
return [c.marque, model || c.name];
};
function HeroStage({ onNavigate, onBook }) {
const [i, setI] = React.useState(0);
const [hold, setHold] = React.useState(false);
const [stageRef, o] = window.usePointerParallax(1);
React.useEffect(() => {
if (hold) return;
const t = setTimeout(() => setI((n) => (n + 1) % HERO_SLIDES.length), SLIDE_MS);
return () => clearTimeout(t);
}, [i, hold]);
/* Scroll parallax + cinematic fade-off. rAF-throttled, skipped for reduced motion. */
React.useEffect(() => {
const el = stageRef.current;
if (!el || window.matchMedia("(prefers-reduced-motion:reduce)").matches) return;
let raf = 0, last = -1;
const paint = () => {
raf = 0;
const y = Math.min(window.scrollY, 900);
if (y === last) return;
last = y;
el.style.setProperty("--sy", (y * 0.16).toFixed(1) + "px");
el.style.setProperty("--fade", Math.max(0, 1 - y / 720).toFixed(3));
};
const on = () => { if (!raf) raf = requestAnimationFrame(paint); };
window.addEventListener("scroll", on, { passive: true });
paint();
return () => { window.removeEventListener("scroll", on); if (raf) cancelAnimationFrame(raf); };
}, [stageRef]);
const car = HERO_SLIDES[i];
const [marque, model] = splitName(car);
const go = (n) => setI((n + HERO_SLIDES.length) % HERO_SLIDES.length);
const queue = HERO_SLIDES.slice(i + 1).concat(HERO_SLIDES.slice(0, i));
return (
Seventy cars, delivered to your door in {window.BIZ.city} and taken back from it.
{"Self-drive car rental in " + window.BIZ.city + " · Since " + window.BIZ.since}