PageSourceSearch

https://cdn.ciclismoaldia.es/_next/static/chunks/876-e68d5e79e1b4e80c.js

js ciclismoaldia.es collected 2026-10-02 19:25:25 UTC 25,708 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[876],{29205:(e,t,r)=>{r.d(t,{A:()=>s});var a=r(95155);r(12115);var i=r(32547),n=r(54749);let s=e=>{let{entry:t,isMe:r=!1,variant:s="full"}=e,l=(0,n.D4)(t.rank),o=(0,n.mV)(t.rank);return(0,a.jsxs)("div",{className:"quiz-leaderboard-row ".concat(l," ").concat(r?"quiz-leaderboard-row-me bg-primary/5 ring-1 ring-primary/30":""," flex items-center gap-3 ").concat("mini"===s?"py-2 px-3":"py-3 px-4"," text-sm"),children:[(0,a.jsx)("div",{className:"w-10 flex-shrink-0 text-center font-semibold",children:o?(0,a.jsx)("span",{"aria-label":"".concat((0,i.p)("pages:quiz.col_rank")," ").concat(t.rank),children:o}):(0,a.jsx)("span",{children:t.rank})}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[t.user.avatar?(0,a.jsx)("img",{src:t.user.avatar,alt:"",loading:"lazy",width:32,height:32,className:"h-8 w-8 flex-shrink-0 rounded-full object-cover"}):(0,a.jsx)("span",{className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-gray-200 text-xs font-semibold text-gray-700 dark:bg-zinc-700 dark:text-gray-200",children:(0,n.yC)(t.user)}),(0,a.jsx)("span",{className:"truncate",children:(0,n.QC)(t.user)}),r&&(0,a.jsx)("span",{className:"ml-1 inline-flex items-center rounded bg-primary px-1.5 py-0.5 text-[10px] font-semibold text-white",children:(0,i.p)("pages:quiz.you_badge")})]}),(0,a.jsxs)("div",{className:"w-16 flex-shrink-0 text-right font-semibold tabular-nums",children:[t.score,"/",t.total_points]}),(0,a.jsx)("div",{className:"w-16 flex-shrink-0 text-right font-mono tabular-nums text-gray-600 dark:text-gray-400",children:(0,n.a3)(t.duration)})]})}},50876:(e,t,r)=>{r.r(t),r.d(t,{QuizClientWrapper:()=>M,default:()=>C});var a=r(95155),i=r(34786),n=r(12115),s=r(82322),l=r(49499),o=r(32547),d=r(52619),c=r.n(d),u=r(54749);let m=e=>{let{quizSlug:t,attempt:r,onViewBreakdown:i}=e;return(0,a.jsxs)("div",{className:"quiz-already-attempted rounded border border-primary/40 bg-gray-50 p-4 dark:bg-zinc-800",children:[(0,a.jsx)("p",{className:"mb-1 text-sm font-semibold text-gray-900 dark:text-white",children:(0,o.p)("pages:quiz.already_taken")}),(0,a.jsxs)("p",{className:"mb-3 text-sm text-gray-700 dark:text-gray-300",children:[(0,o.p)("pages:quiz.score_label")," ",(0,a.jsxs)("span",{className:"font-semibold",children:[r.score,"/",r.total_points]}),null!==r.duration&&(0,a.jsxs)(a.Fragment,{children:[" \xb7 ",(0,o.p)("pages:quiz.finished_in").replace("{time}",(0,u.a3)(r.duration))]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:i,className:"rounded border border-primary px-4 py-2 text-sm font-semibold text-primary",children:(0,o.p)("pages:quiz.view_result")}),(0,a.jsx)(c(),{href:"/quiz/".concat(t,"/leaderboard"),className:"rounded bg-primary px-4 py-2 text-sm font-semibold text-white",children:(0,o.p)("pages:quiz.view_leaderboard")})]})]})};var p=r(29205);let x=e=>{let{quizSlug:t}=e,[r,s]=(0,n.useState)(null),[l,d]=(0,n.useState)(null),[u,m]=(0,n.useState)(!0),[x,h]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{let e=!1;return Promise.all([(0,i.to)(t,1,10),(0,i.j_)(t)]).then(t=>{let[r,a]=t;if(!e)if(r){var i;s(r),d(null!=(i=null==a?void 0:a.data)?i:null)}else h(!0)}).catch(()=>{e||h(!0)}).finally(()=>{e||m(!1)}),()=>{e=!0}},[t]),x)?null:(0,a.jsxs)("div",{className:"quiz-mini-leaderboard mt-5 rounded border border-gray-200 dark:border-zinc-700",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-gray-200 px-4 py-2 dark:border-zinc-700",children:[(0,a.jsx)("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:(0,o.p)("pages:quiz.leaderboard")}),(0,a.jsx)(c(),{href:"/quiz/".concat(t,"/leaderboard"),className:"text-xs font-medium text-primary",children:(0,o.p)("pages:quiz.view_full")})]}),u&&(0,a.jsx)("div",{className:"divide-y divide-gray-100 dark:divide-zinc-700",children:[0,1,2,3,4].map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2","aria-hidden":"true",children:[(0,a.jsx)("div",{className:"h-4 w-6 animate-pulse rounded bg-gray-200 dark:bg-zinc-700"}),(0,a.jsx)("div",{className:"h-8 w-8 animate-pulse rounded-full bg-gray-200 dark:bg-zinc-700"}),(0,a.jsx)("div",{className:"h-4 flex-1 animate-pulse rounded bg-gray-200 dark:bg-zinc-700"}),(0,a.jsx)("div",{className:"h-4 w-10 animate-pulse rounded bg-gray-200 dark:bg-zinc-700"}),(0,a.jsx)("div",{className:"h-4 w-10 animate-pulse rounded bg-gray-200 dark:bg-zinc-700"})]},e))}),!u&&r&&0===r.data.length&&(0,a.jsx)("p",{className:"px-4 py-6 text-center text-sm text-gray-500 dark:text-gray-400",children:(0,o.p)("pages:quiz.no_attempts")}),!u&&r&&r.data.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"divide-y divide-gray-100 dark:divide-zinc-700",children:r.data.slice(0,5).map(e=>(0,a.jsx)(p.A,{entry:e,variant:"mini",isMe:e.user.id===(null==l?void 0:l.user.id)},"".concat(e.rank,"-").concat(e.user.id)))}),l&&l.rank>5&&(0,a.jsx)("div",{className:"border-t-2 border-dashed border-gray-200 dark:border-zinc-700",children:(0,a.jsx)(p.A,{entry:l,variant:"mini",isMe:!0})})]})]})},h=new s.L("https://r.testifier.nl"),g=e=>"quiz-".concat(e),b=e=>"quiz-".concat(e,"-started"),f=e=>"quiz-".concat(e,"-pending"),y=e=>{try{window.localStorage.removeItem(f(e))}catch(e){}},z=e=>{if(!e)return null;try{let t=atob(e),r=parseInt(t,10);return Number.isNaN(r)?null:r}catch(e){return null}},w=e=>{let{image:t,width:r,className:i}=e;if(!(null==t?void 0:t.origin_url))return null;let n=h.resize(t.origin_url,{w:r,resizing_type:"fit"}),s=Math.round(9*r/16);return(0,a.jsx)("img",{src:n,alt:t.alt_text||t.caption||"",loading:"lazy",width:r,height:s,className:i})},k=e=>{let{score:t,total:r}=e,i=2*Math.PI*65,s=r>
10?t/r:0,[l,o]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=window.requestAnimationFrame(()=>o(!0));return()=>window.cancelAnimationFrame(e)},[]);let d=l?i*(1-s):i;return(0,a.jsxs)("div",{className:"quiz-score-ring relative inline-flex items-center justify-center",style:{width:140,height:140},children:[(0,a.jsxs)("svg",{width:140,height:140,viewBox:"0 0 ".concat(140," ").concat(140),style:{transform:"rotate(-90deg)"},"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:70,cy:70,r:65,fill:"none",stroke:"currentColor",strokeOpacity:.12,strokeWidth:10}),(0,a.jsx)("circle",{cx:70,cy:70,r:65,fill:"none",stroke:"currentColor",strokeWidth:10,strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:d,style:{transition:"stroke-dashoffset 800ms ease-out"}})]}),(0,a.jsx)("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:(0,a.jsxs)("span",{className:"text-3xl font-bold leading-none",children:[t,(0,a.jsxs)("span",{className:"text-lg font-normal text-gray-500 dark:text-gray-400",children:[" / ",r]})]})})]})},j=e=>{let{quizName:t,quizSlug:r,score:i,total:s}
1=e,[l,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(!1);(0,n.useEffect)(()=>{d("".concat(window.location.origin,"/quiz/").concat(r))},[r]);let m=(0,o.p)("pages:quiz.share_text").replace("{score}",String(i)).replace("{total}",String(s)).replace("{name}",t),p="".concat(m," ").concat(l),x=encodeURIComponent,h="https://wa.me/?text=".concat(x(p)),g="https://twitter.com/intent/tweet?text=".concat(x(m),"&url=").concat(x(l)),b="https://www.facebook.com/sharer/sharer.php?u=".concat(x(l),"&quote=").concat(x(m)),f=async()=>{try{await navigator.clipboard.writeText(p),u(!0),window.setTimeout(()=>u(!1),1500)}catch(e){}},y="quiz-share-btn inline-flex h-10 w-10 items-center justify-center rounded-full border border-gray-300 text-gray-700 transition-colors hover:bg-gray-100 dark:border-zinc-700 dark:text-gray-300 dark:hover:bg-zinc-800";return(0,a.jsxs)("div",{className:"quiz-share mt-4",children:[(0,a.jsx)("p",{className:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:(0,o.p)("pages:quiz.share_result")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("a",{href:h,target:"_blank",rel:"noopener noreferrer","aria-label":(0,o.p)("pages:quiz.share_whatsapp"),className:y,children:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.jsx)("path",{d:"M20.52 3.48A11.77 11.77 0 0 0 12.06 0C5.5 0 .17 5.33.17 11.9c0 2.1.55 4.14 1.6 5.94L0 24l6.32-1.66a11.9 11.9 0 0 0 5.74 1.46h.01c6.56 0 11.9-5.33 11.9-11.9 0-3.18-1.24-6.17-3.45-8.42Zm-8.46 18.3a9.84 9.84 0 0 1-5.01-1.37l-.36-.21-3.75.98 1-3.65-.23-.37a9.82 9.82 0 0 1-1.5-5.26c0-5.45 4.43-9.88 9.88-9.88 2.64 0 5.12 1.03 6.98 2.9a9.78 9.78 0 0 1 2.89 6.99c0 5.45-4.43 9.87-9.9 9.87Zm5.42-7.4c-.3-.15-1.76-.87-2.03-.97-.27-.1-.47-.15-.67.15s-.77.96-.95 1.16c-.17.2-.34.22-.64.07-.3-.15-1.26-.46-2.4-1.48-.88-.79-1.48-1.76-1.65-2.06-.17-.3-.02-.47.13-.62.13-.13.3-.34.45-.52.15-.17.2-.3.3-.5.1-.2.05-.37-.02-.52-.07-.15-.67-1.62-.92-2.22-.24-.58-.48-.5-.67-.51h-.57c-.2 0-.52.08-.8.37-.27.3-1.05 1.02-1.05 2.49 0 1.47 1.07 2.88 1.22 3.08.15.2 2.11 3.23 5.12 4.52.72.31 1.28.5 1.71.63.72.23 1.37.2 1.88.12.57-.09 1.76-.72 2.01-1.42.25-.7.25-1.29.18-1.42-.07-.12-.27-.2-.57-.35Z"})})}),(0,a.jsx)("a",{href:g,target:"_blank",rel:"noopener noreferrer","aria-label":(0,o.p)("pages:quiz.share_x"),className:y,children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.jsx)("path",{d:"M18.244 2H21.5l-7.5 8.57L22.5 22h-6.93l-4.86-6.47L5.05 22H1.79l8.02-9.17L1.5 2h7.1l4.39 5.94L18.244 2Zm-1.22 18.2h1.88L7.06 3.74H5.06l11.96 16.46Z"})})}),(0,a.jsx)("a",{href:b,target:"_blank",rel:"noopener noreferrer","aria-label":(0,o.p)("pages:quiz.share_facebook"),className:y,children:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.jsx)("path",{d:"M13.5 22v-8h2.7l.4-3.1h-3.1V8.9c0-.9.25-1.5 1.55-1.5H16.7V4.6c-.3-.05-1.34-.13-2.55-.13-2.52 0-4.25 1.54-4.25 4.37V11H7.3v3.1h2.6V22h3.6Z"})})}),(0,a.jsx)("button",{type:"button",onClick:f,"aria-label":(0,o.p)("pages:quiz.copy_link"),className:y,children:c?(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M5 12l5 5L20 7"})}):(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),(0,a.jsx)("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]})})]})]})},v=e=>{let{percent:t,low:r}=e,i=2*Math.PI*9.5,n=i*(1-Math.max(0,Math.min(100,t))/100);return(0,a.jsxs)("svg",{className:"quiz-timer-ring",width:22,height:22,viewBox:"0 0 ".concat(22," ").concat(22),style:{transform:"rotate(-90deg)"},"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:11,cy:11,r:9.5,fill:"none",stroke:"currentColor",strokeOpacity:.15,strokeWidth:3}),(0,a.jsx)("circle",{cx:11,cy:11,r:9.5,fill:"none",stroke:r?"#ef4444":"currentColor",strokeWidth:3,strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:n,style:{transition:"stroke-dashoffset 1000ms linear, stroke 200ms ease-out"}})]})},q=e=>{try{window.sessionStorage.removeItem(g(e)),window.sessionStorage.removeItem(b(e))}catch(e){}},N=e=>{let t=Math.max(0,Math.floor(e)),r=Math.floor(t/60);return"".concat(r,":").concat((t%60).toString().padStart(2,"0"))},_=(0,a.jsx)("style",{children:"\n    @keyframes quiz-fade-in {\n      from { opacity: 0; }\n      to   { opacity: 1; }\n    }\n    @keyframes quiz-slide-in {\n      from { opacity: 0; transform: translateY(8px); }\n      to   { opacity: 1; transform: translateY(0); }\n    }\n    @keyframes quiz-timer-pulse {\n      0%, 100% { opacity: 1; }\n      50%      { opacity: 0.55; }\n    }\n    .quiz-anim-fade   { animation: quiz-fade-in 200ms ease-out both; }\n    .quiz-anim-slide  { animation: quiz-slide-in 250ms ease-out both; }\n    .quiz-timer-pulse { animation: quiz-timer-pulse 900ms ease-in-out infinite; }\n    @media (prefers-reduced-motion: reduce) {\n      .quiz-anim-fade, .quiz-anim-slide, .quiz-timer-pulse { animation: none; }\n    }\n  "}),S=e=>{let{quiz:t}=e,r=(0,l.Z2)(),s=!!(null==r?void 0:r.userData),d=()=>{var e;return null==r||null==(e=r.setShowAuthModal)?void 0:e.call(r,!0)},c=(0,n.useMemo)(()=>[...t.questions].sort((e,t)=>
1e.order-t.order),[t.questions]),u=Number.isFinite(t.duration)&&t.duration>0?t.duration:0,p=u>0,[h,S]=(0,n.useState)("intro"),[M,C]=(0,n.useState)({}),[I,L]=(0,n.useState)(0),[A,B]=(0,n.useState)(u),[D,W]=(0,n.useState)(!1),[E,V]=(0,n.useState)(!1),[O,F]=(0,n.useState)(null),[Z,T]=(0,n.useState)(null),[H,J]=(0,n.useState)(!1),[R,P]=(0,n.useState)(!1),[Q,$]=(0,n.useState)(null),[U,Y]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=(e=>{try{let t=window.sessionStorage.getItem(g(e));if(!t)return{};let r=JSON.parse(t);if(!r||"object"!=typeof r||Array.isArray(r))return{};return r}catch(e){return{}}})(t.id);if(0===Object.keys(e).length)return;if(C(e),c.every(t=>void 0!==e[t.id]))return void q(t.id);let r=c.findIndex(t=>void 0===e[t.id]);L(r>=0?r:0),B(u);let a=(e=>{try{let t=window.sessionStorage.getItem(b(e)),r=t?parseInt(t,10):NaN;return Number.isFinite(r)?r:null}catch(e){return null}})(t.id);F(null!=a?a:Date.now()),S("playing")},[t.id,c,u]),(0,n.useEffect)(()=>{if(!s)return;let e=(e=>{try{let t=window.localStorage.getItem(f(e));if(!t)return null;let r=JSON.parse(t);if(!r||"object"!=typeof r||"number"!=typeof r.attemptId||"number"!=typeof r.score||"number"!=typeof r.total)return null;return r}catch(e){return null}})(t.id);if(!e)return;let r=!1;return(async()=>{let a=await (0,i.J$)(e.attemptId);if(!r){if(a&&"ok"in a){var n;let a=await (0,i.$m)([t.id]);if(r)return;let s=null==a||null==(n=a.data)?void 0:n.find(e=>e.quiz_id===t.id);s?$({score:s.score,total:s.total_points}):$({score:e.score,total:e.total}),y(t.id)}else a&&"alreadyAttempted"in a?y(t.id):null===a&&(Y(!0),y(t.id));S("results"),T(e=>null!=e?e:Date.now())}})(),()=>{r=!0}},[s,t.id]);let G=c[I],K=(0,n.useMemo)(()=>G?[...G.answers].sort((e,t)=>e.order-t.order):[],[G]),X=(0,n.useMemo)(()=>G?z(G.correct_answer_id):null,[G]),ee=I===c.length-1,et=void 0!==G?M[G.id]:void 0,er=void 0!==et,ea=er&&et===X,ei=(0,n.useRef)(ee);ei.current=ee;let en=(0,n.useRef)(!1),es=async e=>{if(en.current)return;en.current=!0;let r=Date.now();T(r),q(t.id);let a=null!==O?Math.max(1,Math.round((r-O)/1e3)):null,n=c.filter(t=>void 0!==e[t.id]).map(t=>({question_id:t.id,answer_id:e[t.id]}));V(!0);let l=await (0,i.VS)(t.slug,{answers:n,duration:a});V(!1),l&&"data"in l?($({score:l.data.score,total:l.data.total_points}),s||((e,t)=>{try{window.localStorage.setItem(f(e),JSON.stringify(t))}catch(e){}})(t.id,{attemptId:l.data.id,score:l.data.score,total:l.data.total_points})):l&&"alreadyAttempted"in l||null===l&&Y(!0),S("results")},el=(0,n.useRef)(M);el.current=M,(0,n.useEffect)(()=>{if("playing"!==h||!p||er||D)return;let e=window.setInterval(()=>{B(t=>t<=1?(window.clearInterval(e),window.setTimeout(()=>(()=>{if(ei.current)return void es(el.current);L(e=>e+1),B(u)})(),0),0):t-1)},1e3);return()=>window.clearInterval(e)},[h,p,er,D,I]);let eo=(0,n.useMemo)(()=>c.reduce((e,t)=>{let r=z(t.correct_answer_id);return null!==r&&M[t.id]===r?e+1:e},0),[c,M]);if(0===c.length)return null;let ed=u>0?Math.max(1,Math.ceil(u*c.length/60)):0;if("intro"===h)return(0,a.jsxs)("div",{className:"quiz-block quiz-intro quiz-anim-fade my-6 rounded border border-gray-200 bg-white p-5 dark:border-zinc-700 dark:bg-zinc-900",children:[_,t.cover_image&&(0,a.jsx)(w,{image:t.cover_image,width:1600,className:"quiz-cover mb-3 w-full rounded"}),(0,a.jsx)("h3",{className:"quiz-title mb-1 text-xl font-semibold",children:t.name}),t.description&&(0,a.jsx)("p",{className:"quiz-description mb-3 text-gray-600 dark:text-gray-400",children:t.description}),(ed>0||void 0!==t.players_count&&t.players_count>10)&&(0,a.jsx)("p",{className:"quiz-estimate mb-4 text-sm text-gray-500 dark:text-gray-400",children:[(0,o.p)("pages:quiz.questions_count").replace("{n}",String(c.length)),ed>0?(0,o.p)("pages:quiz.estimated_time").replace("{n}",String(ed)):null,void 0!==t.players_count&&t.players_count>10?(0,o.p)("pages:quiz.players_count").replace("{n}",t.players_count.toLocaleString()):null].filter(Boolean).join(" \xb7 ")}),!s&&!t.user_attempt&&(0,a.jsxs)("p",{className:"quiz-auth-hint mb-4 text-sm text-gray-500 dark:text-gray-400",children:[(0,a.jsx)("button",{type:"button",onClick:d,className:"quiz-auth-hint-link text-primary underline underline-offset-2 hover:no-underline",children:(0,o.p)("pages:quiz.log_in")})," ",(0,o.p)("pages:quiz.compete_hint")]}),s&&t.user_attempt?(0,a.jsx)(m,{quizSlug:t.slug,attempt:t.user_attempt,onViewBreakdown:()=>{P(!0),T(null),S("results")}}):(0,a.jsx)("button",{type:"button",onClick:()=>{let e=Date.now();S("playing"),L(0),C({}),B(u),W(!1),F(e),T(null),J(!1),$(null),Y(!1),en.current=!1,q(t.id);var r=t.id;try{window.sessionStorage.setItem(b(r),e.toString())}catch(e){}},className:"quiz-start rounded bg-primary px-6 py-2 font-semibold text-white",children:(0,o.p)("pages:quiz.start")})]});if("results"===h){var ec,eu,em,ep;let e=R?t.user_attempt:null,r=null!=(eu=null!=(ec=null==e?void 0:e.total_points)?e
1c:null==Q?void 0:Q.total)?eu:c.length,i=null!=(ep=null!=(em=null==e?void 0:e.score)?em:null==Q?void 0:Q.score)?ep:eo,n=(null==e?void 0:e.duration)?1e3*e.duration:null!==O&&null!==Z?Z-O:null,l=((e,t)=>t<=0?"":e===t?(0,o.p)("pages:quiz.perfect_score"):e===t-1?(0,o.p)("pages:quiz.great_job"):e>=Math.ceil(t/2)?(0,o.p)("pages:quiz.not_bad"):(0,o.p)("pages:quiz.better_luck"))(i,r);return(0,a.jsxs)("div",{className:"quiz-block quiz-anim-fade my-6 rounded border border-gray-200 bg-white p-5 dark:border-zinc-700 dark:bg-zinc-900",children:[_,(0,a.jsxs)("div",{className:"quiz-submitted quiz-anim-slide flex flex-col items-center rounded bg-gray-50 p-6 text-center text-primary dark:bg-zinc-800",children:[(0,a.jsx)(k,{score:i,total:r}),(0,a.jsx)("p",{className:"quiz-score-label mt-4 text-xl font-semibold text-gray-900 dark:text-white",children:l}),null!==n&&(0,a.jsx)("p",{className:"quiz-finished-time mt-1 text-sm text-gray-500 dark:text-gray-400",children:(0,o.p)("pages:quiz.finished_in").replace("{time}",(e=>{let t=Math.max(0,Math.floor(e/1e3)),r=Math.floor(t/60);return"".concat(r,":").concat((t%60).toString().padStart(2,"0"))})(n))})]}),U&&(0,a.jsx)("div",{className:"quiz-save-error mt-3 rounded border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-800 dark:bg-red-900/30 dark:text-red-300",children:(0,o.p)("pages:quiz.save_error")}),s&&(0,a.jsx)(x,{quizSlug:t.slug}),!s&&(0,a.jsxs)("div",{className:"quiz-cta mt-5 rounded border border-primary bg-gray-50 p-4 text-center dark:bg-zinc-800",children:[(0,a.jsx)("p",{className:"mb-3 text-sm text-gray-700 dark:text-gray-300",children:(0,o.p)("pages:quiz.cta_create_account")}),(0,a.jsx)("button",{type:"button",onClick:d,className:"quiz-cta-auth rounded bg-primary px-5 py-2 text-sm font-semibold text-white",children:(0,o.p)("pages:quiz.cta_sign_up")})]}),!R&&(0,a.jsxs)("div",{className:"quiz-breakdown mt-5",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>J(e=>!e),className:"quiz-breakdown-toggle flex w-full items-center justify-between rounded border border-gray-200 px-3 py-2 text-left text-sm font-medium dark:border-zinc-700 dark:text-gray-200","aria-expanded":H,children:[(0,a.jsx)("span",{children:H?(0,o.p)("pages:quiz.hide_breakdown"):(0,o.p)("pages:quiz.show_breakdown")}),(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:H?"rotate(180deg)":"rotate(0deg)",transition:"transform 200ms ease-out"},children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),H&&(0,a.jsx)("ol",{className:"quiz-breakdown-list quiz-anim-fade mt-3 space-y-3",children:c.map((e,t)=>{var r;let i=z(e.correct_answer_id),n=M[e.id],s=e.answers.find(e=>e.id===n),l=e.answers.find(e=>e.id===i),d=void 0!==n&&n===i;return(0,a.jsxs)("li",{className:"quiz-breakdown-item rounded border border-gray-200 p-3 text-sm dark:border-zinc-700",children:[(0,a.jsxs)("p",{className:"mb-2 font-medium",children:[t+1,". ",e.text]}),(0,a.jsxs)("p",{className:"quiz-breakdown-user ".concat(d?"text-green-700 dark:text-green-400":"text-red-700 dark:text-red-400"),children:[(0,o.p)("pages:quiz.your_answer")," ",(0,a.jsx)("span",{className:"font-semibold",children:null!=(r=null==s?void 0:s.text)?r:(0,o.p)("pages:quiz.unanswered")})," ",d?"✓":"✕"]}),!d&&l&&(0,a.jsxs)("p",{className:"quiz-breakdown-correct text-green-700 dark:text-green-400",children:[(0,o.p)("pages:quiz.correct_answer")," ",(0,a.jsx)("span",{className:"font-semibold",children:l.text})]}),e.explanation&&(0,a.jsx)("p",{className:"quiz-breakdown-explanation mt-1 text-gray-600 dark:text-gray-400",children:e.explanation})]},e.id)})})]}),!R&&(0,a.jsx)(j,{quizName:t.name,quizSlug:t.slug,score:i,total:r})]})}if(!G)return null;let ex="quiz-".concat(t.id,"-q-").concat(G.id),eh=p&&!er&&A>0&&A<=5,eg=p&&u>0?Math.max(0,Math.min(100,A/u*100)):0;return(0,a.jsxs)("div",{className:"quiz-block my-6 rounded border border-gray-200 bg-white p-5 dark:border-zinc-700 dark:bg-zinc-900",children:[_,(0,a.jsxs)("div",{className:"quiz-header mb-3 flex items-center justify-between gap-3",children:[(0,a.jsx)("h3",{className:"quiz-title text-base font-semibold",children:t.name}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-sm",children:[p&&(0,a.jsxs)("div",{role:"timer","aria-live":eh?"assertive":"off","aria-atomic":"true","aria-label":"".concat((0,o.p)("pages:quiz.timer_aria"),": ").concat(N(A)),className:"quiz-timer flex items-center gap-1.5 ".concat(eh?"quiz-timer-low quiz-timer-pulse":""),children:[(0,a.jsx)(v,{percent:eg,low:eh},G.id),(0,a.jsx)("span",{className:"font-mono tabular-nums ".concat(eh?"font-semibold text-red-600 dark:text-red-400":""),children:N(A)})]}),(0,a.jsxs)("span",{className:"quiz-counter text-gray-500 dark:text-gray-400",children:[I+1,"/",c.length]})]})]}),(0,a.jsx)("div",{className:"quiz-progress-bar mb-3 grid gap-1",
1style:{gridTemplateColumns:"repeat(".concat(c.length,", minmax(0, 1fr))")},children:c.map((e,t)=>{let r=t<=I;return(0,a.jsx)("div",{className:"quiz-progress-segment h-1 rounded transition-colors duration-300 ease-out ".concat(r?"quiz-progress-segment-filled bg-primary":"bg-gray-200 dark:bg-zinc-700")},e.id)})}),(0,a.jsxs)("div",{className:"quiz-anim-slide",children:[G.cover_image&&(0,a.jsx)(w,{image:G.cover_image,width:1200,className:"quiz-question-cover mb-3 w-full rounded"}),(0,a.jsxs)("div",{className:"quiz-question",children:[(0,a.jsx)("p",{className:"quiz-question-text mb-3 font-medium",children:G.text}),(0,a.jsx)("div",{className:"quiz-answers grid grid-cols-1 gap-2 sm:grid-cols-2",children:K.map(e=>{let r="".concat(ex,"-a-").concat(e.id),i=et===e.id,n="border-gray-300 dark:border-zinc-700",s="";return D&&i?ea?(n="border-green-500 bg-green-50 dark:border-green-700 dark:bg-green-900/30",s="quiz-answer-correct"):(n="border-red-500 bg-red-50 dark:border-red-700 dark:bg-red-900/30",s="quiz-answer-wrong"):i&&(n="border-primary bg-gray-50 ring-1 ring-primary dark:bg-zinc-800",s="quiz-answer-selected"),(0,a.jsxs)("label",{htmlFor:r,className:"quiz-answer ".concat(s," flex items-center gap-2 rounded border p-2 ").concat(n," ").concat(er||D?"cursor-default":"cursor-pointer"),children:[(0,a.jsx)("input",{id:r,type:"radio",name:ex,value:e.id,checked:i,disabled:er||D,onChange:()=>(e=>{if(er||D||!G)return;let r={...M,[G.id]:e};C(r);var a=t.id;try{window.sessionStorage.setItem(g(a),JSON.stringify(r))}catch(e){}W(!0),window.setTimeout(async()=>{if(ei.current){W(!1),await es(r);return}W(!1),L(e=>e+1),B(u)},1e3)})(e.id),className:"quiz-answer-input"}),(0,a.jsx)("span",{className:"flex-1",children:e.text}),D&&i&&(0,a.jsx)("span",{"aria-hidden":"true",className:"quiz-answer-icon quiz-anim-fade inline-flex h-5 w-5 items-center justify-center rounded-full text-xs font-bold text-white ".concat(ea?"bg-green-500":"bg-red-500"),children:ea?"✓":"✕"})]},e.id)})})]})]},G.id),E&&(0,a.jsxs)("div",{"aria-busy":"true","aria-live":"polite",className:"quiz-submitting mt-6 flex items-center justify-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,a.jsxs)("svg",{className:"h-4 w-4 animate-spin",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeOpacity:"0.3",strokeWidth:"3"}),(0,a.jsx)("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,o.p)("pages:quiz.saving")]})]})},M=e=>{var t;let{quiz:r}
1=e,[s,l]=(0,n.useState)(r);return((0,n.useEffect)(()=>{if(l(r),!(0,i.Tk)())return;let e=!1;return(async()=>{var t;let a=await (0,i.$m)([r.id]);if(e)return;let n=null==a||null==(t=a.data)?void 0:t.find(e=>e.quiz_id===r.id);n&&l({...r,user_attempt:n})})(),()=>{e=!0}},[r]),null==(t=s.questions)?void 0:t.length)?(0,a.jsx)(S,{quiz:s}):null},C=M},54749:(e,t,r)=>{r.d(t,{D4:()=>n,QC:()=>l,a3:()=>i,mV:()=>s,yC:()=>o});var a=r(32547);let i=e=>{if(null==e)return"—";let t=Math.max(0,Math.floor(e)),r=Math.floor(t/60);return"".concat(r,":").concat((t%60).toString().padStart(2,"0"))},n=e=>1===e?"quiz-leaderboard-row-top1 border-l-4 border-yellow-400":2===e?"quiz-leaderboard-row-top2 border-l-4 border-gray-400":3===e?"quiz-leaderboard-row-top3 border-l-4 border-amber-700":"border-l-4 border-transparent",s=e=>1===e?"\uD83E\uDD47":2===e?"\uD83E\uDD48":3===e?"\uD83E\uDD49":null,l=e=>e.name||e.username||(0,a.p)("pages:quiz.anonymous"),o=e=>{var t,r;let a=l(e).trim();if(!a)return"?";let i=a.split(/\s+/);return((null!=(r=null==(t=i[0])?void 0:t[0])?r:"")+(i.length>1?i[i.length-1][0]:"")).toUpperCase()||"?"}}}]);

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.