const DATA = [ { "name": "صالحه محمد بن مزراق مجرشي", "url": "https://stat2025-map.static.hf.space/es/01.html" }, { "name": "حسن عبدالله ابوكبوس", "url": "https://stat2025-map.static.hf.space/es/02.html" }, { "name": "علي حسين معتوق ال حاتم", "url": "https://stat2025-map.static.hf.space/es/03.html" }, { "name": "فاطمة نعمة سلمان الهاشم", "url": "https://stat2025-map.static.hf.space/es/04.html" }, { "name": "خلود سعود بن خليوي الخالدي", "url": "https://stat2025-map.static.hf.space/es/05.html" }, { "name": "أحمد عبدالهادي عبدالواحد الحيدر", "url": "https://stat2025-map.static.hf.space/es/06.html" }, { "name": "عبدالله سالم الهاجري", "url": "https://stat2025-map.static.hf.space/es/07.html" }, { "name": "اشواق عبدالكريم الحنطي", "url": "https://stat2025-map.static.hf.space/es/08.html" }, { "name": "الهنوف صالح محمد المبارك", "url": "https://stat2025-map.static.hf.space/es/09.html" }, { "name": "اميرةعبدالله احمد الرشيد", "url": "https://stat2025-map.static.hf.space/es/10.html" }, { "name": "دانه احمد الدريب", "url": "https://stat2025-map.static.hf.space/es/11.html" }, { "name": "نور عيد على الثاني", "url": "https://stat2025-map.static.hf.space/es/12.html" }, { "name": "علي حبيب بن عبدالله الحبيب", "url": "https://stat2025-map.static.hf.space/es/13.html" }, { "name": "سارة صالح القحطاني", "url": "https://stat2025-map.static.hf.space/es/14.html" }, { "name": "أبرار ناصر ابن ثامر المطيري", "url": "https://stat2025-map.static.hf.space/es/15.html" }, { "name": "هيله خالد بن عبدالله العليط", "url": "https://stat2025-map.static.hf.space/es/16.html" }, { "name": "محمد عبدالعزيز بن احمد العرفه", "url": "https://stat2025-map.static.hf.space/es/17.html" }, { "name": "فهد فرحان شفاقه الحبلاني", "url": "https://stat2025-map.static.hf.space/es/18.html" } ]; function normalizeArabic(s) { if (!s) return ""; return String(s) .trim() .toLowerCase() .replace(/[\u064B-\u065F\u0670\u06D6-\u06ED]/g, "") .replace(/\u0640/g, "") .replace(/[إأآٱ]/g, "ا") .replace(/ى/g, "ي") .replace(/ة/g, "ه") .replace(/^ال\s+/g, "") .replace(/\s+/g, " "); } function escapeHtml(str) { return String(str) .replaceAll("&", "&") .replaceAll("<", "<") .replaceAll(">", ">") .replaceAll('"', """) .replaceAll("'", "'"); } function highlightMatch(name, rawQuery) { if (!rawQuery) return escapeHtml(name); const tokens = rawQuery.trim().split(/\s+/).filter(Boolean); if (!tokens.length) return escapeHtml(name); const t = tokens[0]; const idx = name.indexOf(t); if (idx === -1) return escapeHtml(name); const before = escapeHtml(name.slice(0, idx)); const mid = escapeHtml(name.slice(idx, idx + t.length)); const after = escapeHtml(name.slice(idx + t.length)); return `${before}${mid}${after}`; } const elQ = document.getElementById("q"); const elResults = document.getElementById("results"); const elCount = document.getElementById("countPill"); const elTotal = document.getElementById("totalChip"); const toast = document.getElementById("toast"); const toastText = document.getElementById("toastText"); elTotal.innerHTML = `إجمالي: ${DATA.length}`; function showToast(msg = "تم نسخ الرابط") { toastText.textContent = msg; toast.classList.add("show"); clearTimeout(window.__toastT); window.__toastT = setTimeout(() => toast.classList.remove("show"), 1200); } async function copyLink(url) { try { await navigator.clipboard.writeText(url); showToast(); } catch (e) { const ta = document.createElement("textarea"); ta.value = url; document.body.appendChild(ta); ta.select(); document.execCommand("copy"); document.body.removeChild(ta); showToast(); } } function renderResults(list, rawQuery) { elResults.innerHTML = ""; if (!list.length) { elCount.textContent = "النتائج: 0"; elResults.innerHTML = `