PageSourceSearch

https://hertzai.com/static/js/8603.3d27a39b.chunk.js

js hertzai.com collected 2026-09-24 13:35:24 UTC 6,704 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkhevolve=self.webpackChunkhevolve||[]).push([[8603],{58603(e,t,n){n.r(t),n.d(t,{default:()=>g});var r=n(89379),o=n(65043),l=n(96446),i=n(85865),s=n(10611),a=n(56258),c=n(86328),u=n(11906),d=n(64583),x=n(70579);const h=[d.yC.blue,d.yC.pink,d.yC.orange,d.yC.secondary,d.yC.purple,d.yC.yellow,d.yC.correct,d.yC.primaryLight];function g(e){var t,n,g,f;let{config:p,onAnswer:m,onComplete:y}=e;const C=null!==(t=null===p||void 0===p||null===(n=p.content)||void 0===n?void 0:n.questions)&&void 0!==t?t:[],b=C.length,[v,A]=(0,o.useState)(0),[k,j]=(0,o.useState)(0),[S,w]=(0,o.useState)([]),[I,R]=(0,o.useState)(0),[M,L]=(0,o.useState)(0),[W,T]=(0,o.useState)(null),[z,B]=(0,o.useState)(null),[D,E]=(0,o.useState)([]),[P,X]=(0,o.useState)(null),[q,F]=(0,o.useState)(!0),[H,N]=(0,o.useState)(0),U=(0,o.useRef)(Date.now()),G=(0,o.useRef)(null),J=(0,o.useRef)([]),K=(0,o.useRef)([]),[O,Q]=(0,o.useState)([]),V=null!==(g=C[v])&&void 0!==g?g:{pairs:[]},Y=null!==(f=V.pairs)&&void 0!==f?f:[],Z=(0,o.useMemo)(()=>function(e){const t=[...e];for(let n=t.length-1;n>0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t}(Y.map((e,t)=>t)),[v,Y.length]);(0,o.useEffect)(()=>{U.current=Date.now(),F(!0),T(null),B(null),E([]),X(null),N(0)},[v]),(0,o.useEffect)(()=>{const e=()=>{if(!G.current)return;const e=G.current.getBoundingClientRect(),t=D.map(t=>{const n=J.current[t.leftIdx],r=K.current[t.rightIdx];if(!n||!r)return null;const o=n.getBoundingClientRect(),l=r.getBoundingClientRect();return{x1:o.right-e.left,y1:o.top+o.height/2-e.top,x2:l.left-e.left,y2:l.top+l.height/2-e.top,color:t.color}}).filter(Boolean);Q(t)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[D]);const $=(0,o.useCallback)((e,t)=>{var n,r,o,l,i;const s=Date.now()-U.current,a=(null===(n=Y[e])||void 0===n||n.left,(null!==(r=null===(o=Y[Z[t]])||void 0===o?void 0:o.right)&&void 0!==r?r:"")===(null===(l=Y[e])||void 0===l?void 0:l.right)),c=null!==(i=V.concept)&&void 0!==i?i:"";if(a){const n=h[D.length%h.length],r=[...D,{leftIdx:e,rightIdx:t,color:n}];E(r);const o=H+1;N(o);const l=I+1;if(R(l),L(e=>Math.max(e,l)),m&&m(!0,c,s),r.length===Y.length){const e=k+o;j(e);const t={questionIndex:v,pairsMatched:o,totalPairs:Y.length,isCorrect:!0,concept:c,responseTimeMs:s},n=[...S,t];w(n),setTimeout(()=>{F(!1),setTimeout(()=>{v+1<b?A(e=>e+1):y&&y({score:e,correct:e,total:C.reduce((e,t)=>{var n,r;return e+(null!==(n=null===(r=t.pairs)||void 0===r?void 0:r.length)&&void 0!==n?n:0)},0),results:n,bestStreak:Math.max(M,l)})},250)},800)}}else R(0),X({leftIdx:e,rightIdx:t}),m&&m(!1,c,s),setTimeout(()=>X(null),700);T(null),B(null)},[Y,Z,D,H,I,M,k,S,v,b,C,V.concept,m,y]),_=(0,o.useCallback)(e=>{D.some(t=>t.leftIdx===e)||(T(e),null!==z&&$(e,z))},[D,z,$]),ee=(0,o.useCallback)(e=>{D.some(t=>t.rightIdx===e)||(B(e),null!==W&&$(W,e))},[D,W,$]);if(!C.length||!Y.length)return(0,x.jsx)(l.A,{sx:{p:4,textAlign:"center"},children:(0,x.jsx)(i.A,{color:d.yC.textSecondary,children:"No matching pairs available."})});const te=v/b*100,ne=(e,t,n)=>{const o="left"===e,l=o?W===t:z===t,i=o?D.find(e=>e.leftIdx===t):D.find(e=>e.rightIdx===t),s=P&&(o?P.leftIdx===t:P.rightIdx===t),a=o?d.yC.blue:d.yC.pink,c={width:"100%",py:{xs:1.4,sm:1.8},px:2,borderRadius:"14px",fontWeight:600,fontSize:{xs:"0.85rem",sm:"0.95rem"},textTransform:"none",border:"2px solid",borderColor:"".concat(a,"44"),color:d.yC.textPrimary,background:"".concat(a,"10"),transition:"all 0.3s cubic-bezier(0.4,0,0.2,1)",justifyContent:"center",textAlign:"center",lineHeight:1.3,"&:hover":{background:"".concat(a,"25"),borderColor:a,transform:"scale(1.03)"}};return i?(0,r.A)((0,r.A)({},c),{},{borderColor:i.color,background:"".concat(i.color,"20"),opacity:.7,pointerEvents:"none",boxShadow:"0 0 12px ".concat(i.color,"30")}):s?(0,r.A)((0,r.A)({},c),{},{borderColor:d.yC.incorrect,background:d.yC.incorrectBg,animation:"shake 0.4s ease-in-out","@keyframes shake":{"0%, 100%":{transform:"translateX(0)"},"20%":{transform:"translateX(-5px)"},"40%":{transform:"translateX(5px)"},"60%":{transform:"translateX(-3px)"},"80%":{transform:"translateX(3px)"}}}):l?(0,r.A)((0,r.A)({},c),{},{borderColor:d.yC.primary,background:"".concat(d.yC.primary,"25"),boxShadow:d.yC.glowPrimary,transform:"scale(1.04)"}):c};return(0,x.jsxs)(l.A,{sx:(0,r.A)({width:"100%",maxWidth:640,mx:"auto",p:{xs:2,sm:3}}
1,d.hh.fadeInUp),children:[(0,x.jsxs)(l.A,{sx:{mb:2},children:[(0,x.jsx)(s.A,{variant:"determinate",value:te,sx:{height:8,borderRadius:4,bgcolor:d.yC.surfaceLight,"& .MuiLinearProgress-bar":{borderRadius:4,background:d.yC.gradientPrimary}}}),(0,x.jsxs)(l.A,{sx:{display:"flex",justifyContent:"space-between",mt:.5},children:[(0,x.jsxs)(i.A,{variant:"caption",sx:{color:d.yC.textMuted},children:["Round ",v+1," / ",b]}),(0,x.jsxs)(i.A,{variant:"caption",sx:{color:d.yC.primaryLight,fontWeight:600},children:["Matched: ",D.length," / ",Y.length]})]})]}),V.concept&&(0,x.jsx)(a.A,{in:q,timeout:300,children:(0,x.jsx)(i.A,{variant:"overline",sx:{color:d.yC.primaryLight,letterSpacing:1.5,fontSize:"0.7rem",mb:1.5,display:"block",textAlign:"center"},children:V.concept})}),(0,x.jsx)(a.A,{in:q,timeout:350,children:(0,x.jsx)(i.A,{variant:"body2",sx:{color:d.yC.textSecondary,textAlign:"center",mb:2,fontWeight:500},children:"Tap one item on each side to match them"})}),(0,x.jsxs)(l.A,{ref:G,sx:{position:"relative",mb:3},children:[(0,x.jsx)("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:1},children:O.map((e,t)=>(0,x.jsx)("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.color,strokeWidth:2.5,strokeLinecap:"round",strokeDasharray:"6 4",opacity:.7},t))}),(0,x.jsxs)(l.A,{sx:{display:"flex",gap:{xs:2,sm:4}},children:[(0,x.jsx)(l.A,{sx:{flex:1,display:"flex",flexDirection:"column",gap:1.5},children:Y.map((e,t)=>(0,x.jsx)(c.A,{in:q,timeout:300+80*t,children:(0,x.jsx)(u.A,{ref:e=>J.current[t]=e,variant:"outlined",onClick:()=>_(t),sx:ne("left",t),children:e.left})},"l-".concat(t)))}),(0,x.jsx)(l.A,{sx:{flex:1,display:"flex",flexDirection:"column",gap:1.5},children:Z.map((e,t)=>(0,x.jsx)(c.A,{in:q,timeout:300+80*t,children:(0,x.jsx)(u.A,{ref:e=>K.current[t]=e,variant:"outlined",onClick:()=>ee(t),sx:ne("right",t),children:Y[e].right})},"r-".concat(t)))})]})]}),D.length===Y.length&&(0,x.jsx)(a.A,{in:!0,timeout:400,children:(0,x.jsx)(l.A,{sx:(0,r.A)({textAlign:"center",animation:"celebrate 0.8s ease-in-out"},d.hh.celebrate),children:(0,x.jsx)(i.A,{variant:"h5",sx:{fontWeight:800,background:d.yC.gradientCelebration,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"All matched!"})})})]})}}}]);
2//# sourceMappingURL=8603.3d27a39b.chunk.js.map

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.