PageSourceSearch

https://circassianweb.com/assets/CompetitionsPage-CP1rqX3a.js

js circassianweb.com collected 2026-09-25 05:02:36 UTC 65,129 bytes, 17 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jspdf.es.min-Dv1_yVTl.js","assets/index-BotW_F4D.js","assets/vendor-ui-Dew8CZxq.js","assets/vendor-supabase-BOCL3uOH.js","assets/vendor-charts-Da-j9H4-.js","assets/vendor-editor-Ct-iNwJc.js","assets/vendor-query-Cjd1QUxP.js","assets/vendor-router-DljXtjbj.js","assets/index-CzveX8rT.css"])))=>i.map(i=>d[i]);
2import{j as e,r as N}from"./vendor-ui-Dew8CZxq.js";import{c as ke,d as oe,bp as V,U as Je,bx as he,bC as O,ag as Ze,b1 as q,b2 as T,e as Ne,a as M,aU as ve,be as ae,bf as te,ao as be,ap as fe,aq as ye,B as U,r as Xe,ac as ea,s as b,aA as aa,ar as _e,aO as le,bD as je,bE as ta,bw as ra,c8 as sa,b8 as na,o as ia,N as la,O as oa,Q as Z,V as X,a$ as xe,aP as ca,bv as da,a2 as ma,a3 as ua,W as xa,aR as ga}from"./index-BotW_F4D.js";import{a as F,u as pa}from"./vendor-query-Cjd1QUxP.js";import{F as $e}from"./flame-CEt1bfac.js";import{T as ha}from"./trending-up-34neRlqp.js";import{C as Le}from"./crown-DRetnf1X.js";import{G as ba}from"./graduation-cap-BJxAyOAC.js";import{g as fa}from"./pageSeoTranslations-Cxu-TCQd.js";import{S as ya}from"./ServiceLinksAndFaq-yKoJLApq.js";import{S as ja}from"./SidebarLayout-BtOnFKiL.js";import{Z as we}from"./zap-ORJ-40tj.js";import"./vendor-supabase-BOCL3uOH.js";import"./vendor-charts-Da-j9H4-.js";import"./vendor-editor-Ct-iNwJc.js";import"./vendor-router-DljXtjbj.js";import"./link-vi_mW7Cb.js";import"./external-link-DtpSMSIO.js";/**
3 * @license lucide-react v0.462.0 - ISC
4 *
5 * This source code is licensed under the ISC license.
6 * See the LICENSE file in the root directory of this source tree.
7 */const Be=ke("Medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]);/**
8 * @license lucide-react v0.462.0 - ISC
9 *
10 * This source code is licensed under the ISC license.
11 * See the LICENSE file in the root directory of this source tree.
12 */const wa=ke("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
13 * @license lucide-react v0.462.0 - ISC
14 *
15 * This source code is licensed under the ISC license.
16 * See the LICENSE file in the root directory of this source tree.
17 */const ze=ke("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),Re={en:{sectionTitle:"Circassian Knowledge Challenge",sectionSubtitle:"Test and deepen your knowledge of Circassian history, culture, and heritage through competitive quizzes designed by historians and researchers",card1Title:"How It Works",card1Desc:"Each challenge presents 15 advanced questions from verified historical and cultural sources. Answer within the time limit, and your score is recorded on the global leaderboard. You have 2 attempts per month — make each one count!",card2Title:"Questions from Trusted Sources",card2Desc:'Every question is crafted from peer-reviewed research, published books like "The Circassian Genocide" by Walter Richmond, Ottoman and Russian archives, and academic studies on Circassian history, tribes, language, and diaspora.',card3Title:"Impact Among Circassians",card3Desc:"This challenge connects Circassians worldwide through shared knowledge. Whether in Turkey, Jordan, Syria, Israel, the USA, Europe, Asia, or the homeland — competing together strengthens our collective identity and keeps our heritage alive for future generations.",card4Title:"Monthly Competition Cycle",card4Desc:"Each month brings fresh competition. With 2 attempts per month, participants can improve their scores while new questions keep the challenge engaging. Top scorers earn recognition on the global leaderboard visible to the entire community.",card5Title:"Earn Badges & Recognition",card5Desc:'Achieve milestones and earn exclusive badges: "Perfect Score" for 100% accuracy, "Speed Demon" for fast completion, "First Victory" for your first passing score, and "Weekly Champion" for topping the leaderboard.',card6Title:"Learn While Competing",card6Desc:"After each answer, you receive detailed explanations with historical context and source citations. Even incorrect answers become learning opportunities — transforming competition into education about the Russo-Circassian War, tribal genealogy, and cultural traditions."},ar:{sectionTitle:"تحدي المعرفة الشركسية",sectionSubtitle:"اختبر وعمّق معرفتك بالتاريخ والثقافة والتراث الشركسي من خلال مسابقات تنافسية صممها مؤرخون وباحثون",card1Title:"كيف يعمل التحدي",card1Desc:"يقدم كل تحدٍ 15 سؤالاً متقدماً من مصادر تاريخية وثقافية موثوقة. أجب خلال الوقت المحدد وسيُسجل نتيجتك في لوحة المتصدرين العالمية. لديك محاولتان شهرياً — اجعل كل واحدة تحسب!",card2Title:"أسئلة من مصادر موثوقة",card2Desc:'كل سؤال مصاغ من أبحاث محكّمة وكتب منشورة مثل "الإبادة الشركسية" لوالتر ريتشموند، والأرشيفات العثمانية والروسية، ودراسات أكاديمية عن التاريخ والقبائل واللغة والمهجر الشركسي.',card3Title:"الأثر بين الشركس",card3Desc:"يربط Ù
17‡Ø°Ø§ التحدي الشركس حول العالم من خلال المعرفة المشتركة. سواء كنت في تركيا أو الأردن أو سوريا أو إسرائيل أو أمريكا أو أوروبا أو آسيا أو الوطن — التنافس معاً يقوّي هويتنا الجماعية ويحافظ على تراثنا للأجيال القادمة.",card4Title:"دورة المسابقة الشهرية",card4Desc:"كل شهر يأتي بمنافسة جديدة. مع محاولتين شهرياً، يمكن للمشاركين تحسين نتائجهم بينما تبقي الأسئلة الجديدة التحدي شيقاً. يحصل أفضل المتسابقين على تقدير في لوحة المتصدرين العالمية.",card5Title:"اكسب شارات وتقدير",card5Desc:'حقق إنجازات واكسب شارات حصرية: "نتيجة كاملة" لدقة 100%، "سريع البرق" للإنجاز السريع، "أول انتصار" لأول نجاح، و"بطل الأسبوع" لتصدر لوحة المتصدرين.',card6Title:"تعلّم أثناء المنافسة",card6Desc:"بعد كل إجابة، تتلقى شرحاً مفصلاً مع سياق تاريخي واستشهادات بالمصادر. حتى الإجابات الخاطئة تصبح فرصاً للتعلم — محولةً المنافسة إلى تثقيف حول الحرب الروسية الشركسية وأنساب القبائل والتقاليد الثقافية."},tr:{sectionTitle:"Çerkes Bilgi Yarışması",sectionSubtitle:"Tarihçiler ve araştırmacılar tarafından tasarlanan yarışmalarla Çerkes tarihi, kültürü ve mirası bilginizi test edin ve derinleştirin",card1Title:"Nasıl Çalışır",card1Desc:"Her yarışma doğrulanmış tarihi ve kültürel kaynaklardan 15 ileri düzey soru sunar. Süre içinde cevaplayın ve puanınız küresel sıralamaya kaydedilsin. Ayda 2 deneme hakkınız var — her birini değerlendirin!",card2Title:"Güvenilir Kaynaklardan Sorular",card2Desc:`Her soru hakemli araştırmalardan, Walter Richmond'ın "Çerkes Soykırımı" gibi yayınlanmış kitaplardan, Osmanlı ve Rus arşivlerinden ve Çerkes tarihi üzerine akademik çalışmalardan hazırlanmıştır.`,card3Title:"Çerkesler Arasında Etkisi",card3Desc:"Bu yarışma dünya genelindeki Çerkesleri ortak bilgi aracılığıyla birbirine bağlar. Türkiye, Ürdün, Suriye, İsrail, ABD, Avrupa, Asya ya da anavatan — birlikte yarışmak kolektif kimliğimizi güçlendirir.",card4Title:"Aylık Yarışma Döngüsü",card4Desc:"Her ay yeni yarışma getirir. Ayda 2 denemeyle katılımcılar puanlarını iyileştirebilir. En iyi puanlılar tüm topluluk tarafından görülebilen küresel sıralamada tanınır.",card5Title:"Rozetler ve Tanınma Kazanın",card5Desc:'Kilometre taşlarına ulaşın ve özel rozetler kazanın: %100 doğruluk için "Mükemmel Puan", hızlı tamamlama için "Hız Şeytanı", ilk geçme puanı için "İlk Zafer".',card6Title:"Yarışırken Öğrenin",card6Desc:"Her cevaptan sonra tarihi bağlam ve kaynak alıntılarıyla ayrıntılı açıklamalar alırsınız. Yanlış cevaplar bile öğrenme fırsatlarına dönüşür — yarışmayı eğitime dönüştürür."},ru:{sectionTitle:"Черкесский интеллектуальный вызов",sectionSubtitle:"Проверьте и углубите знания черкесской истории, культуры и наследия через конкурсные викторины, разработанные историками",card1Title:"Как это работает",card1Desc:"Каждый вызов содержит 15 продвинутых вопросов из проверенных исторических и культурных источников. Отвечайте в отведённое время — ваш результат попадёт в глобальный рейтинг. У вас 2 попытки в месяц — используйте каждую!",card2Title:"Вопросы из надёжных источников",card2Desc:"Каждый вопрос составлен на основе рецензируемых исследований, книг вроде «Черкесский геноцид» Уолтера Ричмонда, османских и российских архивов и академических работ по истории черкесов.",card3Title:"Влияние среди черкесов",card3Desc:"Этот вызов объединяет черкесов по всему миру через общие знания. Будь то в Турции, Иордании, Сирии, Израиле, США, Европе, Азии или на родине — совместное соревнование укрепляет нашу коллективную самобытность.",card4Title:"Ежемесячный цикл",card4Desc:"Каждый месяц — новое соревнование. С 2 попытками участники могут улучшить свои результаты. Лучшие попадают в глобаÐ
17»ÑŒÐ½Ñ‹Ð¹ рейтинг, видимый всему сообществу.",card5Title:"Значки и признание",card5Desc:"Достигайте вех и получайте эксклюзивные значки: «Идеальный результат» за 100% точность, «Молниеносный» за быстрое прохождение, «Первая победа» за первый проходной балл.",card6Title:"Учитесь соревнуясь",card6Desc:"После каждого ответа вы получаете подробные пояснения с историческим контекстом и ссылками на источники. Даже неправильные ответы становятся возможностью для обучения."},he:{sectionTitle:"אתגר הידע הצ'רקסי",sectionSubtitle:"בדקו והעמיקו את הידע שלכם בהיסטוריה, תרבות ומורשת צ'רקסית דרך חידונים תחרותיים שעוצבו על ידי היסטוריונים",card1Title:"איך זה עובד",card1Desc:"כל אתגר מציג 15 שאלות מתקדמות ממקורות מאומתים. ענו תוך מגבלת הזמן והציון שלכם יירשם בטבלת המובילים. יש לכם 2 ניסיונות בחודש — נצלו כל אחד!",card2Title:"שאלות ממקורות אמינים",card2Desc:`כל שאלה נוצרה ממחקרים שפיטים, ספרים כמו "רצח העם הצ'רקסי" מאת וולטר ריצ'מונד, ארכיונים עות'מאניים ורוסיים ומחקרים אקדמיים.`,card3Title:"ההשפעה בקרב הצ'רקסים",card3Desc:`האתגר מחבר צ'רקסים ברחבי העולם באמצעות ידע משותף. בין אם בטורקיה, ירדן, סוריה, ישראל, ארה"ב, אירופה, אסיה או המולדת — תחרות משותפת מחזקת את הזהות הקולקטיבית.`,card4Title:"מחזור תחרות חודשי",card4Desc:"כל חודש מביא תחרות חדשה. עם 2 ניסיונות בחודש, משתתפים יכולים לשפר את הציונים. המובילים מקבלים הכרה בטבלת המובילים הגלובלית.",card5Title:"צברו תגים והכרה",card5Desc:'השיגו אבני דרך וצברו תגים: "ציון מושלם" ל-100% דיוק, "שד מהירות" להשלמה מהירה, "ניצחון ראשון" לציון עובר ראשון.',card6Title:"למדו תוך כדי תחרות",card6Desc:"אחרי כל תשובה מקבלים הסברים מפורטים עם הקשר היסטורי וציטוטי מקורות. גם תשובות שגויות הופכות להזדמנויות למידה."},ady:{sectionTitle:"Адыгэ шIэныгъэ зэнэкъокъу",sectionSubtitle:"Тарихълэжьхэм ыкIи къэхутакIохэм зэхагъэуцуагъэ зэнэкъокъухэмкIэ адыгэ тарихъым, культурэм ыкIи хабзэм яшIэныгъэ уегъэунэфы",card1Title:"Зэрэлажьэрэр",card1Desc:"Зэнэкъокъу пэпчъ упчIэ 15 хэлъ тарихъ ыкIи культурэ къэкIуапIэ шъыпкъэхэм ахэхыгъэу. Уахътэм диштэу джэуап ыкIи уинэкъокъугъэ дунаим щатхы. Мазэм тIо уфитыныгъ — пэпчъ къагъэфед!",card2Title:"КъэкIуапIэ шъыпкъэхэм яупчIэхэр",card2Desc:"УпчIэ пэпчъ академическэ къэхутэныгъэхэм, Уолтер Ричмонд итхылъэу «Адыгэ геноцидыр», Осмэн ыкIи Урыс архивхэм ахэхыгъэу зэхагъэуцуагъ.",card3Title:"Адыгэхэм азыфагу зэрилъыр",card3Desc:"Мы зэнэкъокъум дунаим щыпсэурэ адыгэхэр шIэныгъэ зэхэтымкIэ зэрепхых. Тыркуеми, Иорданиеми, Сириеми, Израилми, Америкэми, Европэми, Азиеми, хэкуми — зэгъусэу узэнэкъокъуныр тилъэпкъ зэхэшIыкIыныгъэ егъэпытэ.",card4Title:"Мазэ зэнэкъокъу цикл",card4Desc:"Мазэ пэпчъ зэнэкъокъукIэ къехьэ. Мазэм тIо уфитыныгъэкIэ хэлажьэхэрэм яинэкъокъугъэ нахьышIу ашIын алъэкIыщт.",card5Title:"Тамыгъэхэр ыкIи цIэрыIоныгъэ",card5Desc:"ГъэхъагъэхэмкIэ тамыгъэ шъхьафхэр къагъахъэх: «Нэкъокъугъэ дэгъу дэд» процент 100-м пае, «ПсынкIэ» — псынкIэу зэшIохыгъэм пае.",card6Title:"Узэнэкъокъузэ зэгъашIэ",card6Desc:"Джэуап пэпчъ ыуж тарихъ къэIотэныгъэ ыкIи къэкIуапIэ гъэнэфагъэхэр къыпфыратыжьых. Джэуап мытэрэзхэри зэгъэшIэÐ
17½Ñ‹Ð³ÑŠÑ амалэу мэхъу."}},G=[wa,V,Je,he,O,Ze],ka=()=>{const{language:c,isRTL:t}=oe(),n=Re[c]||Re.en,r=[{icon:G[0],title:n.card1Title,desc:n.card1Desc},{icon:G[1],title:n.card2Title,desc:n.card2Desc},{icon:G[2],title:n.card3Title,desc:n.card3Desc},{icon:G[3],title:n.card4Title,desc:n.card4Desc},{icon:G[4],title:n.card5Title,desc:n.card5Desc},{icon:G[5],title:n.card6Title,desc:n.card6Desc}];return e.jsxs("div",{className:"mb-10 pt-6",dir:t?"rtl":"ltr",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-8 mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(V,{className:"w-7 h-7 text-primary"}),e.jsx("h2",{className:"font-serif text-2xl md:text-4xl font-bold text-foreground",children:n.sectionTitle})]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl text-sm sm:text-base",children:n.sectionSubtitle})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-5 max-w-7xl mx-auto px-4 sm:px-8",children:r.map((j,f)=>{const R=j.icon;return e.jsx(q,{className:"border-border/50 bg-gradient-to-br from-card to-muted/30 hover:border-primary/30 transition-all duration-300",children:e.jsx(T,{className:"pt-6",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2.5 rounded-xl bg-primary/10 text-primary shrink-0",children:e.jsx(R,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground text-base mb-1.5",children:j.title}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j.desc})]})]})})},f)})})]})},ee={bronze:{label:"Bronze",labelAr:"برونزي",icon:"🥉",color:"text-orange-700",bg:"bg-orange-100 dark:bg-orange-900/30"},silver:{label:"Silver",labelAr:"فضي",icon:"🥈",color:"text-gray-500",bg:"bg-gray-100 dark:bg-gray-800/50"},gold:{label:"Gold",labelAr:"ذهبي",icon:"🥇",color:"text-yellow-600",bg:"bg-yellow-100 dark:bg-yellow-900/30"},diamond:{label:"Diamond",labelAr:"ماسي",icon:"💎",color:"text-cyan-500",bg:"bg-cyan-100 dark:bg-cyan-900/30"}},Na=()=>{const{user:c}=Ne(),{language:t}=oe(),n=t==="ar"||t==="he",{data:r}=F({queryKey:["my-competition-stats",c?.id],queryFn:async()=>{if(!c)return null;const{data:i}=await b.from("user_competition_stats").select("*").eq("user_id",c.id).maybeSingle();return i},enabled:!!c}),{data:j}=F({queryKey:["my-earned-badges",c?.id],queryFn:async()=>{if(!c)return[];const{data:i}=await b.from("user_earned_badges").select("*, badge:competition_badges(*)").eq("user_id",c.id).order("earned_at",{ascending:!1});return i||[]},enabled:!!c}),{data:f}=F({queryKey:["all-competition-badges"],queryFn:async()=>{const{data:i}=await b.from("competition_badges").select("*").order("rank_order",{ascending:!0});return i||[]}}),{data:R}=F({queryKey:["weekly-winners"],queryFn:async()=>{const{data:i}=await b.from("competition_weekly_winners").select("*").order("created_at",{ascending:!1}).limit(9);if(!i||i.length===0)return[];const g=[...new Set(i.map(w=>w.user_id))],{data:x}=await b.from("profiles_public").select("user_id, full_name, avatar_url, tribe").in("user_id",g),D=new Map((x||[]).map(w=>[w.user_id,w]));return i.map(w=>({...w,profile:D.get(w.user_id)}))}}),{data:C}=F({queryKey:["monthly-leaderboard"],queryFn:async()=>{const{data:i}=await b.from("user_competition_stats").select("*").order("total_points",{ascending:!1}).limit(10);if(!i||i.length===0)return[];const g=i.map(w=>w.user_id),{data:x}=await b.from("profiles_public").select("user_id, full_name, avatar_url, tribe").in("user_id",g),D=new Map((x||[]).map(w=>[w.user_id,w]));return i.map(w=>({...w,profile:D.get(w.user_id)}))}});new Set((j||[]).map(i=>i.badge_id));const v=r&&ee[r.rank_tier]||ee.bronze,S=["🥇","🥈","🥉"],Q=(R||[]).reduce((i,g)=>(i[g.week_label]||(i[g.week_label]=[]),i[g.week_label].push(g),i),{});return e.jsxs("div",{className:"space-y-6",children:[c&&r&&e.jsx(q,{className:"border-primary/20 bg-gradient-to-br from-primary/5 to-transparent",children:e.jsxs(T,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[e.jsx("div",{className:M("p-3 rounded-xl",v.bg),children:e.jsx("span",{className:"text-3xl",children:v.icon})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:M("font-bold text-lg",v.color),children:n?v.labelAr:v.label}),e.jsxs(ve,{variant:"secondary",className:"text-xs",children:[r.total_points," ",n?"نقطة":"pts"]})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:n?`أفضل نتيجة: ${r.best_score}%`:`Best: ${r.best_score}%`})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 text-center",children:[e.jsxs("div",{className:"p-2 rounded-lg bg-background/60",children:[e.jsx($e,{className:"w-5 h-5 mx-auto mb-1 text-orange-500"}),e.jsx("div",{className:"text-lg font-bold",children:r.current_streak}),e.jsx("div",{className:"text-xs text-muted-foreground",children:n?"سلسلة":"Streak"})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-background/60",children:[e.jsx(V,{className:"w-5 h-5 mx-auto mb-1 text-primary"}),e.jsx("div",{className:"text-lg font-bold",children:r.total_entries}),e.jsx("div",{className:"text-xs text-muted-foreground",children:n?"مشاركات":"Entries"})]}),e.jsxs("div",{className:"p-2 rounded-lg bg-background/60",children:[e.jsx(ha,{className:"w-5 h-5 mx-auto mb-1 text-green-500"}),e.jsx("div",{className:"text-lg font-bold",children:r.longest_streak}),e.jsx("div",{className:"text-xs text-muted-foreground",children:n?"أطول سلسلة":"Best Streak"})]})]}),r.current_streak>=2&&e.jsxs("div",{className:"mt-3 p-2 rounded-lg bg-orange-100 dar
17k:bg-orange-900/20 text-center text-sm",children:["🔥 ",n?`أنت في سلسلة ${r.current_streak} أسابيع متتالية! واصل!`:`You're on a ${r.current_streak}-week streak! Keep going!`]})]})}),e.jsxs(q,{children:[e.jsx(ae,{children:e.jsxs(te,{className:"flex items-center gap-2 text-lg",children:[e.jsx(O,{className:"w-5 h-5 text-primary"}),n?"الشارات والإنجازات":"Badges & Achievements"]})}),e.jsx(T,{children:(j||[]).length===0?e.jsxs("div",{className:"text-center py-8 space-y-3",children:[e.jsx(O,{className:"w-12 h-12 mx-auto text-muted-foreground/20"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n?"شارك في المسابقات لكسب شارات وإنجازات!":"Participate in competitions to earn badges!"})]}):e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-3",children:(j||[]).map(i=>{const g=i.badge;return g?e.jsxs("div",{className:"p-3 rounded-xl text-center border border-primary/30 bg-primary/5 shadow-sm",children:[e.jsx("span",{className:"text-2xl block mb-1",children:g.icon}),e.jsx("div",{className:"text-xs font-medium leading-tight",children:n?g.name_ar:g.name}),e.jsx("div",{className:"text-[10px] text-primary mt-1",children:"✓"})]},g.id):null})})})]}),e.jsxs(q,{children:[e.jsx(ae,{children:e.jsxs(te,{className:"flex items-center gap-2 text-lg",children:[e.jsx(Le,{className:"w-5 h-5 text-yellow-500"}),n?"لوحة الشرف":"Hall of Fame"]})}),e.jsx(T,{className:"space-y-2",children:(C||[]).length===0?e.jsx("p",{className:"text-center text-muted-foreground py-6",children:n?"لا توجد بيانات بعد":"No data yet"}):(C||[]).map((i,g)=>{const x=ee[i.rank_tier]||ee.bronze;return e.jsxs("div",{className:M("flex items-center gap-3 p-3 rounded-lg border",g<3?"bg-primary/5 border-primary/20":""),children:[e.jsx("div",{className:M("w-8 h-8 rounded-full flex items-center justify-center font-bold text-sm",g===0&&"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50",g===1&&"bg-gray-200 text-gray-700 dark:bg-gray-700",g===2&&"bg-orange-100 text-orange-700 dark:bg-orange-900/50",g>2&&"bg-muted text-muted-foreground"),children:g+1}),e.jsxs(be,{className:"w-8 h-8",children:[e.jsx(fe,{src:i.profile?.avatar_url||""}),e.jsx(ye,{children:(i.profile?.full_name||"?")[0]})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:i.profile?.full_name||"—"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:i.profile?.tribe})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"font-bold text-sm",children:[i.total_points," ",n?"نقطة":"pts"]}),e.jsxs("div",{className:"text-xs",children:[x.icon," ",n?x.labelAr:x.label]})]})]},i.id)})})]}),Object.keys(Q).length>0&&e.jsxs(q,{children:[e.jsx(ae,{children:e.jsxs(te,{className:"flex items-center gap-2 text-lg",children:[e.jsx(V,{className:"w-5 h-5 text-primary"}),n?"فائزو الأسابيع السابقة":"Past Winners"]})}),e.jsx(T,{className:"space-y-4",children:Object.entries(Q).map(([i,g])=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:i}),g.sort((x,D)=>x.rank-D.rank).map(x=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-lg bg-muted/50",children:[e.jsx("span",{className:"text-lg",children:S[x.rank-1]||""}),e.jsxs(be,{className:"w-7 h-7",children:[e.jsx(fe,{src:x.profile?.avatar_url||""}),e.jsx(ye,{children:(x.profile?.full_name||"?")[0]})]}),e.jsx("span",{className:"text-sm font-medium flex-1 truncate",children:x.profile?.full_name||"—"}),e.jsxs("span",{className:"text-sm font-bold text-primary",children:[x.score,"%"]})]},x.id))]},i))})]}),c&&r&&(r.best_score>=90||r.total_entries>=10)&&e.jsx(q,{className:"border-primary/20",children:e.jsxs(T,{className:"p-6 text-center space-y-3",children:[e.jsx(O,{className:"w-12 h-12 mx-auto text-primary"}),e.jsx("h3",{className:"font-bold text-lg",children:n?"🎓 شهادة تقدير":"🎓 Certificate of Achievement"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:n?"لقد حققت إنجازاً مميزاً! يمكنك تحميل شهادتك الرقمية.":"You've achieved a remarkable milestone! Download your digital certificate."}),e.jsxs(U,{onClick:()=>va(c.id,r),className:"gap-2",children:[e.jsx(Xe,{className:"w-4 h-4"}),n?"تحميل الشهادة":"Download Certificate"]})]})})]})};async function va(c,t){const{jsPDF:n}=await ea(async()=>{const{jsPDF:C}=await import("./jspdf.es.min-Dv1_yVTl.js").then(v=>v.j);return{jsPDF:C}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])),r=new n({orientation:"landscape",unit:"mm",format:"a4"}),{data:j}=await b.from("profiles_public").select("full_name").eq("user_id",c).maybeSingle(),f=j?.full_name||"Participant",R=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});r.setFillColor(26,54,93),r.rect(0,0,297,210,"F"),r.setFillColor(255,255,255),r.roundedRect(15,15,267,180,5,5,"F"),r.setDrawColor(184,134,11),r.setLineWidth(2),r.roundedRect(20,20,257,170,3,3,"S"),r.setTextColor(26,54,93),r.setFontSize(36),r.text("Certificate of Achievement",148.5,55,{align:"center"}),r.setDrawColor(184,134,11),r.setLineWidth(1),r.line(80,62,217,62),r.setFontSize(14),r.setTextColor(100,100,100),r.text("Circassian Knowledge Challenge",148.5,75,{align:"center"}),r.setFontSize(28),r.setTextColor(26,54,93),r.text(f,148.5,100,{align:"center"}),r.setFontSize(12),r.setTextColor(80,80,80),r.text(`Best Score: ${t.best_score}%  |  Total Entries: ${t.total_entries}  |  Rank: ${t.rank_tier.toUpperCase()}`,148.5,120,{align:"center"}),r.setFontSize(11),r.text("For outstanding performance in the Weekly Circassian Knowledge Competition",148.5,135,{align:"center"}),r.setFontSize(24),r.text("🏆",148.5,155,{align:"center"}),r.setFontSize(10),r.setTextColor(120,120,120),r.text(R,148.5,175,{align:"center"}),r.save(`Circassian_Challenge_Certificate_${f.replace(/\s+/g,"_")}.pdf`)}const Me={ar:{title:"مراجعة إجاباتك",subtitle:"راجع الأسئلة التي أجبت عليها وتعلّم من الإجابات الصحيحة والشروحات",correctAnswer:"الإجابة الصحيحة",yourAnswer:"إجابتك",explanation:"الشرح",source:"المصدر",showMore:"عرض المزيد",noAnswers:"لم تشارك في أي مسابقة بعد. شارك في التحدي لترى إجاباتك هنا!",loginRequired:"سجل الدخول لمراجعة إجاباتك السابقة",attempt:"المحاولة",score:"النتيجة",history:"التاريخ",culture:"الثقافة",geography:"الجغرافيا",language:"اللغة",tribes:"القبائل"},en:{title:"Review Your Answers",subtitle:"Review questions you answered and learn from correct answers with explanations",correctAnswer:"Correct Answer",yourAnswer:"Your Answer",explanation:"Explanation",source:"Source",showMore:"Show More",noAnswers:"You haven't participated in any competition yet. Take the challenge to see your answers here!",loginRequired:"Log in to review your past answers",attempt:"Attempt",score:"Score",history:"History",culture:"Culture",geography:"Geography",language:"Language",tribes:"Tribes"},tr:{title:"Cevaplarınızı İnceleyin",subtitle:"Cevapladığınız soruları gözden geçirin ve doğru cevaplardan öğrenin",correctAnswer:"Doğru Cevap",yourAnswer:"Cevabınız",explanation:"Açıklama",source:"Kaynak",showMore:"Daha Fazla",noAnswers:"Henüz bir yarışmaya katılmadınız. Cevaplarınızı burada görmek için yarışmaya katılın!",loginRequired:"Geçmiş cevaplarınızı inceleme
17k için giriş yapın",attempt:"Deneme",score:"Puan",history:"Tarih",culture:"Kültür",geography:"Coğrafya",language:"Dil",tribes:"Kabileler"},ru:{title:"Просмотр ваших ответов",subtitle:"Просмотрите вопросы, на которые вы ответили, и учитесь на правильных ответах",correctAnswer:"Правильный ответ",yourAnswer:"Ваш ответ",explanation:"Объяснение",source:"Источник",showMore:"Показать ещё",noAnswers:"Вы ещё не участвовали. Примите участие в викторине, чтобы увидеть свои ответы!",loginRequired:"Войдите, чтобы просмотреть прошлые ответы",attempt:"Попытка",score:"Балл",history:"История",culture:"Культура",geography:"География",language:"Язык",tribes:"Племена"},he:{title:"סקרו את תשובותיכם",subtitle:"עיינו בשאלות שענתם עליהן ולמדו מהתשובות הנכונות",correctAnswer:"תשובה נכונה",yourAnswer:"תשובתך",explanation:"הסבר",source:"מקור",showMore:"הצג עוד",noAnswers:"עדיין לא השתתפתם. השתתפו באתגר כדי לראות את תשובותיכם כאן!",loginRequired:"התחברו כדי לצפות בתשובות קודמות",attempt:"ניסיון",score:"ציון",history:"היסטוריה",culture:"תרבות",geography:"גאוגרפיה",language:"שפה",tribes:"שבטים"},kbd:{title:"Уиджэуапхэр зэгъэплъыжь",subtitle:"Джэуап зытыгъэ упчIэхэр ыкIи джэуап тэрэзхэр зэгъашIэх",correctAnswer:"Джэуап тэрэз",yourAnswer:"Уиджэуап",explanation:"ГъэнэфэгъэкIэ",source:"КъэкIуапI",showMore:"НахьыбэкIэ",noAnswers:"Джыри зэнэкъокъум ухэлэжьагъэп. Уиджэуапхэр мыщ щыплъэгъунхэм пае зэнэкъокъум хэлажь!",loginRequired:"Уиджэуапхэр плъэгъунхэм пае хэхьажь",attempt:"Ушэтыныгъ",score:"Инэкъокъугъ",history:"Тарихъ",culture:"Культурэ",geography:"Географие",language:"Бзэ",tribes:"Лъэпкъхэр"}},Qe=N.forwardRef((c,t)=>{const{language:n,isRTL:r}=oe(),{user:j}=Ne(),f=Me[n]||Me.en,[R,C]=N.useState(new Set),{data:v,isLoading:S}=F({queryKey:["my-competition-entries",j?.id],queryFn:async()=>{if(!j)return[];const{data:l,error:_}=await b.from("competition_entries").select("id, score, correct_count, total_questions, time_taken_seconds, answers, created_at").eq("user_id",j.id).order("created_at",{ascending:!1});if(_)throw _;return l||[]},enabled:!!j}),Q=v?.flatMap(l=>l.answers?.map(y=>y.questionId)||[])||[],i=[...new Set(Q)],{data:g}=F({queryKey:["answered-questions",i.join(","),n],queryFn:async()=>{if(i.length===0)return[];const{data:l,error:_}=await b.from("competition_questions_safe").select("*").in("id",i);if(_)throw _;let y=l||[];if(n!=="ar"&&y.length>0)try{const{data:L}=await b.functions.invoke("translate-competition-questions",{body:{question_ids:y.map(z=>z.id),target_language:n}});if(L?.translations?.length){const z=new Map(L.translations.map(A=>[A.question_id,A]));y=y.map(A=>{const p=z.get(A.id);return p?{...A,question:p.question,options:Array.isArray(p.options)?p.options:JSON.parse(p.options),correct_answer:p.correct_answer,explanation:p.explanation||A.explanation}:A})}}catch(L){console.error("Translation failed for review:",L)}return y},enabled:i.length>0}),x=new Map((g||[]).map(l=>[l.id,l])),D=l=>{C(_=>{const y=new Set(_);return y.has(l)?y.delete(l):y.add(l),y})},w=l=>({history:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",culture:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",geography:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",language:"bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300",tribes:"bg-rose-100 text-rose-800 dark:bg-rose-900/30 dark:text-rose-300"})[l]||"bg-muted text-muted-foreground",re=l=>{const _=Math.floor(l/60),y=l%60;return`${_}:${y.toString().padStart(2,"0")}`};return j?e.jsxs("div",{ref:t,className:"space-y-6",dir:r?"rtl":"ltr",children:[e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 flex items-center justify-center mx-auto",children:e.jsx(ba,{className:"w-8 h-8 text-primary"})}),e.jsx("h2",{className:"text-xl font-bold",children:f.title}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:f.subtitle})]}),S?e.jsx("div",{className:"space-y-3",children:[1,2,3].map(l=>e.jsx("div",{className:"h-20 rounded-xl bg-muted animate-pulse"},l))}):!v||v.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(_e,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"text-sm",children:f.noAnswers})]}):e.jsx("div",{className:"space-y-8",children:v.map((l,_)=>{const y=l.answers||[],L=new Date(l.created_at).toLocaleDateString(r?"ar":"en",{year:"numeric",month:"short",day:"numeric"});return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-muted/50 border",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:M("w-10 h-10 rounded-lg flex items-center justify-center font-bold text-sm",l.score>=70?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300":"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300"),children:[l.score,"%"]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-medium",children:[f.attempt," ",v.length-_]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:L})]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.correct_count,"/",l.total_questions," • ",l.time_taken_seconds?re(l.time_taken_seconds):"--"]})]}),e.jsx("div",{className:"space-y-2",children:y.map((z,A)=>{const p=x.get(z.questionId);if(!p)return null;const K=R.has(`${l.id}-${A}`),J=Array.isArray(p.options)?p.options:JSON.parse(p.options);return e.jsx(q,{className:M("border-border/50 cursor-pointer hover:border-primary/30",K&&"border-primary/20 shadow-sm"),onClick:()=>D(`${l.id}-${A}`),children:e.jsxs(T,{className:"p-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:M("w-7 h-7 rounded-lg flex items-center justify-center shrink-0",z.correct?"bg-green-100 dark:bg-green-900/30":"bg-red-100 dark:bg-red-900/30"),children:z.correct?e.jsx(le,{className:"w-4 h-4 text-green-600"}):e.jsx(je,{className:"w-4 h-4 text-red-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-2 mb-1",children:e.jsx(ve,{className:M("text-[10px]",w(p.category)),variant:"secondary",children:f[p.category]||p.category})}),e.jsx("p",{className:"text-sm leading-relaxed",children:p.question})]}),e.jsx("div",{className:"shrink-0 text-muted-foreground",children:K?e.jsx(ta,{className:"w-4 h-4"}):e.jsx(ra,{className:"w-4 h-4"})})]}),K&&e.jsxs("div",{className:"mt-3 space-y-2 border-t pt-3",onClick:I=>I.stopPropagation(),children:[e.jsx("div",{className:"space-y-1.5",children:J.map((I,H)=>{const E=I===p.correct_answer,P=I===z.answer,Y=P&&!z.correct;return e.jsxs("div",{className:M("flex items-center gap-2 p-2.5 rounded-lg text-sm",E?"bg-green-50 border border-green-200 dark:bg-green-900/20 dark:border-green-800":Y?"bg-red-50 border border-red-200 dark:bg-red-900/20 dark:border-red-800":"bg-muted/30"),children:[E&&e.jsx(le,{className:"w-4 h-4 text-green-600 shrink-0"}),Y&&e.jsx(je,{className:"w-4 h-4 text-red-500 shrink-0"}),e.jsx("span",{className:M("flex-1",E&&"font-medium text-green-700 dark:text-green-300",Y&&"text-red-600 dark:text-red-400 line-through"),children:I}),P&&e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["← ",f.yourAnswer]})]},H)})}),p.explanation&&e.jsxs("div",{className:"p-3 rounded-lg bg-amber-50 dark:bg-amber-900/10 border border-amber-200 dark:border-amber-800/30",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(sa,{className:"w-4 h-4 text-amber-600"}),e.jsx("span",{className:"text-xs font-semibold text-amber-700 dark:text-amber-400",children:f.explanation})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:p.explanation})]}),p.source&&e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["📚 ",f.source,": ",p.source]})]})]})},`${l.id}-${A}`)})})]},l.id)})})]}):e.jsxs("div",{className:"text-center py-16 space-y-4",children:[e.jsx(aa,{className:"w-12 h-12 mx-auto text-muted-foreground
17/30"}),e.jsx("p",{className:"text-muted-foreground",children:f.loginRequired})]})});Qe.displayName="LastWeekReview";const Fe={en:{linksTitle:"Explore More Heritage Services",faqTitle:"Frequently Asked Questions — Knowledge Challenge",faqs:[{q:"What is the Knowledge Challenge?",a:"A weekly quiz competition testing your knowledge of Circassian history, culture, geography, and traditions. Compete with community members and earn badges."},{q:"How often are new quizzes available?",a:"New competition rounds are launched weekly. Each round features carefully curated questions across multiple difficulty levels."},{q:"Are questions available in my language?",a:"Yes — questions are available in English, Arabic, Turkish, Russian, Hebrew, and Adyghe. You play in your selected interface language."},{q:"How is the scoring system calculated?",a:"Scores are based on correct answers and speed. Bonus points are awarded for streaks and perfect rounds. Top performers appear on the weekly leaderboard."},{q:"Can I review my past quiz results?",a:"Yes, the Results tab shows your complete competition history including scores, correct answers, time taken, and any badges earned."}]},ar:{linksTitle:"اكتشف المزيد من خدمات التراث",faqTitle:"الأسئلة الشائعة — تحدي المعرفة",faqs:[{q:"ما هو تحدي المعرفة؟",a:"مسابقة أسبوعية تختبر معرفتك بالتاريخ والثقافة والجغرافيا والتقاليد الشركسية. تنافس مع أعضاء المجتمع واحصل على شارات."},{q:"كم مرة تتوفر مسابقات جديدة؟",a:"تُطلق جولات جديدة أسبوعيًا مع أسئلة منتقاة بعناية عبر مستويات صعوبة متعددة."},{q:"هل الأسئلة متوفرة بلغتي؟",a:"نعم — الأسئلة متوفرة بالإنجليزية والعربية والتركية والروسية والعبرية والأديغية."},{q:"كيف يُحسب نظام النقاط؟",a:"تعتمد النقاط على الإجابات الصحيحة والسرعة مع نقاط إضافية للسلاسل والجولات المثالية."},{q:"هل يمكنني مراجعة نتائجي السابقة؟",a:"نعم، تبويب النتائج يعرض سجلك الكامل بما في ذلك النقاط والإجابات الصحيحة والوقت والشارات."}]},tr:{linksTitle:"Daha Fazla Miras Hizmeti",faqTitle:"Sıkça Sorulan Sorular — Bilgi Yarışması",faqs:[{q:"Bilgi Yarışması nedir?",a:"Çerkes tarihi, kültürü, coğrafyası ve gelenekleri hakkındaki bilginizi test eden haftalık bir yarışma. Topluluk üyeleriyle yarışın ve rozetler kazanın."},{q:"Yeni yarışmalar ne sıklıkla yayınlanıyor?",a:"Her hafta yeni yarışma turları başlatılır. Her tur birden fazla zorluk seviyesinde dikkatle hazırlanmış sorular içerir."},{q:"Sorular benim dilimde mevcut mu?",a:"Evet — sorular İngilizce, Arapça, Türkçe, Rusça, İbranice ve Adığece olarak mevcuttur."},{q:"Puanlama nasıl hesaplanır?",a:"Puanlar doğru cevaplara ve hıza dayanır. Seriler ve mükemmel turlar için bonus puanlar verilir."},{q:"Geçmiş sonuçlarımı görebilir miyim?",a:"Evet, Sonuçlar sekmesi puanlar, doğru cevaplar, süre ve kazanılan rozetler dahil tam yarışma geçmişinizi gösterir."}]},ru:{linksTitle:"Другие сервисы наследия",faqTitle:"Часто задаваемые вопросы — Викторина знаний",faqs:[{q:"Что такое «Викторина знаний»?",a:"Еженедельная викторина, проверяющая знания черкесской истории, культуры, географии и традиций. Соревнуйтесь и зарабатывайте значки."},{q:"Как часто появляются новые викторины?",a:"Новые раунды запускаются еженедельно с тщательно подобранными вопросами разной сложности."},{q:"Доступны ли вопросы на моём языке?",a:"Да — вопросы доступны на английском, арабском, турецком, русском, иврите и адыгейском."},{q:"Как считаются баллы?",a:"Баллы основаны на правильных ответах и скорости. Бон
17усные баллы за серии и идеальные раунды."},{q:"Могу ли я просмотреть прошлые результаты?",a:"Да, вкладка результатов показывает полную историю соревнований, включая баллы, ответы, время и значки."}]},he:{linksTitle:"שירותי מורשת נוספים",faqTitle:"שאלות נפוצות — אתגר הידע",faqs:[{q:"מהו אתגר הידע?",a:"תחרות חידון שבועית הבוחנת את הידע שלכם בהיסטוריה, תרבות, גיאוגרפיה ומסורות צ'רקסיות. התחרו וצברו תגים."},{q:"כמה פעמים מתפרסמים חידונים חדשים?",a:"סבבים חדשים מושקים מדי שבוע עם שאלות ברמות קושי מגוונות."},{q:"האם השאלות זמינות בשפה שלי?",a:"כן — שאלות זמינות באנגלית, ערבית, טורקית, רוסית, עברית ואדיגית."},{q:"איך מחושב הניקוד?",a:"הניקוד מבוסס על תשובות נכונות ומהירות. בונוסים ניתנים על רצפים וסבבים מושלמים."},{q:"האם ניתן לצפות בתוצאות קודמות?",a:"כן, לשונית התוצאות מציגה את ההיסטוריה המלאה כולל ניקוד, תשובות, זמן ותגים."}]},ady:{linksTitle:"Нэмыкl хэкум и лъэужьхэр",faqTitle:"Упчlэ нэхъыбэрэ къатхэр — Щlэныгъэ зэпеуэ",faqs:[{q:"Щlэныгъэ зэпеуэр сыт?",a:"Тхьэмахуэ къэс екlуэкl зэпеуэщ адыгэ тхыдэм, щэнхабзэм, щlыпlэхэм, хабзэхэм теухуа щlэныгъэр щыпщlэу."},{q:"Зэпеуэщlэхэр дапщэрэ къыдокl?",a:"Тхьэмахуэ къэс зэпеуэщlэхэр къыдокl гугъуагъэ зэхуэмыдэхэмкlэ упчlэ къыхэхахэр яlэу."},{q:"Упчlэхэр си бзэкlэ щыlэ?",a:"Нтlэ — инджылызыбзэ, хьэрыпыбзэ, тыркубзэ, урысыбзэ, журтыбзэ, адыгэбзэкlэ щыlэщ."},{q:"Очкохэр дауэ ябж?",a:"Очкохэр жэуап пэжхэмрэ псынщlагъэмрэ елъытащ. Бонус очкохэр серие, раунд пэжхэм щхьэкlэ ят."},{q:"Си кlэух хъуахэр слъагъуфын?",a:"Нтlэ, Кlэухыр табым зэпеуэ тхыдэ псори — очко, жэуап, зэман, бэдж — къегъэлъагъуэ."}]}},_a=[{label:"Circassian Language Learning",href:"/language"},{label:"Circassian History Timeline",href:"/history"},{label:"Circassian Families Database",href:"/families"},{label:"DNA Heritage Explorer",href:"/dna"},{label:"Tamga — Tribal Crests",href:"/tamga"}],qa=[{label:"Twelve Adyghe Tribes (Wikipedia)",href:"https://en.wikipedia.org/wiki/Twelve_Adyghe_tribes",external:!0},{label:"Nart Sagas — Epic Mythology",href:"https://en.wikipedia.org/wiki/Nart_sagas",external:!0},{label:"Sporcle — World Quizzes",href:"https://www.sporcle.com/games/category/geography",external:!0}],Ta=({language:c,isRTL:t})=>{const n=Fe[c]?c:"en",r=Fe[n];return e.jsx(ya,{isRTL:t,internalLinks:_a,externalLinks:qa,faqs:r.faqs,linksTitle:r.linksTitle,faqTitle:r.faqTitle})},ge={weekly_champion:{icon:Le,color:"text-yellow-500",bg:"bg-yellow-100 dark:bg-yellow-900/30"},perfect_score:{icon:ca,color:"text-purple-500",bg:"bg-purple-100 dark:bg-purple-900/30"},fire_streak:{icon:$e,color:"text-orange-500",bg:"bg-orange-100 dark:bg-orange-900/30"},knowledge_master:{icon:_e,color:"text-blue-500",bg:"bg-blue-100 dark:bg-blue-900/30"},first_win:{icon:Be,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"},speed_demon:{icon:we,color:"text-cyan-500",bg:"bg-cyan-100 dark:bg-cyan-900/30"}},Ee=15,pe=70,Aa=2,Ha=()=>{const{user:c}=Ne(),{t,language:n}=oe(),r=fa("competitions",n);na({ogImage:"https://circassianweb.com/competition-hero.jpg",title:r.title,de
17scription:r.description,keywords:r.keywords,jsonLd:{"@context":"https://schema.org","@type":"Quiz",name:"Circassian Heritage Quiz",description:"Weekly trivia competitions about Circassian history, culture, and traditions.",url:"https://circassianweb.com/competitions",educationalAlignment:{"@type":"AlignmentObject",alignmentType:"educationalSubject",targetName:"Circassian Heritage & Culture"}}});const{toast:j}=ia(),f=pa(),R=n==="ar"||n==="he",[C,v]=N.useState(!1),[S,Q]=N.useState([]),[i,g]=N.useState(0),[x,D]=N.useState(""),[w,re]=N.useState([]),[l,_]=N.useState(null),[y,L]=N.useState(0),[z,A]=N.useState(0),p=N.useRef(),K=N.useRef([]),J=N.useRef(null),[I,H]=N.useState(!1),[E,P]=N.useState(null),{data:Y}=F({queryKey:["competition-leaderboard"],queryFn:async()=>{const{data:a,error:s}=await b.from("competition_entries").select("user_id, score, correct_count, total_questions, time_taken_seconds, created_at").order("score",{ascending:!1}).order("time_taken_seconds",{ascending:!0}).limit(20);if(s)throw s;const d=[...new Set((a||[]).map(u=>u.user_id))];if(d.length===0)return[];const{data:m}=await b.from("profiles_public").select("user_id, full_name, avatar_url, tribe").in("user_id",d),o=new Map((m||[]).map(u=>[u.user_id,u]));return(a||[]).map(u=>({...u,profile:o.get(u.user_id)}))}}),{data:ce}=F({queryKey:["user-badges",c?.id],queryFn:async()=>{if(!c)return[];const{data:a,error:s}=await b.from("user_badges").select("*").eq("user_id",c.id).order("earned_at",{ascending:!1});if(s)throw s;return a||[]},enabled:!!c}),{data:B}=F({queryKey:["my-best-score",c?.id],queryFn:async()=>{if(!c)return null;const{data:a}=await b.from("competition_entries").select("score, correct_count, total_questions, time_taken_seconds").eq("user_id",c.id).order("score",{ascending:!1}).limit(1).maybeSingle();return a},enabled:!!c}),{data:de}=F({queryKey:["monthly-attempts",c?.id],queryFn:async()=>{if(!c)return{count:0,lastAttemptDate:null};const a=new Date,s=new Date(a.getFullYear(),a.getMonth(),1).toISOString(),{count:d,error:m}=await b.from("competition_entries").select("*",{count:"exact",head:!0}).eq("user_id",c.id).gte("created_at",s);if(m)throw m;const{data:o}=await b.from("competition_entries").select("created_at").eq("user_id",c.id).order("created_at",{ascending:!1}).limit(1).maybeSingle();return{count:d||0,lastAttemptDate:o?.created_at||null}},enabled:!!c}),qe=de?.count||0,me=Aa-qe,se=de?.lastAttemptDate?new Date(de.lastAttemptDate):null,Te=new Date,Ae=7*24*60*60*1e3,Ce=!se||Te.getTime()-se.getTime()>=Ae,ne=se?Math.max(0,Math.ceil((se.getTime()+Ae-Te.getTime())/(24*60*60*1e3))):0,Ke=me>0&&(qe===0||Ce);N.useEffect(()=>(C&&!l&&(p.current=setInterval(()=>{A(Math.floor((Date.now()-y)/1e3))},1e3)),()=>{p.current&&clearInterval(p.current)}),[C,l,y]);const Pe=(a,s)=>{if(Array.isArray(a))return a.map(String);if(typeof a=="string")try{const d=JSON.parse(a);if(Array.isArray(d))return d.map(String)}catch{return s}if(a&&typeof a=="object"){const m=Object.values(a);if(m.length&&m.every(o=>typeof o=="string"||typeof o=="number"))return m.map(String)}return s},ue=(a,s=[])=>{const d=s.map(o=>({...o,question_id:o?.question_id??o?.id})).filter(o=>!!o?.question_id),m=new Map(d.map(o=>[o.question_id,o]));return a.map(o=>{const u=m.get(o.id);return u?{...o,question:typeof u.question=="string"&&u.question.trim()?u.question:o.question,options:Pe(u.options,o.options),correct_answer:typeof u.correct_answer=="string"&&u.correct_answer.trim()?u.correct_answer:o.correct_answer,explanation:u.explanation??o.explanation}:o})},Se=async(a,s)=>{const{data:d,error:m}=await b.from("competition_question_translations_safe").select("question_id, question, options, explanation").in("question_id",a).eq("language_code",s);return{translations:d||[],error:m}},We=async(a,s)=>{const{data:d,error:m}=await b.functions.invoke("translate-competition-questions",{body:{question_ids:a,target_language:s}});return{translations:Array.isArray(d?.translations)?d.translations:[],error:m,status:m?.context?.status}},De=async(a,s)=>{try{const d=a.map(h=>h.id);let m=a;const o=await Se(d,s);o.error?console.error("Primary cache fetch failed:",o.error):m=ue(m,o.translations);let u=new Set(o.translations.map(h=>
17h?.question_id??h?.id).filter(Boolean)),k=d.filter(h=>!u.has(h));if(k.length>0){const h=await We(k,s);h.error&&h.status!==402&&h.status!==429&&console.error("Translation invoke failed:",h.error),m=ue(m,h.translations),u=new Set(h.translations.map(W=>W?.question_id??W?.id).filter(Boolean)),k=k.filter(W=>!u.has(W))}if(k.length>0&&s!=="en"&&s!=="ar"){const h=await Se(k,"en");h.error?console.error("English fallback cache fetch failed:",h.error):m=ue(m,h.translations)}return m}catch(d){return console.error("Translation failed, using original:",d),a}},Ie=async()=>{try{const{data:a,error:s}=await b.from("competition_questions_safe").select("*").eq("is_active",!0);if(s)throw s;if(!a||a.length===0){j({title:t("comp.noQuestions"),variant:"destructive"});return}const m=a.sort(()=>Math.random()-.5).slice(0,Ee).map(u=>{const k=Array.isArray(u.options)?[...u.options]:JSON.parse(u.options);for(let h=k.length-1;h>0;h--){const W=Math.floor(Math.random()*(h+1));[k[h],k[W]]=[k[W],k[h]]}return{...u,options:k}}),o=await De(m,n);K.current=m.map(u=>({...u,options:[...u.options]})),J.current=n,Q(o),g(0),D(""),re([]),_(null),H(!1),P(null),L(Date.now()),A(0),v(!0)}catch{j({title:t("comp.errorLoading"),variant:"destructive"})}};N.useEffect(()=>{if(!C||l||J.current===n||!K.current.length)return;let a=!1;return(async()=>{const d=await De(K.current,n);a||(Q(d),D(""),H(!1),P(null),J.current=n)})(),()=>{a=!0}},[n,C,l]);const Oe=async()=>{if(!x)return;const a=S[i],{data:s}=await b.rpc("check_competition_answer",{_question_id:a.id,_answer:x});P(!!s),H(!0)},He=async()=>{const a=S[i],{data:s}=await b.rpc("check_competition_answer",{_question_id:a.id,_answer:x}),d=[...w,{questionId:a.id,answer:x,correct:!!s}];if(re(d),H(!1),P(null),D(""),i<S.length-1)g(m=>m+1);else{const m=d.filter(h=>h.correct).length,o=Math.round(m/S.length*100),u=o>=pe,k=Math.floor((Date.now()-y)/1e3);p.current&&clearInterval(p.current),_({score:o,correctCount:m,passed:u}),Ye(d,o,m,k)}},Ye=async(a,s,d,m)=>{if(c)try{await b.rpc("submit_competition_entry",{_competition_id:null,_answers:a,_time_taken_seconds:m});const o=[];s===100&&o.push({badge_type:"perfect_score",badge_name:t("comp.badge.perfectScore"),badge_description:t("comp.badge.perfectScoreDesc")}),s>=pe&&(!B||B.score<pe)&&o.push({badge_type:"first_win",badge_name:t("comp.badge.firstWin"),badge_description:t("comp.badge.firstWinDesc")}),m<60&&s>=80&&o.push({badge_type:"speed_demon",badge_name:t("comp.badge.speedDemon"),badge_description:t("comp.badge.speedDemonDesc")});for(const u of o){const{data:k}=await b.rpc("award_competition_badge",{_user_id:c.id,_badge_type:u.badge_type,_badge_name:u.badge_name,_badge_description:u.badge_description,_metadata:{score:s,time:m}});k&&j({title:`🏆 ${u.badge_name}`,description:u.badge_description})}f.invalidateQueries({queryKey:["competition-leaderboard"]}),f.invalidateQueries({queryKey:["user-badges"]}),f.invalidateQueries({queryKey:["my-best-score"]}),f.invalidateQueries({queryKey:["monthly-attempts"]})}catch(o){console.error("Error saving:",o)}},ie=a=>{const s=Math.floor(a/60),d=a%60;return`${s}:${d.toString().padStart(2,"0")}`},Ge=a=>({history:t("comp.cat.history"),culture:t("comp.cat.culture"),geography:t("comp.cat.geography"),language:t("comp.cat.language"),tribes:t("comp.cat.tribes")})[a]||a,Ue=a=>{switch(a){case"medium":return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300";case"hard":return"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300";case"expert":return"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300";default:return"bg-muted text-muted-foreground"}},$=S[i],Ve=C?(i+(l?1:0))/S.length*100:0;return e.jsxs(ja,{children:[c&&e.jsx(ka,{}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-8 py-6",children:C?l?e.jsx(q,{children:e.jsxs(T,{className:"p-8 text-center space-y-6",children:[e.jsx("div",{className:`w-24 h-24 rounded-full flex items-center justify-center mx-auto ${l.passed?"bg-green-100 dark:bg-green-900/30":"bg-amber-100 dark:bg-amber-900/30"}`,children:l.passed?e.jsx(V,{className:"w-12 h-12 text-green-600"}):e.jsx(xe,{className:"w-12 h-12 text-amber-600"})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-4xl font-bold",children:[l.score,"%"]}),e.jsxs("p",{className:"text-muted-foreground mt-1",children:[l.correctCount,"/",S.length," ",t("comp.correctAnswers")]}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[e.jsx(he,{className:"w-4 h-4 inline mr-1"}),ie(z)]})]}),e.jsx("p",{className:"text-muted-foreground",children:l.passed?t("comp.passedMsg"):t("comp.failedMsg")}),e.jsxs("div",{className:"flex justify-center gap-3",children:[e.jsxs(U,{variant:"outline",onClick:Ie,className:"gap-2",children:[e.jsx(xe,{className:"w-4 h-4"}),t("comp.tryAgain")]}),e.jsx(U,{onClick:()=>v(!1),children:t("comp.backToMenu")})]})]})}):$?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground mb-1",children:[e.jsxs("span",{children:[i+1,"/",S.length]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ve,{className:Ue($.difficulty),variant:"secondary",children:t(`comp.diff.${$.difficulty}`)}),e.jsx("span",{children:Ge($.category)})]})]}),e.jsx(da,{value:Ve,className:"h-2"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm font-mono bg-muted px-3 py-1 rounded-md",children:[e.jsx(ze,{className:"w-4 h-4"}),ie(z)]})]}),e.jsx(q,{children:e.jsxs(T,{className:"p-6 space-y-6",children:[e.jsx("h2",{className:"text-xl font-semibold leading-relaxed",children:$.question}),$.source&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["📚 ",$.source]}),e.jsx(ma,{value:x,onValueChange:D,disabled:I,children:e.jsx("div",{className:"space-y-3",children:$.options.map((a,s)=>{let d="border-border hover:border-primary/50";return I?a===x&&E?d="border-green-500 bg-green-50 dark:bg-green-900/20":a===x&&!E&&(d="border-red-500 bg-red-50 dark:bg-red-900/20"):x===a&&(d="border-primary bg-primary/5"),e.jsxs("div",{className:`flex items-center gap-3 p-4 rounded-lg border cursor-pointer transition-colors ${d}`,onClick:()=>!I&&D(a),children:[e.jsx(ua,{value:a,id:`opt-${s}`,className:"shrink-0"}),e.jsx(xa,{htmlFor:`opt-${s}`,className:"cursor-pointer flex-1 leading-relaxed",children:a}),I&&a===x&&E&&e.jsx(le,{className:"w-5 h-5 text-green-500 shrink-0"}),I&&a===x&&!E&&e.jsx(je,{className:"w-5 h-5 text-red-500 shrink-0"})]},s)})})}),I&&$.explanation&&e.jsxs("div",{className:`p-4 rounded-lg border ${E?"bg-green-50 border-green-200 dark:bg-green-900/20 dark:border-green-800":"bg-amber-50 border-amber-200 dark:bg-amber-900/20 dark:border-amber-800"}`,children:[e.jsx("p",{className:"text-sm font-medium mb-1",children:E?`✅ ${t("comp.correctAnswer")}`:`❌ ${t("comp.wrongAnswer")}`}),e.jsx("p",{className:"text-sm text-muted-foreground",children:$.explanation})]}),e.jsx("div",{className:"flex justify-end pt-2",children:I?e.jsx(U,{onClick:He,className:"gap-2",children:i<S.length-1?e.jsxs(e.Fragment,{children:[t("comp.nextQuestion")," ",e.jsx(ga,{className:"w-4 h-4"})]}):t("comp.finishQuiz")}):e.jsx(U,{onClick:Oe,disabled:!x,className:"gap-2",children:t("comp.checkAnswer")})})]})})]}):null:e.jsx(e.Fragment,{children:e.jsxs(la,{defaultValue:"play",className:"space-y-6",children:[e.jsxs(oa,{
17className:"grid grid-cols-5 w-full",children:[e.jsx(Z,{value:"learn",children:t("comp.tab.learn")}),e.jsx(Z,{value:"play",children:t("comp.tab.play")}),e.jsx(Z,{value:"leaderboard",children:t("comp.tab.leaderboard")}),e.jsx(Z,{value:"achievements",children:t("comp.tab.achievements")}),e.jsx(Z,{value:"badges",children:t("comp.tab.badges")})]}),e.jsx(X,{value:"learn",children:e.jsx(Qe,{})}),e.jsxs(X,{value:"play",className:"space-y-6",children:[c&&B&&e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsx(q,{children:e.jsxs(T,{className:"p-4 text-center",children:[e.jsx(V,{className:"w-6 h-6 mx-auto mb-1 text-primary"}),e.jsxs("div",{className:"text-2xl font-bold",children:[B.score,"%"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t("comp.bestScore")})]})}),e.jsx(q,{children:e.jsxs(T,{className:"p-4 text-center",children:[e.jsx(le,{className:"w-6 h-6 mx-auto mb-1 text-green-500"}),e.jsxs("div",{className:"text-2xl font-bold",children:[B.correct_count,"/",B.total_questions]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t("comp.correct")})]})}),e.jsx(q,{children:e.jsxs(T,{className:"p-4 text-center",children:[e.jsx(he,{className:"w-6 h-6 mx-auto mb-1 text-blue-500"}),e.jsx("div",{className:"text-2xl font-bold",children:B.time_taken_seconds?ie(B.time_taken_seconds):"--"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t("comp.bestTime")})]})})]}),e.jsx(q,{className:"border-primary/20",children:e.jsxs(T,{className:"p-8 text-center space-y-6",children:[e.jsx("div",{className:"w-20 h-20 rounded-full bg-primary/10 flex items-center justify-center mx-auto",children:e.jsx(we,{className:"w-10 h-10 text-primary"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:t("comp.startTitle")}),e.jsx("p",{className:"text-muted-foreground",children:t("comp.startDesc")})]}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-3 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(_e,{className:"w-4 h-4"})," ",Ee," ",t("comp.questions")]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ze,{className:"w-4 h-4"})," ",t("comp.timed")]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{className:"w-4 h-4"})," ",t("comp.earnBadges")]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(xe,{className:"w-4 h-4"})," ",t("comp.monthlyLimit")]})]}),c?Ke?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[me," ",t("comp.attemptsLeft")]}),e.jsxs(U,{size:"lg",onClick:Ie,className:"gap-2 text-lg px-8",children:[e.jsx(we,{className:"w-5 h-5"}),t("comp.startQuiz")]})]}):me>0&&!Ce?e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-amber-600 dark:text-amber-400 font-medium",children:R?`⏳ يمكنك المحاولة مرة أخرى بعد ${ne} ${ne===1?"يوم":"أيام"}`:`⏳ Next attempt available in ${ne} day${ne!==1?"s":""}`})}):e.jsx("div",{className:"space-y-2",children:e.jsx("p",{className:"text-destructive font-medium",children:t("comp.noAttemptsLeft")})}):e.jsx("p",{className:"text-muted-foreground",children:t("comp.loginRequired")})]})})]}),e.jsx(X,{value:"leaderboard",children:e.jsxs(q,{children:[e.jsx(ae,{children:e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx(Be,{className:"w-5 h-5 text-primary"}),t("comp.leaderboardTitle")]})}),e.jsx(T,{className:"space-y-3",children:(Y||[]).length===0?e.jsx("p",{className:"text-center text-muted-foreground py-8",children:t("comp.noEntries")}):(Y||[]).map((a,s)=>e.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${s<3?"bg-primary/5 border-primary/20":""}`,children:[e.jsx("div",{className:M("w-8 h-8 rounded-full flex items-center justify-center font-bold text-sm",s===0&&"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",s===1&&"bg-gray-200 text-gray-700 dark:bg-gray-700 dark:text-gray-300",s===2&&"bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",s>2&&"bg-muted text-muted-foreground"),children:s+1}),e.jsxs(be,{className:"w-8 h-8",children:[e.jsx(fe,{src:a.profile?.avatar_url||""}),e.jsx(ye,{children:(a.profile?.full_name||"?")[0]})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium truncate",children:a.profile?.full_name||t("comp.anonymous")}),a.profile?.tribe&&e.jsx("div",{className:"text-xs text-muted-foreground",children:a.profile.tribe})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"font-bold text-primary",children:[a.score,"%"]}
17),e.jsx("div",{className:"text-[10px] text-muted-foreground/60 uppercase tracking-wide",children:R?"النتيجة":"Score"}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["🕐 ",a.time_taken_seconds?ie(a.time_taken_seconds):"--"]})]})]},s))})]})}),e.jsx(X,{value:"achievements",children:e.jsx(Na,{})}),e.jsx(X,{value:"badges",children:e.jsxs(q,{children:[e.jsx(ae,{children:e.jsxs(te,{className:"flex items-center gap-2",children:[e.jsx(O,{className:"w-5 h-5 text-primary"}),t("comp.badgesTitle")]})}),e.jsxs(T,{children:[c?(ce||[]).length===0?e.jsxs("div",{className:"text-center py-8 space-y-3",children:[e.jsx(O,{className:"w-12 h-12 mx-auto text-muted-foreground/30"}),e.jsx("p",{className:"text-muted-foreground",children:t("comp.noBadges")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("comp.noBadgesDesc")})]}):e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:(ce||[]).map(a=>{const s=ge[a.badge_type]||ge.first_win,d=s.icon;return e.jsxs("div",{className:`p-4 rounded-lg text-center ${s.bg}`,children:[e.jsx(d,{className:`w-8 h-8 mx-auto mb-2 ${s.color}`}),e.jsx("div",{className:"font-medium text-sm",children:a.badge_name}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:a.badge_description})]},a.id)})}):e.jsx("p",{className:"text-center text-muted-foreground py-8",children:t("comp.loginRequired")}),e.jsxs("div",{className:"mt-8 pt-6 border-t",children:[e.jsx("h3",{className:"font-medium mb-4 text-sm text-muted-foreground",children:t("comp.allBadges")}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:Object.entries(ge).map(([a,s])=>{const d=s.icon,m=(ce||[]).some(o=>o.badge_type===a);return e.jsxs("div",{className:`p-3 rounded-lg text-center border ${m?s.bg:"opacity-40 grayscale"}`,children:[e.jsx(d,{className:`w-6 h-6 mx-auto mb-1 ${m?s.color:"text-muted-foreground"}`}),e.jsx("div",{className:"text-xs font-medium",children:t(`comp.badge.${a}`)})]},a)})})]})]})]})})]})})}),e.jsx(Ta,{language:n,isRTL:R})]})};export{Ha as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.