(function(){
const { Icon, IconButton, ProductCard, CategoryCard, EmptyState, ProductCardSkeleton } = window.LemonaSportswearDesignSystem_c8f307;
function SectionHead({ title, sub, link, href = "#", onPrev, onNext }) {
return (
{title} {sub ?
{sub}
: null}
{link ?
{link} : null}
{onPrev ? (
) : null}
);
}
/* Hero: slides come from the banners table (active only, in display order).
No image paths are hard-coded here. */
function HeroBanner({ slides = [], loading, interval = 5500 }) {
const [i, setI] = React.useState(0);
const [paused, setPaused] = React.useState(false);
const n = slides.length;
React.useEffect(() => { if (i >= n) setI(0); }, [n, i]);
const go = (d) => setI((v) => (v + d + n) % n);
React.useEffect(() => {
if (paused || n < 2 || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return undefined;
const t = setInterval(() => setI((v) => (v + 1) % n), interval);
return () => clearInterval(t);
}, [paused, n, interval]);
if (loading) return ;
if (!n) {
return (
Engineered to move
Performance sportswear built for every move.
);
}
return (
setPaused(true)} onMouseLeave={() => setPaused(false)}>
{slides.map((s, idx) => {
const inner = s.src ? (
{s.mobileSrc ? : null}
{ e.currentTarget.closest(".hero__slide").classList.add("hero__slide--broken"); }}
{...(idx === 0 ? { fetchpriority: "high" } : {})} />
) :
;
return (
);
})}
{n > 1 ? (
go(-1)}>
go(1)}>
{slides.map((s, idx) => (
setI(idx)} />
))}
) : null}
);
}
/* One rail component, three homepage uses (best sellers, featured, new arrivals). */
function ProductRail({ title, sub, products = [], loading, onAddToCart, href = "#", tight }) {
const rail = React.useRef(null);
const scroll = (d) => rail.current && rail.current.scrollBy({ left: d * rail.current.clientWidth * 0.6, behavior: "smooth" });
if (!loading && !products.length) return null;
return (
scroll(-1)} onNext={() => scroll(1)} />
{loading
? [0, 1, 2, 3].map((k) =>
)
: products.map((p) =>
onAddToCart(p)} onWishlist={() => {}} />)}
);
}
function ShopByCategory({ categories = [], loading }) {
if (!loading && !categories.length) return null;
return (
{categories.map((c) => )}
);
}
function Gallery({ items = window.GALLERY }) {
if (!items.length) return null;
return (
{items.map((g) => (
{g.url
?
: }
{g.caption}
))}
);
}
const BENEFITS = [
{ icon: "truck", title: "Free shipping", copy: "Free delivery on every prepaid order above ₹999, dispatched within 24 hours." },
{ icon: "rotate-ccw", title: "Easy 7-day return", copy: "Changed your mind or the fit is off? Return within 7 days, no questions asked." },
];
function Benefits() {
return (
{BENEFITS.map((b) => (
))}
);
}
function StoreNotice() {
const [show, setShow] = React.useState(false);
React.useEffect(() => { window.LemonaStore.ready().then((m) => setShow(m === "preview")); }, []);
if (!show) return null;
return Preview mode — content is served from local demo data. On Hostinger with api/config.php in place, the same screens read MySQL.
;
}
Object.assign(window, { SectionHead, HeroBanner, ProductRail, ShopByCategory, Gallery, Benefits, StoreNotice });
})();