/*
* RealHome shared React components (React 18 UMD + Ant Design 5 UMD, compiled in-browser by Babel Standalone).
* Everything is exported on window.RHC so page scripts can use it without a bundler.
*/
(() => {
const { useState, useEffect, useRef, useCallback, useMemo } = React;
const {
ConfigProvider, App: AntApp, theme, Button, Input, Select, Tag, Avatar, Badge, Empty, Skeleton, Spin,
message, Modal, Dropdown, Tooltip, Drawer, DatePicker, Upload, Result, Popconfirm,
} = antd;
const RH = window.RH;
// ------------------------------------------------------------------ Theme
const S = RH.settings || {};
const brandToken = {
colorPrimary: S.primary_color || '#059669',
colorLink: S.primary_color || '#047857',
borderRadius: 12,
fontFamily: '"Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif',
};
const Icon = ({ name, className = '', style }) => ;
// ------------------------------------------------------------------ Hooks
function useDebounced(value, ms = 350) {
const [v, setV] = useState(value);
useEffect(() => { const t = setTimeout(() => setV(value), ms); return () => clearTimeout(t); }, [value, ms]);
return v;
}
function useSocketState() {
const [s, setS] = useState(RH.socketState);
useEffect(() => RH.onSocketState(setS), []);
return s;
}
/** Infinite AJAX list against a paginated Laravel endpoint. */
function usePaged(url, params, deps) {
const [items, setItems] = useState([]);
const [page, setPage] = useState(1);
const [last, setLast] = useState(1);
const [total, setTotal] = useState(0);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
const reqId = useRef(0);
const load = useCallback((p) => {
const id = ++reqId.current;
setLoading(true);
setError(null);
return RH.api.get(url, { params: { ...params, page: p } })
.then(({ data }) => {
if (id !== reqId.current) return;
setItems((prev) => (p === 1 ? data.data : prev.concat(data.data)));
setPage(data.meta?.current_page || p);
setLast(data.meta?.last_page || 1);
setTotal(data.meta?.total ?? data.data.length);
})
.catch((e) => id === reqId.current && setError(RH.errMsg(e)))
.finally(() => id === reqId.current && setLoading(false));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [url, JSON.stringify(params)]);
useEffect(() => { load(1); }, deps || [load]);
const reload = useCallback(() => load(1), [load]);
return {
items, setItems, total, loading, error,
hasMore: page < last,
loadMore: () => !loading && page < last && load(page + 1),
reload,
};
}
/** Calls loadMore when the sentinel scrolls into view (infinite AJAX loading). */
function InfiniteSentinel({ onVisible, disabled }) {
const ref = useRef(null);
useEffect(() => {
if (disabled || !ref.current || !('IntersectionObserver' in window)) return;
const io = new IntersectionObserver((es) => es[0].isIntersecting && onVisible(), { rootMargin: '400px' });
io.observe(ref.current);
return () => io.disconnect();
}, [onVisible, disabled]);
return
;
}
// ------------------------------------------------------------------ Brand bits
/** Brand mark: admin-uploaded logo (Settings -> Branding) or the default icon, plus brand name & tagline */
const BrandMark = ({ size = 40 }) => (S.logo_url
?
:
);
const Logo = ({ dark }) => (
{S.brand_name || 'RealHome'}
{S.brand_tagline || 'Verified Properties'}
);
const StatusTag = ({ status }) => {
const map = {
active: ['green', 'Live'], pending: ['gold', 'Pending review'], sold: ['blue', 'Sold'], rejected: ['red', 'Rejected'],
open: ['green', 'Open'], scheduled: ['purple', 'Visit scheduled'], closed: ['default', 'Closed'],
};
const [c, l] = map[status] || ['default', status];
return {l};
};
const LiveDot = () => {
const s = useSocketState();
const map = {
live: ['bg-emerald-500', 'Live socket'], connecting: ['bg-amber-400', 'Connecting…'],
offline: ['bg-rose-500', 'Offline — retrying'], polling: ['bg-sky-400', 'Auto-sync'],
};
const [c, l] = map[s] || map.polling;
return (
{l}
);
};
// ------------------------------------------------------------------ Favorites
function FavButton({ property, className = '', onChange }) {
const [fav, setFav] = useState(!!property.is_favorite);
const [busy, setBusy] = useState(false);
useEffect(() => setFav(!!property.is_favorite), [property.id, property.is_favorite]);
const toggle = (e) => {
e.preventDefault(); e.stopPropagation();
if (!RH.requireLogin()) return;
setBusy(true);
setFav(!fav); // optimistic
RH.api.post(`/properties/${property.id}/favorite`)
.then(({ data }) => { setFav(data.is_favorite); onChange && onChange(data.is_favorite); message.success(data.is_favorite ? 'Saved to shortlist' : 'Removed from shortlist'); })
.catch((err) => { setFav(fav); message.error(RH.errMsg(err)); })
.finally(() => setBusy(false));
};
return (
);
}
// ------------------------------------------------------------------ Property card
function PropertyCard({ p, onFavChange }) {
return (
{p.cover_image
?

:
}
{p.type === 'rent' ? 'For Rent' : 'For Sale'}
{p.rera_id && RERA}
{p.is_featured &&
Featured}
{p.price_label}
{RH.bhk(p)}
{p.title}
{p.locality ? `${p.locality}, ` : ''}{p.location_city}
{p.sqft > 0 && {p.sqft.toLocaleString('en-IN')} sq.ft}
{p.bathrooms > 0 && {p.bathrooms} Bath}
{p.price_per_sqft && {RH.fmtINR(p.price_per_sqft)}/sq.ft}
);
}
const CardSkeleton = () => (
);
// ------------------------------------------------------------------ Public header / footer
function SiteHeader({ active }) {
const user = RH.user;
const [drawer, setDrawer] = useState(false);
const [city, setCity] = useState(RH.store.get('city', S.default_city || 'Raipur'));
const changeCity = (c) => {
setCity(c); RH.store.set('city', c);
window.dispatchEvent(new CustomEvent('rh:city', { detail: c }));
if (active !== 'listings' && active !== 'home') window.location.href = `/properties?city=${encodeURIComponent(c)}`;
};
const logout = () => RH.api.post('/auth/logout').finally(() => { window.location.href = '/'; });
const userMenu = {
items: [
{ key: 'account', label: My Account, icon: },
{ key: 'inq', label: My Inquiries & Chat, icon: },
{ key: 'wish', label: Shortlist, icon: },
...(user && user.role === 'admin' ? [{ type: 'divider' }, { key: 'admin', label: Admin Control Suite, icon: }] : []),
{ type: 'divider' },
{ key: 'out', label: 'Sign out', danger: true, icon: , onClick: logout },
],
};
const nav = [
['home', '/', 'Home', 'home-5-line'],
['listings', '/properties', 'Explore Properties', 'compass-3-line'],
['inquiries', '/inquiries', 'My Inquiries & Chat', 'chat-3-line'],
];
return (
<>
setDrawer(false)} placement="right" width={300} title={}>
{user ? (
) :
}
{/* Mobile bottom bar */}
>
);
}
const SiteFooter = () => (
);
// ------------------------------------------------------------------ v1.2 auth helpers
const GoogleG = ({ size = 18 }) => (
);
/** "Continue with Google" — shown only when Admin → Auth & Social Login has it enabled. */
function GoogleButton({ label = 'Continue with Google', redirect }) {
const a = (RH.platform && RH.platform.auth) || {};
if (!a.google_enabled) return null;
const r = redirect || new URLSearchParams(location.search).get('redirect') || '';
const href = '/auth/google/redirect' + (r && r.startsWith('/') ? '?redirect=' + encodeURIComponent(r) : '');
return (
{label}
);
}
/** Yellow strip for signed-in users whose email isn't verified yet. */
function VerifyBanner() {
const u = RH.user;
const a = (RH.platform && RH.platform.auth) || {};
if (u && u.email_verified && /[?&]verified=1/.test(location.search)) {
return Your email is verified. Welcome aboard!
;
}
if (!u || u.email_verified || location.pathname === '/verify-email') return null;
return (
Please verify {u.email}{a.email_verification_required ? ' to post listings and chat with sellers.' : ' to secure your account.'}
Verify now →
);
}
/** Read-only value with a copy button (admin guides). */
function CopyField({ label, value, mono = true, dark = true }) {
const [ok, setOk] = useState(false);
const copy = () => {
const done = () => { setOk(true); setTimeout(() => setOk(false), 1500); };
if (navigator.clipboard && window.isSecureContext) navigator.clipboard.writeText(value).then(done).catch(() => fallback());
else fallback();
function fallback() { const t = document.createElement('textarea'); t.value = value; document.body.appendChild(t); t.select(); try { document.execCommand('copy'); done(); } catch (e) {} t.remove(); }
};
return (
{label &&
{label}
}
{value}
);
}
function PublicShell({ active, children, hideFooter }) {
return (
{children}
{!hideFooter && }
);
}
// ------------------------------------------------------------------ Admin shell (dark)
function AdminShell({ active, title, crumb, actions, children }) {
const user = RH.user;
const [collapsed, setCollapsed] = useState(RH.store.get('admin_collapsed', false));
const [mobileOpen, setMobileOpen] = useState(false);
const [counts, setCounts] = useState({ pending: null, open: null });
useEffect(() => {
const refresh = () => RH.api.get('/admin/stats').then(({ data }) => setCounts({ pending: data.kpis.pending_listings, open: data.kpis.open_inquiries })).catch(() => {});
refresh();
const offA = RH.listen('admin.dashboard', 'PropertyStatusChanged', refresh);
const offB = RH.listen('admin.dashboard', 'InquiryCreated', refresh);
const t = setInterval(refresh, 60000);
return () => { offA(); offB(); clearInterval(t); };
}, []);
const items = [
['dashboard', '/admin', 'Dashboard', 'dashboard-3-line', null],
['properties', '/admin/properties', 'Properties & Moderation', 'building-line', counts.pending],
['inquiries', '/admin/inquiries', 'Buyer Inquiries & Chat', 'chat-3-line', counts.open],
['users', '/admin/users', 'Users & Agents', 'team-line', null],
['locations', '/admin/locations', 'Location Management', 'map-pin-2-line', null],
['settings', '/admin/settings', 'Settings', 'settings-3-line', null],
['auth', '/admin/auth-settings', 'Auth & Social Login', 'shield-user-line', null],
['email', '/admin/email-settings', 'Email & Notifications', 'mail-settings-line', null],
['templates', '/admin/email-templates', 'Email Templates', 'mail-open-line', null],
];
const Side = ({ compact }) => (
{user.initials}
{!compact &&
}
);
return (
setMobileOpen(false)} placement="left" width={280} styles={{ body: { padding: 0, background: '#18181b' } }} closable={false}>
Admin {crumb || title}
{title}
{actions}
{children}
);
}
// ------------------------------------------------------------------ Inquiry list (inbox)
function InquiryList({ activeId, onSelect, dark, statusFilter }) {
const me = RH.user;
const [q, setQ] = useState('');
const dq = useDebounced(q);
const { items, loading, reload, hasMore, loadMore } = usePaged('/inquiries', { q: dq || undefined, status: statusFilter || undefined, per_page: 30 });
useEffect(() => {
let t;
const soft = () => { clearTimeout(t); t = setTimeout(reload, 400); };
const offs = [RH.listen(`user.${me.id}`, 'NewChatMessage', soft), RH.listen(`user.${me.id}`, 'InquiryCreated', soft)];
if (me.role === 'admin') offs.push(RH.listen('admin.dashboard', 'InquiryCreated', soft));
const poll = setInterval(reload, Math.max(RH.pollMs() * 3, 12000));
return () => { offs.forEach((f) => f()); clearInterval(poll); clearTimeout(t); };
}, [reload]);
// Clear unread badge locally when a thread is opened
const select = (inq) => { onSelect(inq); };
const base = dark ? 'text-zinc-100' : 'text-slate-900';
return (
} placeholder="Search property or buyer…" value={q} onChange={(e) => setQ(e.target.value)} />
{loading && !items.length &&
}
{!loading && !items.length &&
}
{items.map((inq) => {
const other = inq.is_buyer ? inq.agent : inq.buyer;
const isActive = String(inq.id) === String(activeId);
return (
);
})}
{hasMore &&
}
);
}
// ------------------------------------------------------------------ Real-time chat panel
function ChatPanel({ inquiryId, dark, onBack, onInquiryChange }) {
const me = RH.user;
const [inquiry, setInquiry] = useState(null);
const [msgs, setMsgs] = useState([]); // newest first (rendered with column-reverse)
const [cursor, setCursor] = useState(null);
const [loading, setLoading] = useState(true);
const [loadingOlder, setLoadingOlder] = useState(false);
const [text, setText] = useState('');
const [scheduleOpen, setScheduleOpen] = useState(false);
const [when, setWhen] = useState(null);
const lastIdRef = useRef(0);
const readTimer = useRef(null);
const markReadSoon = useCallback(() => {
clearTimeout(readTimer.current);
readTimer.current = setTimeout(() => RH.api.post(`/inquiries/${inquiryId}/read`).catch(() => {}), 600);
}, [inquiryId]);
// Merge one server message: dedupe by id and swap optimistic temp by client_id
const ingest = useCallback((m) => {
if (!m || String(m.inquiry_id) !== String(inquiryId)) return;
if (m.id > lastIdRef.current) lastIdRef.current = m.id;
setMsgs((prev) => {
if (prev.some((x) => x.id === m.id)) return prev;
const i = m.client_id ? prev.findIndex((x) => x.client_id === m.client_id) : -1;
if (i >= 0) { const copy = prev.slice(); copy[i] = { ...m, isPending: false, failed: false }; return copy; }
return [m, ...prev];
});
if (m.sender_id !== me.id) markReadSoon();
}, [inquiryId, me.id, markReadSoon]);
// Initial load
useEffect(() => {
if (!inquiryId) return;
let alive = true;
setLoading(true); setMsgs([]); setCursor(null); lastIdRef.current = 0;
Promise.all([RH.api.get(`/inquiries/${inquiryId}`), RH.api.get(`/inquiries/${inquiryId}/messages`, { params: { per_page: 30 } })])
.then(([a, b]) => {
if (!alive) return;
setInquiry(a.data.inquiry);
setMsgs(b.data.data);
setCursor(b.data.next_cursor);
lastIdRef.current = b.data.data.reduce((mx, m) => Math.max(mx, m.id), 0);
markReadSoon();
})
.catch((e) => alive && message.error(RH.errMsg(e)))
.finally(() => alive && setLoading(false));
return () => { alive = false; };
}, [inquiryId]);
// Live WebSocket ingestion + polling fallback / gap recovery
useEffect(() => {
if (!inquiryId) return;
const off = RH.listen(`inquiry.${inquiryId}`, 'NewChatMessage', (e) => ingest(e.message));
let busy = false;
const poll = setInterval(() => {
if (busy || document.hidden) return;
busy = true;
RH.api.get(`/inquiries/${inquiryId}/messages`, { params: { after_id: lastIdRef.current } })
.then(({ data }) => data.data.forEach(ingest))
.catch(() => {})
.finally(() => { busy = false; });
}, RH.pollMs());
return () => { off(); clearInterval(poll); };
}, [inquiryId, ingest]);
const loadOlder = () => {
if (!cursor || loadingOlder) return;
setLoadingOlder(true);
RH.api.get(`/inquiries/${inquiryId}/messages`, { params: { cursor, per_page: 30 } })
.then(({ data }) => { setMsgs((p) => p.concat(data.data.filter((m) => !p.some((x) => x.id === m.id)))); setCursor(data.next_cursor); })
.finally(() => setLoadingOlder(false));
};
const deliver = (tmp, file) => {
let body = { message: tmp.message, client_id: tmp.client_id };
if (file) { body = new FormData(); if (tmp.message) body.append('message', tmp.message); body.append('client_id', tmp.client_id); body.append('attachment', file); }
RH.api.post(`/inquiries/${inquiryId}/messages`, body)
.then(({ data }) => ingest(data.message))
.catch((e) => {
setMsgs((p) => p.map((x) => (x.client_id === tmp.client_id ? { ...x, isPending: false, failed: true, file } : x)));
message.error(RH.errMsg(e, 'Message not sent'));
});
};
const send = (file) => {
const body = text.trim();
if (!body && !file) return;
const cid = RH.uid();
const tmp = { id: cid, client_id: cid, inquiry_id: Number(inquiryId), sender_id: me.id, sender: { id: me.id, name: me.name }, message: body || (file ? `📎 ${file.name}` : ''), attachment_url: null, created_at: new Date().toISOString(), isPending: true };
setMsgs((p) => [tmp, ...p]); // optimistic append
setText('');
deliver(tmp, file);
};
const retry = (m) => {
setMsgs((p) => p.map((x) => (x.client_id === m.client_id ? { ...x, isPending: true, failed: false } : x)));
deliver(m, m.file);
};
const updateInquiry = (payload) => RH.api.patch(`/inquiries/${inquiryId}`, payload)
.then(({ data }) => { setInquiry(data.inquiry); onInquiryChange && onInquiryChange(data.inquiry); message.success('Updated'); })
.catch((e) => message.error(RH.errMsg(e)));
if (!inquiryId) {
return
;
}
if (loading && !inquiry) return
;
const other = inquiry ? (inquiry.is_buyer ? inquiry.agent : inquiry.buyer) : null;
const canManage = inquiry && (!inquiry.is_buyer || me.role === 'admin');
const bubbleMine = 'bg-brand-600 text-white rounded-2xl rounded-br-md';
const bubbleOther = dark ? 'bg-zinc-800 text-zinc-100 rounded-2xl rounded-bl-md' : 'bg-white text-slate-800 border border-slate-200 rounded-2xl rounded-bl-md';
return (
{/* Header */}
{onBack &&
}
{other?.initials}
{inquiry &&
}
{canManage && (
, onClick: () => setScheduleOpen(true) },
inquiry.status !== 'closed' ? { key: 'c', label: 'Mark as closed', icon:
, onClick: () => updateInquiry({ status: 'closed' }) }
: { key: 'o', label: 'Re-open', icon:
, onClick: () => updateInquiry({ status: 'open' }) },
...(inquiry.buyer_phone ? [{ key: 'p', label:
Call {inquiry.buyer_phone}, icon:
}] : []),
] }}>
} />
)}
{/* Messages (column-reverse keeps the view pinned to the newest message) */}
{msgs.map((m) => {
const mine = m.sender_id === me.id;
return (
{!mine && me.role === 'admin' &&
{m.sender?.name}
}
{m.message &&
{m.message}
}
{m.attachment_url && (/\.(png|jpe?g|webp)$/i.test(m.attachment_url)
?

:
Attachment)}
{RH.time(m.created_at)}
{mine && (m.isPending ? : m.failed ? null : )}
{m.failed &&
}
);
})}
{cursor &&
}
{!msgs.length && !loading &&
}
{/* Composer */}
{ send(f); return false; }}>
} />
setText(e.target.value)} autoSize={{ minRows: 1, maxRows: 4 }} placeholder="Type a message…"
onPressEnter={(e) => { if (!e.shiftKey) { e.preventDefault(); send(); } }} maxLength={4000} />
} onClick={() => send()} disabled={!text.trim()}>Send
setScheduleOpen(false)} okText="Schedule"
onOk={() => { if (!when) return message.warning('Pick a date & time'); updateInquiry({ scheduled_at: when.toISOString(), status: 'scheduled' }).then(() => setScheduleOpen(false)); }}>
d && d < dayjs().startOf('day')} />
);
}
// ------------------------------------------------------------------ Platform helpers (admin-managed)
const P = RH.boot.platform || { attributes: [], gallery_categories: [], icons: [], city_list: [] };
const ICONS = Object.fromEntries((P.icons || []).map((i) => [i.key, i]));
const riOf = (key) => (ICONS[key] ? ICONS[key].ri : 'information-line');
/** Resolves a property's value for a spec field (system columns + custom extra_specs). */
function specValue(p, a) {
const col = a.column;
let v;
if (a.key === 'bhk') v = p.property_type === 'plot' || p.property_type === 'commercial' ? null : (p.bedrooms ? `${p.bedrooms >= 5 ? '5+' : p.bedrooms} BHK` : null);
else if (a.key === 'area') v = p.sqft ? `${Number(p.sqft).toLocaleString('en-IN')} ${a.unit || 'sq.ft'}` : null;
else if (a.key === 'type') v = p.property_type ? RH.cap(String(p.property_type).replace(/-/g, ' ')) : null;
else if (col) v = p[col] || null;
else v = p.extra_specs ? p.extra_specs[a.key] : null;
if (v && !col && a.unit && a.input_type === 'number') v = `${v} ${a.unit}`;
return v === 0 || v ? String(v) : null;
}
/** Visual spec cards with the admin-chosen icons (Settings -> Spec fields & icons). */
function SpecGrid({ p, dark }) {
const attrs = (P.attributes || []).filter((a) => a.is_active !== false);
const items = attrs.map((a) => ({ a, v: specValue(p, a) })).filter((x) => x.v);
if (!items.length) return null;
return (
{items.map(({ a, v }) => (
{a.label}
{v}
))}
);
}
/** Small spec chips for cards (fields with "show on card") */
function CardSpecs({ p }) {
const items = (P.attributes || []).filter((a) => a.show_on_card && a.key !== 'bhk').map((a) => ({ a, v: specValue(p, a) })).filter((x) => x.v).slice(0, 3);
return items.map(({ a, v }) => {v});
}
/** Admin icon picker (curated set shared with the Android app). */
function IconPicker({ value, onChange, dark }) {
const [open, setOpen] = useState(false);
const [q, setQ] = useState('');
const list = (P.icons || []).filter((i) => !q || i.label.toLowerCase().includes(q.toLowerCase()) || i.key.includes(q.toLowerCase()));
return (
<>
setOpen(false)} footer={null} width={560}>
setQ(e.target.value)} className="mb-3" />
{list.map((i) => (
))}
>
);
}
/**
* OYO-style categorised photo lightbox:
* category tabs with counts · big image with prev/next · zoom in/out · category label · thumbnail strip · keyboard & swipe.
*/
function GalleryLightbox({ open, onClose, gallery, startIndex = 0, title }) {
const cats = useMemo(() => {
const m = new Map();
gallery.forEach((g) => m.set(g.category, (m.get(g.category) || 0) + 1));
const order = (P.gallery_categories || []).map((c) => c.name);
return [...m.entries()].sort((a, b) => ((order.indexOf(a[0]) + 1 || 99) - (order.indexOf(b[0]) + 1 || 99)));
}, [gallery]);
const [idx, setIdx] = useState(startIndex);
const [zoom, setZoom] = useState(1);
const [pan, setPan] = useState({ x: 0, y: 0 });
const drag = useRef(null);
const touch = useRef(null);
const stripRef = useRef(null);
useEffect(() => { if (open) { setIdx(startIndex); setZoom(1); setPan({ x: 0, y: 0 }); } }, [open, startIndex]);
useEffect(() => { setZoom(1); setPan({ x: 0, y: 0 }); const el = stripRef.current?.children[idx]; el && el.scrollIntoView({ behavior: 'smooth', inline: 'center', block: 'nearest' }); }, [idx]);
const go = useCallback((d) => setIdx((i) => (i + d + gallery.length) % gallery.length), [gallery.length]);
useEffect(() => {
if (!open) return;
const onKey = (e) => {
if (e.key === 'Escape') onClose();
if (e.key === 'ArrowRight') go(1);
if (e.key === 'ArrowLeft') go(-1);
if (e.key === '+' || e.key === '=') setZoom((z) => Math.min(4, z + 0.5));
if (e.key === '-') setZoom((z) => Math.max(1, z - 0.5));
};
window.addEventListener('keydown', onKey);
document.body.style.overflow = 'hidden';
return () => { window.removeEventListener('keydown', onKey); document.body.style.overflow = ''; };
}, [open, go, onClose]);
if (!open || !gallery.length) return null;
const cur = gallery[idx];
const jumpTo = (cat) => { const i = gallery.findIndex((g) => g.category === cat); if (i >= 0) setIdx(i); };
const setZ = (z) => { const nz = Math.max(1, Math.min(4, z)); setZoom(nz); if (nz === 1) setPan({ x: 0, y: 0 }); };
return ReactDOM.createPortal(
{/* Category tabs */}
{cats.map(([c, n]) => (
))}
{/* Stage */}
setZ(zoom + (e.deltaY < 0 ? 0.25 : -0.25))}
onMouseDown={(e) => { if (zoom > 1) drag.current = { x: e.clientX - pan.x, y: e.clientY - pan.y }; }}
onMouseMove={(e) => { if (drag.current) setPan({ x: e.clientX - drag.current.x, y: e.clientY - drag.current.y }); }}
onMouseUp={() => { drag.current = null; }} onMouseLeave={() => { drag.current = null; }}
onTouchStart={(e) => { touch.current = { x: e.touches[0].clientX, t: Date.now() }; }}
onTouchEnd={(e) => { const t = touch.current; if (!t || zoom > 1) return; const dx = e.changedTouches[0].clientX - t.x; if (Math.abs(dx) > 50) go(dx < 0 ? 1 : -1); }}
onDoubleClick={() => setZ(zoom > 1 ? 1 : 2.5)}>
{cur.category}
{idx + 1} / {gallery.length}

1 ? 'grab' : 'zoom-in', maxHeight: '100%', maxWidth: '100%' }}
className="object-contain rounded-lg shadow-2xl" />
{Math.round(zoom * 100)}%
{title &&
{title}
}
{/* Thumbnails */}
{gallery.map((g, i) => (
))}
,
document.body
);
}
/** Seller "Apply" gradient call-to-action card (register + account pages). */
const SellerCta = ({ compact }) => (
{S.seller_cta_title || 'Apply as Seller'}
{!compact &&
{S.seller_cta_text}
}
{['Owner', 'Agent', 'Builder'].map((t) => {t})}
);
// ------------------------------------------------------------------ Misc
const SectionTitle = ({ title, sub, action }) => (
);
const KpiCard = ({ label, value, icon, tone = 'emerald', hint, onClick }) => {
const tones = { emerald: 'text-emerald-400', amber: 'text-amber-400', sky: 'text-sky-400', rose: 'text-rose-400', violet: 'text-violet-400' };
return (
{label}
{value}
{hint &&
{hint}
}
);
};
window.RHC = {
Icon, Logo, StatusTag, LiveDot, FavButton, PropertyCard, CardSkeleton, SiteHeader, SiteFooter, PublicShell, AdminShell,
InquiryList, ChatPanel, SectionTitle, KpiCard, InfiniteSentinel,
BrandMark, SpecGrid, CardSpecs, IconPicker, GalleryLightbox, SellerCta, specValue, riOf,
GoogleButton, GoogleG, VerifyBanner, CopyField,
useDebounced, usePaged, useSocketState, brandToken,
};
})();