@jswork/react-questkit 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -96,6 +96,7 @@ __export(index_exports, {
96
96
  OptionItem: () => OptionItem,
97
97
  PictureBox: () => PictureBox,
98
98
  Progress: () => Progress,
99
+ QuestComplete: () => QuestComplete,
99
100
  QuestConfigProvider: () => QuestConfigProvider,
100
101
  QuestProvider: () => QuestConfigProvider,
101
102
  QuestShell: () => QuestShell,
@@ -424,6 +425,7 @@ function QuestShell({
424
425
  instructionVariant = "card",
425
426
  footer,
426
427
  feedback,
428
+ bare = false,
427
429
  dataQuest,
428
430
  className,
429
431
  children
@@ -433,28 +435,269 @@ function QuestShell({
433
435
  "div",
434
436
  {
435
437
  className: classNames(
436
- "rqk-shell relative isolate flex h-full w-full min-h-0 flex-col overflow-hidden bg-[var(--rqk-screen-bg)]",
438
+ "rqk-shell relative isolate flex w-full min-h-0 flex-col",
439
+ bare && "rqk-bare h-auto overflow-visible",
440
+ !bare && "h-full overflow-hidden",
441
+ "bg-[var(--rqk-screen-bg)]",
437
442
  className
438
443
  ),
439
444
  "data-component": "react-questkit",
440
445
  "data-mode": mode,
441
446
  "data-quest": dataQuest,
442
447
  children: [
443
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rqk-body relative flex min-h-0 flex-1 flex-col", children: [
444
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rqk-page", children: [
445
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Progress, { value: index, total }),
446
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Instruction, { variant: instructionVariant, children: instruction }),
447
- children
448
- ] }),
449
- feedback ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rqk-feedback-wrap pointer-events-none absolute inset-x-5 bottom-24 z-[4] [&>*]:pointer-events-auto", children: feedback }) : null,
450
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Toast, { align: toast == null ? void 0 : toast.align, children: toast == null ? void 0 : toast.message })
451
- ] }),
452
- footer ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rqk-footer absolute inset-x-0 bottom-0 z-[5] [background:linear-gradient(180deg,rgba(246,248,252,0)_0%,rgba(246,248,252,0.9)_32%,var(--rqk-screen-bg)_66%)]", children: footer }) : null
448
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
449
+ "div",
450
+ {
451
+ className: classNames(
452
+ "rqk-body relative flex min-h-0 flex-col",
453
+ !bare && "flex-1"
454
+ ),
455
+ children: [
456
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "rqk-page", children: [
457
+ !bare ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Progress, { value: index, total }) : null,
458
+ !bare ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Instruction, { variant: instructionVariant, children: instruction }) : null,
459
+ children
460
+ ] }),
461
+ feedback ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rqk-feedback-wrap pointer-events-none absolute inset-x-5 bottom-24 z-[4] [&>*]:pointer-events-auto", children: feedback }) : null,
462
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Toast, { align: toast == null ? void 0 : toast.align, children: toast == null ? void 0 : toast.message })
463
+ ]
464
+ }
465
+ ),
466
+ footer && !bare ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "rqk-footer absolute inset-x-0 bottom-0 z-[5] [background:linear-gradient(180deg,rgba(246,248,252,0)_0%,rgba(246,248,252,0.9)_32%,var(--rqk-screen-bg)_66%)]", children: footer }) : null
453
467
  ]
454
468
  }
455
469
  ) });
456
470
  }
457
471
 
472
+ // src/art/illustrations.tsx
473
+ var import_react3 = require("react");
474
+
475
+ // src/assets/svg/art-apple.svg
476
+ var art_apple_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#FF8A8A"></stop><stop offset="1" stop-color="#E5484D"></stop></linearGradient></defs><circle cx="57" cy="66" r="32" fill="url(#rqk-grad)"></circle><circle cx="72" cy="70" r="25" fill="url(#rqk-grad)" opacity="0.92"></circle><ellipse cx="47" cy="52" rx="7" ry="10" fill="#FFFFFF" opacity="0.4" transform="rotate(-24 47 52)"></ellipse><path d="M64 36c0-6 3-10 8-12" stroke="#8B5E34" stroke-width="3" stroke-linecap="round" fill="none"></path><path d="M68 34c2-8 12-11 20-7-2 8-12 11-20 7z" fill="#3ED598"></path></svg>\n';
477
+
478
+ // src/assets/svg/art-balloon.svg
479
+ var art_balloon_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0.2" y1="0" x2="0.8" y2="1"><stop offset="0" stop-color="#7FB0FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient></defs><ellipse cx="60" cy="50" rx="28" ry="32" fill="url(#rqk-grad)"></ellipse><ellipse cx="50" cy="38" rx="7" ry="9" fill="#FFFFFF" opacity="0.45"></ellipse><path d="M60 82l3 6h-6z" fill="#0147CC"></path><path d="M60 88c8 6-8 10 0 16s-8 8 0 12" stroke="#0147CC" stroke-width="2.2" fill="none" stroke-linecap="round"></path><circle cx="94" cy="30" r="4" fill="#FFD166"></circle><circle cx="22" cy="86" r="3" fill="#7C5CFF" opacity="0.6"></circle></svg>\n';
480
+
481
+ // src/assets/svg/art-books.svg
482
+ var art_books_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><rect x="20" y="80" width="80" height="16" rx="5" fill="#0158FD"></rect><rect x="26" y="62" width="68" height="16" rx="5" fill="#3ED598"></rect><rect x="22" y="44" width="72" height="16" rx="5" fill="#FFB020"></rect><rect x="32" y="26" width="58" height="16" rx="5" fill="#7C5CFF"></rect><path d="M34 34h54M28 52h60M32 70h56M26 88h68" stroke="#FFFFFF" stroke-width="2.4" opacity="0.35" stroke-linecap="round"></path><circle cx="88" cy="22" r="5" fill="#9CBFFF" opacity="0.7"></circle></svg>\n';
483
+
484
+ // src/assets/svg/art-cat.svg
485
+ var art_cat_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#FFC48A"></stop><stop offset="1" stop-color="#F09A4F"></stop></linearGradient></defs><path d="M36 42l-6-20 18 8zM84 42l6-20-18 8z" fill="url(#rqk-grad)"></path><circle cx="60" cy="66" r="34" fill="url(#rqk-grad)"></circle><ellipse cx="60" cy="82" rx="18" ry="13" fill="#FFF3E4"></ellipse><circle cx="48" cy="62" r="3.4" fill="#5B3A22"></circle><circle cx="72" cy="62" r="3.4" fill="#5B3A22"></circle><path d="M55 74h10l-5 5z" fill="#F08A8A"></path><path d="M56 83c1.6 1.8 6.4 1.8 8 0" stroke="#5B3A22" stroke-width="1.8" fill="none"></path><path d="M22 68h14M24 76h12M98 68h-14M96 76h-12" stroke="#E7C39F" stroke-width="2" stroke-linecap="round"></path></svg>\n';
486
+
487
+ // src/assets/svg/art-coffee.svg
488
+ var art_coffee_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#FFFFFF"></stop><stop offset="1" stop-color="#E7EEFA"></stop></linearGradient></defs><ellipse cx="58" cy="90" rx="34" ry="6" fill="#DCE6F7"></ellipse><path d="M30 50h50l-5 34c-.6 4-4 7-8 7H43c-4 0-7.4-3-8-7z" fill="url(#rqk-grad)"></path><path d="M80 58h6a9 9 0 010 18h-3" stroke="#C3D2E8" stroke-width="4" fill="none"></path><rect x="34" y="58" width="42" height="14" rx="4" fill="#D6E2F5"></rect><path d="M48 42c-4-7 4-9 0-16M62 42c-4-7 4-9 0-16" stroke="#9CBFFF" stroke-width="3" fill="none" stroke-linecap="round" opacity="0.8"></path><circle cx="88" cy="34" r="4" fill="#FFB020" opacity="0.7"></circle></svg>\n';
489
+
490
+ // src/assets/svg/art-headphones.svg
491
+ var art_headphones_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 186" fill="none" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad-a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#5C96FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient><linearGradient id="rqk-grad-b" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3D7BFF"></stop><stop offset="1" stop-color="#013AA6"></stop></linearGradient></defs><ellipse cx="120" cy="162" rx="48" ry="8" fill="#0B1220" opacity="0.07"></ellipse><path d="M62 112V94c0-32 26-56 58-56s58 24 58 56v18" stroke="url(#rqk-grad-a)" stroke-width="15" stroke-linecap="round"></path><path d="M62 112V94c0-32 26-56 58-56s58 24 58 56v18" stroke="#fff" stroke-width="4" stroke-linecap="round" opacity="0.35"></path><rect x="46" y="102" width="34" height="52" rx="17" fill="url(#rqk-grad-b)"></rect><rect x="160" y="102" width="34" height="52" rx="17" fill="url(#rqk-grad-b)"></rect><rect x="54" y="112" width="18" height="32" rx="9" fill="#fff" opacity="0.25"></rect><rect x="168" y="112" width="18" height="32" rx="9" fill="#fff" opacity="0.25"></rect><g stroke="#0158FD" stroke-width="3" stroke-linecap="round" opacity="0.5"><path d="M198 74c8 6 12 14 12 22M206 62c12 9 18 21 18 34"></path></g></svg>\n';
492
+
493
+ // src/assets/svg/art-kid.svg
494
+ var art_kid_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#4F8BFF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient></defs><circle cx="60" cy="58" r="46" fill="#EAF1FF"></circle><path d="M22 104c0-15 17-24 38-24s38 9 38 24z" fill="url(#rqk-grad)"></path><circle cx="60" cy="52" r="25" fill="#FFD3B6"></circle><path d="M36 47c0-13 10-21 24-21s24 8 24 21c-6-4-13-6-24-6s-18 2-24 6z" fill="#1F2A44"></path><circle cx="51" cy="53" r="2.6" fill="#1F2A44"></circle><circle cx="69" cy="53" r="2.6" fill="#1F2A44"></circle><path d="M54 62c2.6 3 9.4 3 12 0" stroke="#C96A5A" stroke-width="2.4" stroke-linecap="round" fill="none"></path><circle cx="43" cy="60" r="3.4" fill="#FFB4A8" opacity="0.6"></circle><circle cx="77" cy="60" r="3.4" fill="#FFB4A8" opacity="0.6"></circle></svg>\n';
495
+
496
+ // src/assets/svg/art-screen.svg
497
+ var art_screen_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 186" fill="none" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad-play" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#5C96FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient><linearGradient id="rqk-grad-screen" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#EAF2FF"></stop><stop offset="1" stop-color="#C6DBFF"></stop></linearGradient></defs><ellipse cx="120" cy="166" rx="52" ry="8" fill="#0B1220" opacity="0.07"></ellipse><rect x="42" y="32" width="156" height="104" rx="16" fill="url(#rqk-grad-screen)" stroke="#B9D0FF" stroke-width="2"></rect><rect x="52" y="42" width="136" height="84" rx="10" fill="#0B1220" opacity="0.06"></rect><circle cx="120" cy="84" r="26" fill="url(#rqk-grad-play)"></circle><path d="M113 73l20 11-20 11V73z" fill="#fff"></path><rect x="106" y="136" width="28" height="16" fill="#C6DBFF"></rect><rect x="84" y="150" width="72" height="8" rx="4" fill="#B9D0FF"></rect><g fill="#0158FD" opacity="0.5"><circle cx="62" cy="52" r="2.6"></circle><circle cx="70" cy="52" r="2.6"></circle><circle cx="78" cy="52" r="2.6"></circle></g></svg>\n';
498
+
499
+ // src/assets/svg/art-speech.svg
500
+ var art_speech_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#EAF1FF"></stop><stop offset="1" stop-color="#C6DBFF"></stop></linearGradient></defs><path d="M24 34h72a8 8 0 018 8v34a8 8 0 01-8 8H60l-16 14v-14H24a8 8 0 01-8-8V42a8 8 0 018-8z" fill="url(#rqk-grad)"></path><rect x="38" y="52" width="7" height="18" rx="3.5" fill="#0158FD"></rect><rect x="51" y="44" width="7" height="34" rx="3.5" fill="#4F8BFF"></rect><rect x="64" y="48" width="7" height="26" rx="3.5" fill="#4F8BFF"></rect><rect x="77" y="58" width="7" height="10" rx="3.5" fill="#9CBFFF"></rect></svg>\n';
501
+
502
+ // src/assets/svg/art-trophy.svg
503
+ var art_trophy_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#FFE29A"></stop><stop offset="0.55" stop-color="#FFC24B"></stop><stop offset="1" stop-color="#E08A00"></stop></linearGradient></defs><circle cx="60" cy="54" r="42" fill="#FFF7E6"></circle><path d="M38 34h44v18c0 14-9 22-22 22s-22-8-22-22z" fill="url(#rqk-grad)"></path><path d="M38 40H28v4c0 9 6 15 14 15M82 40h10v4c0 9-6 15-14 15" stroke="#E08A00" stroke-width="3.4" fill="none"></path><rect x="52" y="72" width="16" height="10" fill="#F0A600"></rect><rect x="44" y="82" width="32" height="9" rx="3" fill="#E08A00"></rect><path d="M60 44l3 6 7 1-5 5 1 7-6-3-6 3 1-7-5-5 7-1z" fill="#FFF7E6" opacity="0.9"></path><circle cx="90" cy="30" r="3.4" fill="#FFB020" opacity="0.8"></circle><circle cx="26" cy="76" r="2.6" fill="#7C5CFF" opacity="0.6"></circle></svg>\n';
504
+
505
+ // src/art/illustrations.tsx
506
+ var import_jsx_runtime5 = require("react/jsx-runtime");
507
+ var ART_SOURCES = {
508
+ kid: art_kid_default,
509
+ balloon: art_balloon_default,
510
+ apple: art_apple_default,
511
+ coffee: art_coffee_default,
512
+ cat: art_cat_default,
513
+ books: art_books_default,
514
+ headphones: art_headphones_default,
515
+ screen: art_screen_default,
516
+ trophy: art_trophy_default,
517
+ speech: art_speech_default
518
+ };
519
+ function Art({ name, className, size }) {
520
+ var _a;
521
+ const unique = (0, import_react3.useId)().replace(/[^a-zA-Z0-9]/g, "");
522
+ const source = ((_a = ART_SOURCES[name]) != null ? _a : art_speech_default).replace(
523
+ /rqk-grad/g,
524
+ `rqk-grad-${unique}`
525
+ );
526
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
527
+ "span",
528
+ {
529
+ className: ["rqk-art", className].filter(Boolean).join(" "),
530
+ style: size ? { width: size, height: size } : void 0,
531
+ "aria-hidden": true,
532
+ dangerouslySetInnerHTML: { __html: source }
533
+ }
534
+ );
535
+ }
536
+
537
+ // src/core/quest-config.tsx
538
+ var import_react4 = require("react");
539
+ var import_jsx_runtime6 = require("react/jsx-runtime");
540
+ var defaultQuestLabels = {
541
+ submit: "\u63D0\u4EA4\u7B54\u6848",
542
+ submitCount: "\u63D0\u4EA4\u7B54\u6848",
543
+ retry: "\u91CD\u8BD5\u4E00\u6B21",
544
+ next: "\u5207\u9898",
545
+ prev: "\u4E0A\u4E00\u9898",
546
+ back: "\u8FD4\u56DE",
547
+ answer: "\u6B63\u786E\u7B54\u6848",
548
+ analysis: "\u89E3\u6790",
549
+ correctAll: "\u5168\u90E8\u7B54\u5BF9",
550
+ wrongAnswer: "\u7B54\u6848\u8FD8\u4E0D\u6B63\u786E",
551
+ tapToRead: "\u70B9\u51FB\u6717\u8BFB",
552
+ readAloud: "\u8303\u8BFB",
553
+ recording: "\u5F55\u97F3\u4E2D",
554
+ scoring: "\u8BC4\u5206\u4E2D",
555
+ releaseToSend: "\u677E\u624B\u5373\u63D0\u4EA4",
556
+ holdToRecord: "\u70B9\u51FB\u5F00\u59CB\u5F55\u97F3",
557
+ tapToFollow: "\u70B9\u51FB\u8DDF\u8BFB",
558
+ recordingHint: "\u6B63\u5728\u5F55\u97F3 \xB7 \u70B9\u51FB\u7ED3\u675F",
559
+ rescore: "\u91CD\u65B0\u5F55\u97F3",
560
+ submitted: "\u5DF2\u63D0\u4EA4 \xB7 \u53EF\u91CD\u5F55",
561
+ noiseHint: "\u97F3\u8D28\u4E0D\u5408\u683C\uFF1A\u4E0D\u51FA\u5206\uFF0C\u8BF7\u6362\u5B89\u9759\u73AF\u5883\u91CD\u8BD5",
562
+ againHint: "\u672A\u83B7\u53D6\u5206\u6570\uFF0C\u8BF7\u518D\u8BD5\u4E00\u6B21",
563
+ attemptsLeft: "\u8FD8\u6709 {n} \u6B21\u5F55\u97F3\u673A\u4F1A",
564
+ attemptsUsedUp: "\u673A\u4F1A\u5DF2\u7528\u5B8C",
565
+ play: "\u64AD\u653E",
566
+ pause: "\u6682\u505C",
567
+ replay: "\u518D\u542C\u4E00\u904D",
568
+ loop: "\u5FAA\u73AF",
569
+ speed: "\u500D\u901F",
570
+ finish: "\u5B8C\u6210\u5E76\u8FD4\u56DE",
571
+ submitAndStats: "\u63D0\u4EA4\u5E76\u67E5\u770B\u7EDF\u8BA1",
572
+ effectivePlay: "\u6709\u6548\u64AD\u653E",
573
+ totalTime: "\u603B\u65F6\u957F",
574
+ reading: "\u9605\u8BFB",
575
+ expand: "\u5C55\u5F00\u5168\u6587",
576
+ collapse: "\u6536\u8D77",
577
+ notAnswered: "\u672A\u4F5C\u7B54",
578
+ fullscreen: "\u5168\u5C4F"
579
+ };
580
+ var QuestConfigContext = (0, import_react4.createContext)({});
581
+ function QuestConfigProvider({
582
+ config,
583
+ children
584
+ }) {
585
+ const parent = (0, import_react4.useContext)(QuestConfigContext);
586
+ const value = (0, import_react4.useMemo)(
587
+ () => {
588
+ var _a, _b;
589
+ return {
590
+ sound: (_a = config == null ? void 0 : config.sound) != null ? _a : parent.sound,
591
+ speakText: (_b = config == null ? void 0 : config.speakText) != null ? _b : parent.speakText,
592
+ labels: __spreadValues(__spreadValues({}, parent.labels), config == null ? void 0 : config.labels)
593
+ };
594
+ },
595
+ [config, parent]
596
+ );
597
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(QuestConfigContext.Provider, { value, children });
598
+ }
599
+ function useQuestConfig() {
600
+ return (0, import_react4.useContext)(QuestConfigContext);
601
+ }
602
+ function useQuestLabels(override) {
603
+ const config = useQuestConfig();
604
+ return (0, import_react4.useMemo)(
605
+ () => __spreadValues(__spreadValues(__spreadValues({}, defaultQuestLabels), config.labels), override),
606
+ [config.labels, override]
607
+ );
608
+ }
609
+
610
+ // src/primitives/action-bar.tsx
611
+ var import_jsx_runtime7 = require("react/jsx-runtime");
612
+ function ActionBar({ actions, index = 1, total, onPrev, className }) {
613
+ const labels = useQuestLabels();
614
+ const autoPrev = Boolean(onPrev) && index > 1;
615
+ const isLast = total !== void 0 && total > 0 && index >= total;
616
+ const resolved = isLast ? actions.map(
617
+ (action) => action.key === "next" ? __spreadProps(__spreadValues({}, action), { label: labels.finish }) : action
618
+ ) : actions;
619
+ const body = autoPrev ? resolved.filter((action) => action.key !== "prev") : resolved;
620
+ const visibleActions = autoPrev ? [
621
+ {
622
+ key: "prev",
623
+ label: labels.prev,
624
+ variant: "ghost",
625
+ onClick: onPrev,
626
+ ariaLabel: labels.prev
627
+ },
628
+ ...body
629
+ ] : body;
630
+ if (!visibleActions.length) return null;
631
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: classNames("rqk-action-bar flex gap-2.5", className), children: visibleActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
632
+ "button",
633
+ {
634
+ type: "button",
635
+ className: classNames(
636
+ "rqk-action ease-rqk-spring inline-flex h-[52px] min-w-0 items-center justify-center gap-1.5 rounded-[16px] px-[18px] text-[17px] font-semibold transition-[transform,opacity,background] duration-200 active:scale-[0.98] disabled:opacity-45 disabled:active:scale-100",
637
+ action.variant === "ghost" ? "rqk-action-ghost text-rqk-ink-2 flex-none bg-white" : "rqk-action-primary disabled:bg-rqk-blue-300 flex-1 bg-[linear-gradient(180deg,#2c74ff,var(--rqk-blue-500)_70%)] text-white"
638
+ ),
639
+ onClick: action.onClick,
640
+ disabled: action.disabled,
641
+ "aria-label": action.ariaLabel,
642
+ children: [
643
+ action.icon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "rqk-action-icon inline-flex items-center justify-center", children: action.icon }) : null,
644
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "rqk-action-label", children: action.label })
645
+ ]
646
+ },
647
+ action.key
648
+ )) });
649
+ }
650
+
651
+ // src/primitives/quest-complete.tsx
652
+ var import_jsx_runtime8 = require("react/jsx-runtime");
653
+ function QuestComplete({
654
+ total = 1,
655
+ index,
656
+ title,
657
+ subtitle,
658
+ art = "trophy",
659
+ stats,
660
+ onFinish,
661
+ finishLabel,
662
+ className
663
+ }) {
664
+ const labels = useQuestLabels();
665
+ const current = index != null ? index : total;
666
+ const statItems = stats != null ? stats : [
667
+ { value: total, unit: "\u9898", label: "\u5B8C\u6210\u9898\u76EE" },
668
+ { value: 100, unit: "%", label: "\u5B8C\u6210\u5EA6" }
669
+ ];
670
+ const actions = [];
671
+ if (onFinish) {
672
+ actions.push({
673
+ key: "finish",
674
+ label: finishLabel != null ? finishLabel : labels.finish,
675
+ onClick: onFinish
676
+ });
677
+ }
678
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
679
+ QuestShell,
680
+ {
681
+ index: current,
682
+ total,
683
+ className: classNames("rqk-complete", className),
684
+ footer: actions.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ActionBar, { actions }) : void 0,
685
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rqk-complete-body", children: [
686
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rqk-complete-art", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Art, { name: art }) }),
687
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rqk-complete-title", role: "heading", "aria-level": 1, children: title != null ? title : "\u9898\u5305\u5B8C\u6210\u5566" }),
688
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rqk-complete-subtitle", children: subtitle != null ? subtitle : `\u5171 ${total} \u9053\u9898\u5DF2\u5168\u90E8\u5B8C\u6210` }),
689
+ statItems.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rqk-complete-stats", "aria-label": "\u9898\u5305\u7EDF\u8BA1", children: statItems.map((stat, statIndex) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rqk-complete-stat", children: [
690
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rqk-complete-stat-value", children: [
691
+ stat.value,
692
+ stat.unit ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: stat.unit }) : null
693
+ ] }),
694
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rqk-complete-stat-label", children: stat.label })
695
+ ] }, statIndex)) }) : null
696
+ ] })
697
+ }
698
+ );
699
+ }
700
+
458
701
  // src/core/icons.tsx
459
702
  var import_classnames2 = __toESM(require("classnames"));
460
703
 
@@ -489,7 +732,7 @@ var icon_play_default = '<svg width="22" height="22" viewBox="0 0 24 24" fill="n
489
732
  var icon_speaker_default = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M4 9.6h3.2L12 5.4v13.2L7.2 14.4H4z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"></path><path d="M15.6 9.2a4 4 0 010 5.6M18.2 6.8a7.4 7.4 0 010 10.4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path></svg>\n';
490
733
 
491
734
  // src/core/icons.tsx
492
- var import_jsx_runtime5 = require("react/jsx-runtime");
735
+ var import_jsx_runtime9 = require("react/jsx-runtime");
493
736
  function SvgIcon(_a) {
494
737
  var _b = _a, {
495
738
  source,
@@ -503,7 +746,7 @@ function SvgIcon(_a) {
503
746
  "style"
504
747
  ]);
505
748
  const html = size ? source.replace("<svg", '<svg style="width:100%;height:100%"') : source;
506
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
749
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
507
750
  "span",
508
751
  __spreadProps(__spreadValues({
509
752
  className: (0, import_classnames2.default)("rqk-icon", className),
@@ -515,38 +758,38 @@ function SvgIcon(_a) {
515
758
  );
516
759
  }
517
760
  function CheckIcon(props) {
518
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SvgIcon, __spreadValues({ source: icon_check_default }, props));
761
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SvgIcon, __spreadValues({ source: icon_check_default }, props));
519
762
  }
520
763
  function CrossIcon(props) {
521
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SvgIcon, __spreadValues({ source: icon_cross_default }, props));
764
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SvgIcon, __spreadValues({ source: icon_cross_default }, props));
522
765
  }
523
766
  function AlertIcon(props) {
524
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SvgIcon, __spreadValues({ source: icon_alert_default }, props));
767
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SvgIcon, __spreadValues({ source: icon_alert_default }, props));
525
768
  }
526
769
  function PlayIcon(props) {
527
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SvgIcon, __spreadValues({ source: icon_play_default }, props));
770
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SvgIcon, __spreadValues({ source: icon_play_default }, props));
528
771
  }
529
772
  function PauseIcon(props) {
530
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SvgIcon, __spreadValues({ source: icon_pause_default }, props));
773
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SvgIcon, __spreadValues({ source: icon_pause_default }, props));
531
774
  }
532
775
  function MicIcon(props) {
533
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SvgIcon, __spreadValues({ source: icon_mic_default }, props));
776
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SvgIcon, __spreadValues({ source: icon_mic_default }, props));
534
777
  }
535
778
  function SpeakerIcon(props) {
536
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SvgIcon, __spreadValues({ source: icon_speaker_default }, props));
779
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SvgIcon, __spreadValues({ source: icon_speaker_default }, props));
537
780
  }
538
781
  function LoopIcon(props) {
539
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SvgIcon, __spreadValues({ source: icon_loop_default }, props));
782
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SvgIcon, __spreadValues({ source: icon_loop_default }, props));
540
783
  }
541
784
  function FullscreenIcon(props) {
542
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SvgIcon, __spreadValues({ source: icon_fullscreen_default }, props));
785
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SvgIcon, __spreadValues({ source: icon_fullscreen_default }, props));
543
786
  }
544
787
  function KeyboardIcon(props) {
545
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SvgIcon, __spreadValues({ source: icon_keyboard_default }, props));
788
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SvgIcon, __spreadValues({ source: icon_keyboard_default }, props));
546
789
  }
547
790
 
548
791
  // src/primitives/option-item.tsx
549
- var import_jsx_runtime6 = require("react/jsx-runtime");
792
+ var import_jsx_runtime10 = require("react/jsx-runtime");
550
793
  function OptionItem({
551
794
  label,
552
795
  children,
@@ -560,7 +803,7 @@ function OptionItem({
560
803
  className
561
804
  }) {
562
805
  const marked = state === "correct" || state === "wrong";
563
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
806
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
564
807
  "button",
565
808
  {
566
809
  type: "button",
@@ -574,21 +817,21 @@ function OptionItem({
574
817
  disabled: disabled || state === "disabled",
575
818
  "aria-pressed": state === "selected",
576
819
  children: [
577
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "rqk-option-marker", children: label }),
578
- media ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "rqk-option-media", children: media }) : null,
579
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "rqk-option-content", children: [
580
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "rqk-option-text", children }),
581
- sub ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "rqk-option-sub", children: sub }) : null
820
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rqk-option-marker", children: label }),
821
+ media ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rqk-option-media", children: media }) : null,
822
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "rqk-option-content", children: [
823
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rqk-option-text", children }),
824
+ sub ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rqk-option-sub", children: sub }) : null
582
825
  ] }),
583
- audioIndicator ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "rqk-option-audio", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SpeakerIcon, { size: 16 }) }) : null,
584
- marked ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "rqk-option-status", "aria-hidden": true, children: state === "correct" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CheckIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CrossIcon, { size: 18 }) }) : null
826
+ audioIndicator ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rqk-option-audio", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SpeakerIcon, { size: 16 }) }) : null,
827
+ marked ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "rqk-option-status", "aria-hidden": true, children: state === "correct" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CheckIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CrossIcon, { size: 18 }) }) : null
585
828
  ]
586
829
  }
587
830
  );
588
831
  }
589
832
 
590
833
  // src/primitives/star-rating.tsx
591
- var import_jsx_runtime7 = require("react/jsx-runtime");
834
+ var import_jsx_runtime11 = require("react/jsx-runtime");
592
835
  function StarRating({
593
836
  value,
594
837
  size = 18,
@@ -597,13 +840,13 @@ function StarRating({
597
840
  label
598
841
  }) {
599
842
  const count = Math.max(0, Math.min(3, value));
600
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
843
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
601
844
  "span",
602
845
  {
603
846
  className: classNames("rqk-stars", className),
604
847
  role: "img",
605
848
  "aria-label": label != null ? label : `${count} / 3`,
606
- children: [0, 1, 2].map((index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
849
+ children: [0, 1, 2].map((index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
607
850
  "span",
608
851
  {
609
852
  className: classNames(
@@ -612,7 +855,7 @@ function StarRating({
612
855
  animate && index < count && "rqk-star-animate"
613
856
  ),
614
857
  style: { animationDelay: `${index * 0.08}s`, fontSize: `${size}px` },
615
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "rqk-star-glyph", "aria-hidden": "true", children: "\u2605" })
858
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rqk-star-glyph", "aria-hidden": "true", children: "\u2605" })
616
859
  },
617
860
  index
618
861
  ))
@@ -621,11 +864,11 @@ function StarRating({
621
864
  }
622
865
 
623
866
  // src/primitives/feedback-sheet.tsx
624
- var import_jsx_runtime8 = require("react/jsx-runtime");
867
+ var import_jsx_runtime12 = require("react/jsx-runtime");
625
868
  var TONE_ICONS = {
626
- ok: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CheckIcon, { size: 18 }),
627
- bad: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CrossIcon, { size: 16 }),
628
- warn: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AlertIcon, { size: 18 })
869
+ ok: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CheckIcon, { size: 18 }),
870
+ bad: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CrossIcon, { size: 16 }),
871
+ warn: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AlertIcon, { size: 18 })
629
872
  };
630
873
  function FeedbackSheet({
631
874
  tone = "ok",
@@ -638,28 +881,28 @@ function FeedbackSheet({
638
881
  analysisLabel = "\u89E3\u6790",
639
882
  className
640
883
  }) {
641
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
884
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
642
885
  "div",
643
886
  {
644
887
  className: classNames("rqk-feedback", `rqk-feedback-${tone}`, className),
645
888
  role: "status",
646
889
  "aria-live": "polite",
647
890
  children: [
648
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rqk-feedback-head", children: [
649
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rqk-feedback-icon", "aria-hidden": true, children: TONE_ICONS[tone] }),
650
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rqk-feedback-copy", children: [
651
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rqk-feedback-title", children: title }),
652
- detail ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "rqk-feedback-detail", children: detail }) : null
891
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rqk-feedback-head", children: [
892
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "rqk-feedback-icon", "aria-hidden": true, children: TONE_ICONS[tone] }),
893
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rqk-feedback-copy", children: [
894
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rqk-feedback-title", children: title }),
895
+ detail ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "rqk-feedback-detail", children: detail }) : null
653
896
  ] }),
654
- typeof stars === "number" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(StarRating, { value: stars, size: 16, animate: true }) : null
897
+ typeof stars === "number" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(StarRating, { value: stars, size: 16, animate: true }) : null
655
898
  ] }),
656
- answer ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rqk-feedback-answer", children: [
657
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rqk-feedback-answer-label", children: answerLabel }),
658
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rqk-feedback-answer-value", children: answer })
899
+ answer ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rqk-feedback-answer", children: [
900
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "rqk-feedback-answer-label", children: answerLabel }),
901
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "rqk-feedback-answer-value", children: answer })
659
902
  ] }) : null,
660
- analysis ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "rqk-feedback-analysis", children: [
661
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "rqk-feedback-analysis-label", children: analysisLabel }),
662
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: analysis })
903
+ analysis ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "rqk-feedback-analysis", children: [
904
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "rqk-feedback-analysis-label", children: analysisLabel }),
905
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: analysis })
663
906
  ] }) : null
664
907
  ]
665
908
  }
@@ -667,8 +910,8 @@ function FeedbackSheet({
667
910
  }
668
911
 
669
912
  // src/primitives/segmented-control.tsx
670
- var import_react3 = require("react");
671
- var import_jsx_runtime9 = require("react/jsx-runtime");
913
+ var import_react5 = require("react");
914
+ var import_jsx_runtime13 = require("react/jsx-runtime");
672
915
  function SegmentedControl({
673
916
  options,
674
917
  value,
@@ -677,10 +920,10 @@ function SegmentedControl({
677
920
  disabled,
678
921
  className
679
922
  }) {
680
- const rootRef = (0, import_react3.useRef)(null);
681
- const mountedRef = (0, import_react3.useRef)(false);
682
- const [thumb, setThumb] = (0, import_react3.useState)({ x: 0, width: 0, ready: false });
683
- (0, import_react3.useLayoutEffect)(() => {
923
+ const rootRef = (0, import_react5.useRef)(null);
924
+ const mountedRef = (0, import_react5.useRef)(false);
925
+ const [thumb, setThumb] = (0, import_react5.useState)({ x: 0, width: 0, ready: false });
926
+ (0, import_react5.useLayoutEffect)(() => {
684
927
  const root = rootRef.current;
685
928
  if (!root) return;
686
929
  const active = root.querySelector('[data-active="true"]');
@@ -695,13 +938,11 @@ function SegmentedControl({
695
938
  return current.x === next.x && current.width === next.width && current.ready ? current : next;
696
939
  });
697
940
  };
698
- let timer;
699
941
  if (!mountedRef.current) {
700
942
  mountedRef.current = true;
701
943
  sync();
702
- } else {
703
- timer = setTimeout(sync, 0);
704
944
  }
945
+ const timer = setTimeout(sync, 0);
705
946
  const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
706
947
  observer == null ? void 0 : observer.observe(root);
707
948
  if (active) observer == null ? void 0 : observer.observe(active);
@@ -714,9 +955,10 @@ function SegmentedControl({
714
955
  }, [value, options.length]);
715
956
  const thumbStyle = {
716
957
  "--rqk-seg-x": `${thumb.x}px`,
717
- "--rqk-seg-w": `${thumb.width}px`
958
+ "--rqk-seg-w": `${thumb.width}px`,
959
+ opacity: thumb.ready ? 1 : 0
718
960
  };
719
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
961
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
720
962
  "div",
721
963
  {
722
964
  ref: rootRef,
@@ -725,10 +967,10 @@ function SegmentedControl({
725
967
  "aria-label": ariaLabel,
726
968
  "data-ready": thumb.ready,
727
969
  children: [
728
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "rqk-segmented-thumb", style: thumbStyle, "aria-hidden": "true" }),
970
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "rqk-segmented-thumb", style: thumbStyle, "aria-hidden": "true" }),
729
971
  options.map((option) => {
730
972
  const active = option.value === value;
731
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
973
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
732
974
  "button",
733
975
  {
734
976
  type: "button",
@@ -748,116 +990,6 @@ function SegmentedControl({
748
990
  );
749
991
  }
750
992
 
751
- // src/core/quest-config.tsx
752
- var import_react4 = require("react");
753
- var import_jsx_runtime10 = require("react/jsx-runtime");
754
- var defaultQuestLabels = {
755
- submit: "\u63D0\u4EA4\u7B54\u6848",
756
- submitCount: "\u63D0\u4EA4\u7B54\u6848",
757
- retry: "\u91CD\u8BD5\u4E00\u6B21",
758
- next: "\u5207\u9898",
759
- prev: "\u4E0A\u4E00\u9898",
760
- back: "\u8FD4\u56DE",
761
- answer: "\u6B63\u786E\u7B54\u6848",
762
- analysis: "\u89E3\u6790",
763
- correctAll: "\u5168\u90E8\u7B54\u5BF9",
764
- wrongAnswer: "\u7B54\u6848\u8FD8\u4E0D\u6B63\u786E",
765
- tapToRead: "\u70B9\u51FB\u6717\u8BFB",
766
- readAloud: "\u8303\u8BFB",
767
- recording: "\u5F55\u97F3\u4E2D",
768
- scoring: "\u8BC4\u5206\u4E2D",
769
- releaseToSend: "\u677E\u624B\u5373\u63D0\u4EA4",
770
- holdToRecord: "\u70B9\u51FB\u5F00\u59CB\u5F55\u97F3",
771
- tapToFollow: "\u70B9\u51FB\u8DDF\u8BFB",
772
- recordingHint: "\u6B63\u5728\u5F55\u97F3 \xB7 \u70B9\u51FB\u7ED3\u675F",
773
- rescore: "\u91CD\u65B0\u5F55\u97F3",
774
- submitted: "\u5DF2\u63D0\u4EA4 \xB7 \u53EF\u91CD\u5F55",
775
- noiseHint: "\u97F3\u8D28\u4E0D\u5408\u683C\uFF1A\u4E0D\u51FA\u5206\uFF0C\u8BF7\u6362\u5B89\u9759\u73AF\u5883\u91CD\u8BD5",
776
- againHint: "\u672A\u83B7\u53D6\u5206\u6570\uFF0C\u8BF7\u518D\u8BD5\u4E00\u6B21",
777
- attemptsLeft: "\u8FD8\u6709 {n} \u6B21\u5F55\u97F3\u673A\u4F1A",
778
- attemptsUsedUp: "\u673A\u4F1A\u5DF2\u7528\u5B8C",
779
- play: "\u64AD\u653E",
780
- pause: "\u6682\u505C",
781
- replay: "\u518D\u542C\u4E00\u904D",
782
- loop: "\u5FAA\u73AF",
783
- speed: "\u500D\u901F",
784
- finish: "\u5B8C\u6210\u5E76\u8FD4\u56DE",
785
- submitAndStats: "\u63D0\u4EA4\u5E76\u67E5\u770B\u7EDF\u8BA1",
786
- effectivePlay: "\u6709\u6548\u64AD\u653E",
787
- totalTime: "\u603B\u65F6\u957F",
788
- reading: "\u9605\u8BFB",
789
- expand: "\u5C55\u5F00\u5168\u6587",
790
- collapse: "\u6536\u8D77",
791
- notAnswered: "\u672A\u4F5C\u7B54",
792
- fullscreen: "\u5168\u5C4F"
793
- };
794
- var QuestConfigContext = (0, import_react4.createContext)({});
795
- function QuestConfigProvider({
796
- config,
797
- children
798
- }) {
799
- const parent = (0, import_react4.useContext)(QuestConfigContext);
800
- const value = (0, import_react4.useMemo)(
801
- () => {
802
- var _a, _b;
803
- return {
804
- sound: (_a = config == null ? void 0 : config.sound) != null ? _a : parent.sound,
805
- speakText: (_b = config == null ? void 0 : config.speakText) != null ? _b : parent.speakText,
806
- labels: __spreadValues(__spreadValues({}, parent.labels), config == null ? void 0 : config.labels)
807
- };
808
- },
809
- [config, parent]
810
- );
811
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(QuestConfigContext.Provider, { value, children });
812
- }
813
- function useQuestConfig() {
814
- return (0, import_react4.useContext)(QuestConfigContext);
815
- }
816
- function useQuestLabels(override) {
817
- const config = useQuestConfig();
818
- return (0, import_react4.useMemo)(
819
- () => __spreadValues(__spreadValues(__spreadValues({}, defaultQuestLabels), config.labels), override),
820
- [config.labels, override]
821
- );
822
- }
823
-
824
- // src/primitives/action-bar.tsx
825
- var import_jsx_runtime11 = require("react/jsx-runtime");
826
- function ActionBar({ actions, index = 1, onPrev, className }) {
827
- const labels = useQuestLabels();
828
- const autoPrev = Boolean(onPrev) && index > 1;
829
- const body = autoPrev ? actions.filter((action) => action.key !== "prev") : actions;
830
- const visibleActions = autoPrev ? [
831
- {
832
- key: "prev",
833
- label: labels.prev,
834
- variant: "ghost",
835
- onClick: onPrev,
836
- ariaLabel: labels.prev
837
- },
838
- ...body
839
- ] : body;
840
- if (!visibleActions.length) return null;
841
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: classNames("rqk-action-bar flex gap-2.5", className), children: visibleActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
842
- "button",
843
- {
844
- type: "button",
845
- className: classNames(
846
- "rqk-action ease-rqk-spring inline-flex h-[52px] min-w-0 items-center justify-center gap-1.5 rounded-[16px] px-[18px] text-[17px] font-semibold transition-[transform,opacity,background] duration-200 active:scale-[0.98] disabled:opacity-45 disabled:active:scale-100",
847
- action.variant === "ghost" ? "rqk-action-ghost text-rqk-ink-2 flex-none bg-white" : "rqk-action-primary disabled:bg-rqk-blue-300 flex-1 bg-[linear-gradient(180deg,#2c74ff,var(--rqk-blue-500)_70%)] text-white"
848
- ),
849
- onClick: action.onClick,
850
- disabled: action.disabled,
851
- "aria-label": action.ariaLabel,
852
- children: [
853
- action.icon ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rqk-action-icon inline-flex items-center justify-center", children: action.icon }) : null,
854
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "rqk-action-label", children: action.label })
855
- ]
856
- },
857
- action.key
858
- )) });
859
- }
860
-
861
993
  // src/questions/single-choice/actions.ts
862
994
  function singleChoiceActions({
863
995
  readonly,
@@ -887,7 +1019,7 @@ function singleChoiceActions({
887
1019
  }
888
1020
 
889
1021
  // src/questions/single-choice/feedback.tsx
890
- var import_jsx_runtime12 = require("react/jsx-runtime");
1022
+ var import_jsx_runtime14 = require("react/jsx-runtime");
891
1023
  function SingleChoiceFeedback({
892
1024
  readonly,
893
1025
  phase,
@@ -896,7 +1028,7 @@ function SingleChoiceFeedback({
896
1028
  answerLabel
897
1029
  }) {
898
1030
  if (readonly) {
899
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1031
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
900
1032
  FeedbackSheet,
901
1033
  {
902
1034
  tone: "ok",
@@ -908,10 +1040,10 @@ function SingleChoiceFeedback({
908
1040
  );
909
1041
  }
910
1042
  if (phase === "retry") {
911
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FeedbackSheet, { tone: "bad", title: labels.wrongAnswer, detail: "\u518D\u68C0\u67E5\u4E00\u6B21\uFF0C\u8FD8\u6709\u4E00\u6B21\u673A\u4F1A" });
1043
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FeedbackSheet, { tone: "bad", title: labels.wrongAnswer, detail: "\u518D\u68C0\u67E5\u4E00\u6B21\uFF0C\u8FD8\u6709\u4E00\u6B21\u673A\u4F1A" });
912
1044
  }
913
1045
  if (phase === "correct") {
914
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1046
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
915
1047
  FeedbackSheet,
916
1048
  {
917
1049
  tone: "ok",
@@ -922,7 +1054,7 @@ function SingleChoiceFeedback({
922
1054
  );
923
1055
  }
924
1056
  if (phase === "locked") {
925
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1057
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
926
1058
  FeedbackSheet,
927
1059
  {
928
1060
  tone: "bad",
@@ -954,7 +1086,7 @@ function matchesAny(value, answers) {
954
1086
  }
955
1087
 
956
1088
  // src/questions/single-choice/option-list.tsx
957
- var import_jsx_runtime13 = require("react/jsx-runtime");
1089
+ var import_jsx_runtime15 = require("react/jsx-runtime");
958
1090
  function SingleChoiceOptions({
959
1091
  data,
960
1092
  canPick,
@@ -962,7 +1094,7 @@ function SingleChoiceOptions({
962
1094
  onPick
963
1095
  }) {
964
1096
  const hasImages = data.options.some((option) => option.image);
965
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: classNames("rqk-option-list", hasImages && "rqk-option-list-grid"), children: data.options.map((option, optionIndex) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1097
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: classNames("rqk-option-list", hasImages && "rqk-option-list-grid"), children: data.options.map((option, optionIndex) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
966
1098
  OptionItem,
967
1099
  {
968
1100
  label: optionLetter(optionIndex),
@@ -970,7 +1102,7 @@ function SingleChoiceOptions({
970
1102
  state: stateOf(optionIndex),
971
1103
  layout: hasImages ? "grid" : "row",
972
1104
  disabled: !canPick,
973
- media: option.image ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("img", { className: "rqk-option-image", src: option.image, alt: "" }) : void 0,
1105
+ media: option.image ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { className: "rqk-option-image", src: option.image, alt: "" }) : void 0,
974
1106
  audioIndicator: Boolean(option.audio || option.speak),
975
1107
  onClick: () => onPick(optionIndex),
976
1108
  children: option.text
@@ -980,9 +1112,9 @@ function SingleChoiceOptions({
980
1112
  }
981
1113
 
982
1114
  // src/primitives/card.tsx
983
- var import_jsx_runtime14 = require("react/jsx-runtime");
1115
+ var import_jsx_runtime16 = require("react/jsx-runtime");
984
1116
  function Card({ children, flush, tint, className }) {
985
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1117
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
986
1118
  "div",
987
1119
  {
988
1120
  className: classNames(
@@ -997,10 +1129,10 @@ function Card({ children, flush, tint, className }) {
997
1129
  }
998
1130
 
999
1131
  // src/primitives/audio-bar.tsx
1000
- var import_react6 = require("react");
1132
+ var import_react7 = require("react");
1001
1133
 
1002
1134
  // src/core/use-media-progress.ts
1003
- var import_react5 = require("react");
1135
+ var import_react6 = require("react");
1004
1136
  var TICK_MS = 100;
1005
1137
  function clamp(value, min, max) {
1006
1138
  return Math.min(max, Math.max(min, value));
@@ -1017,21 +1149,21 @@ function useMediaProgress({
1017
1149
  threshold = 0.9,
1018
1150
  speed: initialSpeed = 1
1019
1151
  }) {
1020
- const [position, setPosition] = (0, import_react5.useState)(0);
1021
- const [credited, setCredited] = (0, import_react5.useState)(0);
1022
- const [playing, setPlaying] = (0, import_react5.useState)(false);
1023
- const [finished, setFinished] = (0, import_react5.useState)(false);
1024
- const [speed, setSpeedState] = (0, import_react5.useState)(initialSpeed);
1025
- const [loop, setLoopState] = (0, import_react5.useState)(false);
1026
- const [timeOnTask, setTimeOnTask] = (0, import_react5.useState)(0);
1027
- const mediaRef = (0, import_react5.useRef)(null);
1028
- const positionRef = (0, import_react5.useRef)(0);
1029
- const creditedRef = (0, import_react5.useRef)(0);
1030
- const lastTimeRef = (0, import_react5.useRef)(0);
1031
- const playingRef = (0, import_react5.useRef)(false);
1032
- const loopRef = (0, import_react5.useRef)(false);
1033
- const speedRef = (0, import_react5.useRef)(initialSpeed);
1034
- const applyCredited = (0, import_react5.useCallback)(
1152
+ const [position, setPosition] = (0, import_react6.useState)(0);
1153
+ const [credited, setCredited] = (0, import_react6.useState)(0);
1154
+ const [playing, setPlaying] = (0, import_react6.useState)(false);
1155
+ const [finished, setFinished] = (0, import_react6.useState)(false);
1156
+ const [speed, setSpeedState] = (0, import_react6.useState)(initialSpeed);
1157
+ const [loop, setLoopState] = (0, import_react6.useState)(false);
1158
+ const [timeOnTask, setTimeOnTask] = (0, import_react6.useState)(0);
1159
+ const mediaRef = (0, import_react6.useRef)(null);
1160
+ const positionRef = (0, import_react6.useRef)(0);
1161
+ const creditedRef = (0, import_react6.useRef)(0);
1162
+ const lastTimeRef = (0, import_react6.useRef)(0);
1163
+ const playingRef = (0, import_react6.useRef)(false);
1164
+ const loopRef = (0, import_react6.useRef)(false);
1165
+ const speedRef = (0, import_react6.useRef)(initialSpeed);
1166
+ const applyCredited = (0, import_react6.useCallback)(
1035
1167
  (next) => {
1036
1168
  const capped = clamp(next, 0, Math.max(duration, 0));
1037
1169
  creditedRef.current = capped;
@@ -1039,7 +1171,7 @@ function useMediaProgress({
1039
1171
  },
1040
1172
  [duration]
1041
1173
  );
1042
- const applyPosition = (0, import_react5.useCallback)(
1174
+ const applyPosition = (0, import_react6.useCallback)(
1043
1175
  (next) => {
1044
1176
  const capped = clamp(next, 0, Math.max(duration, 0));
1045
1177
  positionRef.current = capped;
@@ -1048,7 +1180,7 @@ function useMediaProgress({
1048
1180
  },
1049
1181
  [duration]
1050
1182
  );
1051
- const play = (0, import_react5.useCallback)(() => {
1183
+ const play = (0, import_react6.useCallback)(() => {
1052
1184
  if (playingRef.current) return;
1053
1185
  if (positionRef.current >= duration) {
1054
1186
  applyPosition(0);
@@ -1060,17 +1192,17 @@ function useMediaProgress({
1060
1192
  void mediaRef.current.play().catch(() => void 0);
1061
1193
  }
1062
1194
  }, [applyPosition, duration]);
1063
- const pause = (0, import_react5.useCallback)(() => {
1195
+ const pause = (0, import_react6.useCallback)(() => {
1064
1196
  if (!playingRef.current) return;
1065
1197
  playingRef.current = false;
1066
1198
  setPlaying(false);
1067
1199
  if (mediaRef.current) mediaRef.current.pause();
1068
1200
  }, []);
1069
- const toggle = (0, import_react5.useCallback)(() => {
1201
+ const toggle = (0, import_react6.useCallback)(() => {
1070
1202
  if (playingRef.current) pause();
1071
1203
  else play();
1072
1204
  }, [pause, play]);
1073
- const seek = (0, import_react5.useCallback)(
1205
+ const seek = (0, import_react6.useCallback)(
1074
1206
  (seconds) => {
1075
1207
  applyPosition(seconds);
1076
1208
  if (seconds < duration) setFinished(false);
@@ -1078,17 +1210,17 @@ function useMediaProgress({
1078
1210
  },
1079
1211
  [applyPosition, duration]
1080
1212
  );
1081
- const setSpeed = (0, import_react5.useCallback)((next) => {
1213
+ const setSpeed = (0, import_react6.useCallback)((next) => {
1082
1214
  speedRef.current = next;
1083
1215
  setSpeedState(next);
1084
1216
  if (mediaRef.current) mediaRef.current.playbackRate = next;
1085
1217
  }, []);
1086
- const setLoop = (0, import_react5.useCallback)((next) => {
1218
+ const setLoop = (0, import_react6.useCallback)((next) => {
1087
1219
  loopRef.current = next;
1088
1220
  setLoopState(next);
1089
1221
  if (mediaRef.current) mediaRef.current.loop = next;
1090
1222
  }, []);
1091
- const reset = (0, import_react5.useCallback)(() => {
1223
+ const reset = (0, import_react6.useCallback)(() => {
1092
1224
  playingRef.current = false;
1093
1225
  setPlaying(false);
1094
1226
  applyPosition(0);
@@ -1100,7 +1232,7 @@ function useMediaProgress({
1100
1232
  mediaRef.current.currentTime = 0;
1101
1233
  }
1102
1234
  }, [applyCredited, applyPosition]);
1103
- (0, import_react5.useEffect)(() => {
1235
+ (0, import_react6.useEffect)(() => {
1104
1236
  if (src || !playing) return void 0;
1105
1237
  const timer = window.setInterval(() => {
1106
1238
  if (!playingRef.current) return;
@@ -1126,7 +1258,7 @@ function useMediaProgress({
1126
1258
  }, TICK_MS);
1127
1259
  return () => window.clearInterval(timer);
1128
1260
  }, [applyCredited, applyPosition, duration, playing, src]);
1129
- (0, import_react5.useEffect)(() => {
1261
+ (0, import_react6.useEffect)(() => {
1130
1262
  const media = mediaRef.current;
1131
1263
  if (!media || !src) return void 0;
1132
1264
  media.playbackRate = speedRef.current;
@@ -1191,7 +1323,7 @@ function useMediaProgress({
1191
1323
  }
1192
1324
 
1193
1325
  // src/primitives/audio-bar.tsx
1194
- var import_jsx_runtime15 = require("react/jsx-runtime");
1326
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1195
1327
  var WAVE_BARS = [
1196
1328
  10,
1197
1329
  16,
@@ -1238,30 +1370,30 @@ function AudioBar({
1238
1370
  compact,
1239
1371
  className
1240
1372
  }) {
1241
- const audioRef = (0, import_react6.useRef)(null);
1242
- const [internalPlaying, setInternalPlaying] = (0, import_react6.useState)(false);
1243
- const [position, setPosition] = (0, import_react6.useState)(0);
1244
- const [sourceDuration, setSourceDuration] = (0, import_react6.useState)(null);
1373
+ const audioRef = (0, import_react7.useRef)(null);
1374
+ const [internalPlaying, setInternalPlaying] = (0, import_react7.useState)(false);
1375
+ const [position, setPosition] = (0, import_react7.useState)(0);
1376
+ const [sourceDuration, setSourceDuration] = (0, import_react7.useState)(null);
1245
1377
  const isPlaying = playing != null ? playing : internalPlaying;
1246
1378
  const setPlaying = (next) => {
1247
1379
  if (playing === void 0) setInternalPlaying(next);
1248
1380
  onPlayingChange == null ? void 0 : onPlayingChange(next);
1249
1381
  };
1250
- (0, import_react6.useEffect)(() => {
1382
+ (0, import_react7.useEffect)(() => {
1251
1383
  if (src || !isPlaying) return void 0;
1252
1384
  const timer = window.setInterval(() => {
1253
1385
  setPosition((value) => value + 0.1);
1254
1386
  }, 100);
1255
1387
  return () => window.clearInterval(timer);
1256
1388
  }, [isPlaying, src]);
1257
- (0, import_react6.useEffect)(() => {
1389
+ (0, import_react7.useEffect)(() => {
1258
1390
  if (src || !isPlaying) return;
1259
1391
  if (position >= duration) {
1260
1392
  setPlaying(false);
1261
1393
  setPosition(0);
1262
1394
  }
1263
1395
  }, [duration, isPlaying, position, src]);
1264
- (0, import_react6.useEffect)(() => {
1396
+ (0, import_react7.useEffect)(() => {
1265
1397
  const audio = audioRef.current;
1266
1398
  if (!audio || !src) return void 0;
1267
1399
  const onTime = () => setPosition(audio.currentTime);
@@ -1307,7 +1439,7 @@ function AudioBar({
1307
1439
  }
1308
1440
  };
1309
1441
  const total = src ? sourceDuration != null ? sourceDuration : duration : duration;
1310
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1442
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1311
1443
  "div",
1312
1444
  {
1313
1445
  className: classNames(
@@ -1317,22 +1449,22 @@ function AudioBar({
1317
1449
  className
1318
1450
  ),
1319
1451
  children: [
1320
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1452
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1321
1453
  "button",
1322
1454
  {
1323
1455
  type: "button",
1324
1456
  className: "rqk-audio-bar-play",
1325
1457
  onClick: handleToggle,
1326
1458
  "aria-label": isPlaying ? "\u6682\u505C" : "\u64AD\u653E",
1327
- children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PauseIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PlayIcon, { size: 18 })
1459
+ children: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PauseIcon, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PlayIcon, { size: 18 })
1328
1460
  }
1329
1461
  ),
1330
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "rqk-audio-bar-main", children: [
1331
- label ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "rqk-audio-bar-label", children: label }) : null,
1332
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "rqk-audio-bar-wave", "aria-hidden": true, children: WAVE_BARS.map((height, barIndex) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { height: `${height}px` } }, barIndex)) })
1462
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rqk-audio-bar-main", children: [
1463
+ label ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rqk-audio-bar-label", children: label }) : null,
1464
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rqk-audio-bar-wave", "aria-hidden": true, children: WAVE_BARS.map((height, barIndex) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { height: `${height}px` } }, barIndex)) })
1333
1465
  ] }),
1334
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "rqk-audio-bar-time", children: formatTime(isPlaying ? position : total) }),
1335
- src ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("audio", { ref: audioRef, src, preload: "metadata" }) : null
1466
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "rqk-audio-bar-time", children: formatTime(isPlaying ? position : total) }),
1467
+ src ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("audio", { ref: audioRef, src, preload: "metadata" }) : null
1336
1468
  ]
1337
1469
  }
1338
1470
  );
@@ -1340,74 +1472,7 @@ function AudioBar({
1340
1472
 
1341
1473
  // src/primitives/picture-box.tsx
1342
1474
  var import_react8 = require("react");
1343
-
1344
- // src/art/illustrations.tsx
1345
- var import_react7 = require("react");
1346
-
1347
- // src/assets/svg/art-apple.svg
1348
- var art_apple_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#FF8A8A"></stop><stop offset="1" stop-color="#E5484D"></stop></linearGradient></defs><circle cx="57" cy="66" r="32" fill="url(#rqk-grad)"></circle><circle cx="72" cy="70" r="25" fill="url(#rqk-grad)" opacity="0.92"></circle><ellipse cx="47" cy="52" rx="7" ry="10" fill="#FFFFFF" opacity="0.4" transform="rotate(-24 47 52)"></ellipse><path d="M64 36c0-6 3-10 8-12" stroke="#8B5E34" stroke-width="3" stroke-linecap="round" fill="none"></path><path d="M68 34c2-8 12-11 20-7-2 8-12 11-20 7z" fill="#3ED598"></path></svg>\n';
1349
-
1350
- // src/assets/svg/art-balloon.svg
1351
- var art_balloon_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0.2" y1="0" x2="0.8" y2="1"><stop offset="0" stop-color="#7FB0FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient></defs><ellipse cx="60" cy="50" rx="28" ry="32" fill="url(#rqk-grad)"></ellipse><ellipse cx="50" cy="38" rx="7" ry="9" fill="#FFFFFF" opacity="0.45"></ellipse><path d="M60 82l3 6h-6z" fill="#0147CC"></path><path d="M60 88c8 6-8 10 0 16s-8 8 0 12" stroke="#0147CC" stroke-width="2.2" fill="none" stroke-linecap="round"></path><circle cx="94" cy="30" r="4" fill="#FFD166"></circle><circle cx="22" cy="86" r="3" fill="#7C5CFF" opacity="0.6"></circle></svg>\n';
1352
-
1353
- // src/assets/svg/art-books.svg
1354
- var art_books_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><rect x="20" y="80" width="80" height="16" rx="5" fill="#0158FD"></rect><rect x="26" y="62" width="68" height="16" rx="5" fill="#3ED598"></rect><rect x="22" y="44" width="72" height="16" rx="5" fill="#FFB020"></rect><rect x="32" y="26" width="58" height="16" rx="5" fill="#7C5CFF"></rect><path d="M34 34h54M28 52h60M32 70h56M26 88h68" stroke="#FFFFFF" stroke-width="2.4" opacity="0.35" stroke-linecap="round"></path><circle cx="88" cy="22" r="5" fill="#9CBFFF" opacity="0.7"></circle></svg>\n';
1355
-
1356
- // src/assets/svg/art-cat.svg
1357
- var art_cat_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#FFC48A"></stop><stop offset="1" stop-color="#F09A4F"></stop></linearGradient></defs><path d="M36 42l-6-20 18 8zM84 42l6-20-18 8z" fill="url(#rqk-grad)"></path><circle cx="60" cy="66" r="34" fill="url(#rqk-grad)"></circle><ellipse cx="60" cy="82" rx="18" ry="13" fill="#FFF3E4"></ellipse><circle cx="48" cy="62" r="3.4" fill="#5B3A22"></circle><circle cx="72" cy="62" r="3.4" fill="#5B3A22"></circle><path d="M55 74h10l-5 5z" fill="#F08A8A"></path><path d="M56 83c1.6 1.8 6.4 1.8 8 0" stroke="#5B3A22" stroke-width="1.8" fill="none"></path><path d="M22 68h14M24 76h12M98 68h-14M96 76h-12" stroke="#E7C39F" stroke-width="2" stroke-linecap="round"></path></svg>\n';
1358
-
1359
- // src/assets/svg/art-coffee.svg
1360
- var art_coffee_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#FFFFFF"></stop><stop offset="1" stop-color="#E7EEFA"></stop></linearGradient></defs><ellipse cx="58" cy="90" rx="34" ry="6" fill="#DCE6F7"></ellipse><path d="M30 50h50l-5 34c-.6 4-4 7-8 7H43c-4 0-7.4-3-8-7z" fill="url(#rqk-grad)"></path><path d="M80 58h6a9 9 0 010 18h-3" stroke="#C3D2E8" stroke-width="4" fill="none"></path><rect x="34" y="58" width="42" height="14" rx="4" fill="#D6E2F5"></rect><path d="M48 42c-4-7 4-9 0-16M62 42c-4-7 4-9 0-16" stroke="#9CBFFF" stroke-width="3" fill="none" stroke-linecap="round" opacity="0.8"></path><circle cx="88" cy="34" r="4" fill="#FFB020" opacity="0.7"></circle></svg>\n';
1361
-
1362
- // src/assets/svg/art-headphones.svg
1363
- var art_headphones_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 186" fill="none" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad-a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#5C96FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient><linearGradient id="rqk-grad-b" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3D7BFF"></stop><stop offset="1" stop-color="#013AA6"></stop></linearGradient></defs><ellipse cx="120" cy="162" rx="48" ry="8" fill="#0B1220" opacity="0.07"></ellipse><path d="M62 112V94c0-32 26-56 58-56s58 24 58 56v18" stroke="url(#rqk-grad-a)" stroke-width="15" stroke-linecap="round"></path><path d="M62 112V94c0-32 26-56 58-56s58 24 58 56v18" stroke="#fff" stroke-width="4" stroke-linecap="round" opacity="0.35"></path><rect x="46" y="102" width="34" height="52" rx="17" fill="url(#rqk-grad-b)"></rect><rect x="160" y="102" width="34" height="52" rx="17" fill="url(#rqk-grad-b)"></rect><rect x="54" y="112" width="18" height="32" rx="9" fill="#fff" opacity="0.25"></rect><rect x="168" y="112" width="18" height="32" rx="9" fill="#fff" opacity="0.25"></rect><g stroke="#0158FD" stroke-width="3" stroke-linecap="round" opacity="0.5"><path d="M198 74c8 6 12 14 12 22M206 62c12 9 18 21 18 34"></path></g></svg>\n';
1364
-
1365
- // src/assets/svg/art-kid.svg
1366
- var art_kid_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#4F8BFF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient></defs><circle cx="60" cy="58" r="46" fill="#EAF1FF"></circle><path d="M22 104c0-15 17-24 38-24s38 9 38 24z" fill="url(#rqk-grad)"></path><circle cx="60" cy="52" r="25" fill="#FFD3B6"></circle><path d="M36 47c0-13 10-21 24-21s24 8 24 21c-6-4-13-6-24-6s-18 2-24 6z" fill="#1F2A44"></path><circle cx="51" cy="53" r="2.6" fill="#1F2A44"></circle><circle cx="69" cy="53" r="2.6" fill="#1F2A44"></circle><path d="M54 62c2.6 3 9.4 3 12 0" stroke="#C96A5A" stroke-width="2.4" stroke-linecap="round" fill="none"></path><circle cx="43" cy="60" r="3.4" fill="#FFB4A8" opacity="0.6"></circle><circle cx="77" cy="60" r="3.4" fill="#FFB4A8" opacity="0.6"></circle></svg>\n';
1367
-
1368
- // src/assets/svg/art-screen.svg
1369
- var art_screen_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 186" fill="none" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad-play" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#5C96FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient><linearGradient id="rqk-grad-screen" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#EAF2FF"></stop><stop offset="1" stop-color="#C6DBFF"></stop></linearGradient></defs><ellipse cx="120" cy="166" rx="52" ry="8" fill="#0B1220" opacity="0.07"></ellipse><rect x="42" y="32" width="156" height="104" rx="16" fill="url(#rqk-grad-screen)" stroke="#B9D0FF" stroke-width="2"></rect><rect x="52" y="42" width="136" height="84" rx="10" fill="#0B1220" opacity="0.06"></rect><circle cx="120" cy="84" r="26" fill="url(#rqk-grad-play)"></circle><path d="M113 73l20 11-20 11V73z" fill="#fff"></path><rect x="106" y="136" width="28" height="16" fill="#C6DBFF"></rect><rect x="84" y="150" width="72" height="8" rx="4" fill="#B9D0FF"></rect><g fill="#0158FD" opacity="0.5"><circle cx="62" cy="52" r="2.6"></circle><circle cx="70" cy="52" r="2.6"></circle><circle cx="78" cy="52" r="2.6"></circle></g></svg>\n';
1370
-
1371
- // src/assets/svg/art-speech.svg
1372
- var art_speech_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#EAF1FF"></stop><stop offset="1" stop-color="#C6DBFF"></stop></linearGradient></defs><path d="M24 34h72a8 8 0 018 8v34a8 8 0 01-8 8H60l-16 14v-14H24a8 8 0 01-8-8V42a8 8 0 018-8z" fill="url(#rqk-grad)"></path><rect x="38" y="52" width="7" height="18" rx="3.5" fill="#0158FD"></rect><rect x="51" y="44" width="7" height="34" rx="3.5" fill="#4F8BFF"></rect><rect x="64" y="48" width="7" height="26" rx="3.5" fill="#4F8BFF"></rect><rect x="77" y="58" width="7" height="10" rx="3.5" fill="#9CBFFF"></rect></svg>\n';
1373
-
1374
- // src/assets/svg/art-trophy.svg
1375
- var art_trophy_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#FFE29A"></stop><stop offset="0.55" stop-color="#FFC24B"></stop><stop offset="1" stop-color="#E08A00"></stop></linearGradient></defs><circle cx="60" cy="54" r="42" fill="#FFF7E6"></circle><path d="M38 34h44v18c0 14-9 22-22 22s-22-8-22-22z" fill="url(#rqk-grad)"></path><path d="M38 40H28v4c0 9 6 15 14 15M82 40h10v4c0 9-6 15-14 15" stroke="#E08A00" stroke-width="3.4" fill="none"></path><rect x="52" y="72" width="16" height="10" fill="#F0A600"></rect><rect x="44" y="82" width="32" height="9" rx="3" fill="#E08A00"></rect><path d="M60 44l3 6 7 1-5 5 1 7-6-3-6 3 1-7-5-5 7-1z" fill="#FFF7E6" opacity="0.9"></path><circle cx="90" cy="30" r="3.4" fill="#FFB020" opacity="0.8"></circle><circle cx="26" cy="76" r="2.6" fill="#7C5CFF" opacity="0.6"></circle></svg>\n';
1376
-
1377
- // src/art/illustrations.tsx
1378
- var import_jsx_runtime16 = require("react/jsx-runtime");
1379
- var ART_SOURCES = {
1380
- kid: art_kid_default,
1381
- balloon: art_balloon_default,
1382
- apple: art_apple_default,
1383
- coffee: art_coffee_default,
1384
- cat: art_cat_default,
1385
- books: art_books_default,
1386
- headphones: art_headphones_default,
1387
- screen: art_screen_default,
1388
- trophy: art_trophy_default,
1389
- speech: art_speech_default
1390
- };
1391
- function Art({ name, className, size }) {
1392
- var _a;
1393
- const unique = (0, import_react7.useId)().replace(/[^a-zA-Z0-9]/g, "");
1394
- const source = ((_a = ART_SOURCES[name]) != null ? _a : art_speech_default).replace(
1395
- /rqk-grad/g,
1396
- `rqk-grad-${unique}`
1397
- );
1398
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1399
- "span",
1400
- {
1401
- className: ["rqk-art", className].filter(Boolean).join(" "),
1402
- style: size ? { width: size, height: size } : void 0,
1403
- "aria-hidden": true,
1404
- dangerouslySetInnerHTML: { __html: source }
1405
- }
1406
- );
1407
- }
1408
-
1409
- // src/primitives/picture-box.tsx
1410
- var import_jsx_runtime17 = require("react/jsx-runtime");
1475
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1411
1476
  function PictureBox({
1412
1477
  src,
1413
1478
  alt = "",
@@ -1425,7 +1490,7 @@ function PictureBox({
1425
1490
  setLoaded(false);
1426
1491
  }, [src]);
1427
1492
  const resolved = state != null ? state : src ? failed ? "fail" : loaded ? "ok" : "loading" : "default";
1428
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
1493
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
1429
1494
  "div",
1430
1495
  {
1431
1496
  className: classNames(
@@ -1436,7 +1501,7 @@ function PictureBox({
1436
1501
  style: { aspectRatio: ratio },
1437
1502
  "data-state": resolved,
1438
1503
  children: [
1439
- src && resolved !== "fail" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1504
+ src && resolved !== "fail" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1440
1505
  "img",
1441
1506
  {
1442
1507
  src,
@@ -1445,9 +1510,9 @@ function PictureBox({
1445
1510
  onError: () => setFailed(true)
1446
1511
  }
1447
1512
  ) : null,
1448
- resolved === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "rqk-picture-skeleton", "aria-hidden": true }) : null,
1449
- resolved === "default" || resolved === "fail" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "rqk-picture-fallback", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Art, { name: art }) }) : null,
1450
- resolved === "fail" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1513
+ resolved === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rqk-picture-skeleton", "aria-hidden": true }) : null,
1514
+ resolved === "default" || resolved === "fail" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rqk-picture-fallback", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Art, { name: art }) }) : null,
1515
+ resolved === "fail" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1451
1516
  "button",
1452
1517
  {
1453
1518
  type: "button",
@@ -1456,19 +1521,19 @@ function PictureBox({
1456
1521
  children: "\u91CD\u65B0\u52A0\u8F7D"
1457
1522
  }
1458
1523
  ) : null,
1459
- caption ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "rqk-picture-caption", children: caption }) : null
1524
+ caption ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "rqk-picture-caption", children: caption }) : null
1460
1525
  ]
1461
1526
  }
1462
1527
  );
1463
1528
  }
1464
1529
 
1465
1530
  // src/questions/single-choice/stem-card.tsx
1466
- var import_jsx_runtime18 = require("react/jsx-runtime");
1531
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1467
1532
  function SingleChoiceStem({ data }) {
1468
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Card, { className: "rqk-stem-card", children: [
1469
- data.stemImage ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PictureBox, { src: data.stemImage, art: "books", ratio: "16 / 9", alt: "\u9898\u5E72\u914D\u56FE" }) : null,
1470
- data.stemAudio ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AudioBar, { src: data.stemAudio }) : null,
1471
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "rqk-stem", children: data.stem })
1533
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Card, { className: "rqk-stem-card", children: [
1534
+ data.stemImage ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PictureBox, { src: data.stemImage, art: "books", ratio: "16 / 9", alt: "\u9898\u5E72\u914D\u56FE" }) : null,
1535
+ data.stemAudio ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AudioBar, { src: data.stemAudio }) : null,
1536
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "rqk-stem", children: data.stem })
1472
1537
  ] });
1473
1538
  }
1474
1539
 
@@ -1503,7 +1568,7 @@ var speakWithSynthesis = (text, opts) => {
1503
1568
  };
1504
1569
 
1505
1570
  // src/questions/single-choice/use-single-choice.tsx
1506
- var import_jsx_runtime19 = require("react/jsx-runtime");
1571
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1507
1572
  function useSingleChoice({
1508
1573
  data,
1509
1574
  mode,
@@ -1554,7 +1619,7 @@ function useSingleChoice({
1554
1619
  answer: selected
1555
1620
  });
1556
1621
  }, [judge, onSubmit, selected]);
1557
- const answerLabel = (_b = data.answerLabel) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
1622
+ const answerLabel = (_b = data.answerLabel) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
1558
1623
  optionLetter(data.answer),
1559
1624
  ". ",
1560
1625
  (_a = data.options[data.answer]) == null ? void 0 : _a.text
@@ -1590,7 +1655,7 @@ function useSingleChoice({
1590
1655
  }
1591
1656
 
1592
1657
  // src/questions/single-choice/index.tsx
1593
- var import_jsx_runtime20 = require("react/jsx-runtime");
1658
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1594
1659
  function SingleChoice({
1595
1660
  data,
1596
1661
  mode = "answer",
@@ -1616,7 +1681,7 @@ function SingleChoice({
1616
1681
  onSubmit: model.handleSubmit,
1617
1682
  onRetry: model.judge.retry
1618
1683
  });
1619
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1684
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1620
1685
  QuestShell,
1621
1686
  {
1622
1687
  mode,
@@ -1627,7 +1692,7 @@ function SingleChoice({
1627
1692
  onBack,
1628
1693
  className: classNames("rqk-quest", className),
1629
1694
  dataQuest: "single-choice",
1630
- feedback: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1695
+ feedback: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1631
1696
  SingleChoiceFeedback,
1632
1697
  {
1633
1698
  readonly: model.readonly,
@@ -1637,10 +1702,10 @@ function SingleChoice({
1637
1702
  answerLabel: model.answerLabel
1638
1703
  }
1639
1704
  ),
1640
- footer: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ActionBar, { actions, index, onPrev }),
1641
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
1642
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SingleChoiceStem, { data }),
1643
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1705
+ footer: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ActionBar, { actions, index, total, onPrev }),
1706
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
1707
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SingleChoiceStem, { data }),
1708
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1644
1709
  SingleChoiceOptions,
1645
1710
  {
1646
1711
  data,
@@ -1709,7 +1774,7 @@ function followArt(data) {
1709
1774
  }
1710
1775
 
1711
1776
  // src/questions/follow-read/follow-content.tsx
1712
- var import_jsx_runtime21 = require("react/jsx-runtime");
1777
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1713
1778
  function FollowContent({
1714
1779
  data,
1715
1780
  stage,
@@ -1719,10 +1784,10 @@ function FollowContent({
1719
1784
  startBadgeVisible
1720
1785
  }) {
1721
1786
  var _a, _b, _c, _d, _e, _f, _g, _h;
1722
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rqk-follow-card flex flex-col gap-3", children: [
1723
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rqk-follow-stage", children: [
1724
- art ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Art, { name: art, className: "rqk-follow-art" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "rqk-follow-no-image", role: "img", "aria-label": "No image", children: [
1725
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
1787
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "rqk-follow-card flex flex-col gap-3", children: [
1788
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "rqk-follow-stage", children: [
1789
+ art ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Art, { name: art, className: "rqk-follow-art" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { className: "rqk-follow-no-image", role: "img", "aria-label": "No image", children: [
1790
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1726
1791
  "svg",
1727
1792
  {
1728
1793
  className: "rqk-follow-no-image-icon",
@@ -1730,7 +1795,7 @@ function FollowContent({
1730
1795
  fill: "none",
1731
1796
  "aria-hidden": true,
1732
1797
  children: [
1733
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1798
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1734
1799
  "rect",
1735
1800
  {
1736
1801
  x: "7",
@@ -1742,8 +1807,8 @@ function FollowContent({
1742
1807
  strokeWidth: "2"
1743
1808
  }
1744
1809
  ),
1745
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("circle", { cx: "17", cy: "19", r: "3", fill: "currentColor", opacity: "0.45" }),
1746
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1810
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("circle", { cx: "17", cy: "19", r: "3", fill: "currentColor", opacity: "0.45" }),
1811
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1747
1812
  "path",
1748
1813
  {
1749
1814
  d: "M10 34l9-9 7 7 6-6 8 8",
@@ -1753,7 +1818,7 @@ function FollowContent({
1753
1818
  strokeLinejoin: "round"
1754
1819
  }
1755
1820
  ),
1756
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1821
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1757
1822
  "path",
1758
1823
  {
1759
1824
  d: "M11 8l27 32",
@@ -1765,24 +1830,24 @@ function FollowContent({
1765
1830
  ]
1766
1831
  }
1767
1832
  ),
1768
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "rqk-follow-no-image-text", children: "No image" })
1833
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "rqk-follow-no-image-text", children: "No image" })
1769
1834
  ] }),
1770
- startBadgeVisible ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "rqk-follow-start", children: "\u51C6\u5907\u5F00\u59CB\u8DDF\u8BFB" }) : null
1835
+ startBadgeVisible ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "rqk-follow-start", children: "\u51C6\u5907\u5F00\u59CB\u8DDF\u8BFB" }) : null
1771
1836
  ] }),
1772
- data.kind === "word" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Card, { className: "rqk-follow-word", children: [
1773
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "rqk-follow-word-text", children: (_a = data.word) == null ? void 0 : _a.text }),
1774
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rqk-follow-word-meta", children: [
1775
- ((_b = data.word) == null ? void 0 : _b.phonetic) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "rqk-follow-phonetic", children: data.word.phonetic }) : null,
1776
- ((_c = data.word) == null ? void 0 : _c.partOfSpeech) || ((_d = data.word) == null ? void 0 : _d.meaning) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rqk-follow-pos-line", children: [
1777
- ((_e = data.word) == null ? void 0 : _e.partOfSpeech) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "rqk-follow-pos", children: data.word.partOfSpeech }) : null,
1778
- ((_f = data.word) == null ? void 0 : _f.meaning) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "rqk-follow-meaning", children: data.word.meaning }) : null
1837
+ data.kind === "word" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Card, { className: "rqk-follow-word", children: [
1838
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rqk-follow-word-text", children: (_a = data.word) == null ? void 0 : _a.text }),
1839
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "rqk-follow-word-meta", children: [
1840
+ ((_b = data.word) == null ? void 0 : _b.phonetic) ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "rqk-follow-phonetic", children: data.word.phonetic }) : null,
1841
+ ((_c = data.word) == null ? void 0 : _c.partOfSpeech) || ((_d = data.word) == null ? void 0 : _d.meaning) ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "rqk-follow-pos-line", children: [
1842
+ ((_e = data.word) == null ? void 0 : _e.partOfSpeech) ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "rqk-follow-pos", children: data.word.partOfSpeech }) : null,
1843
+ ((_f = data.word) == null ? void 0 : _f.meaning) ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "rqk-follow-meaning", children: data.word.meaning }) : null
1779
1844
  ] }) : null
1780
1845
  ] })
1781
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rqk-follow-word rqk-follow-sentence-box", children: [
1782
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "rqk-follow-sentence", children: (_g = data.sentence) == null ? void 0 : _g.words.map((word, wordIndex) => {
1846
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "rqk-follow-word rqk-follow-sentence-box", children: [
1847
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rqk-follow-sentence", children: (_g = data.sentence) == null ? void 0 : _g.words.map((word, wordIndex) => {
1783
1848
  var _a2;
1784
1849
  const score = (_a2 = wordScores[wordIndex]) == null ? void 0 : _a2.score;
1785
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1850
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1786
1851
  "span",
1787
1852
  {
1788
1853
  className: classNames(
@@ -1794,32 +1859,32 @@ function FollowContent({
1794
1859
  `${word}-${wordIndex}`
1795
1860
  );
1796
1861
  }) }),
1797
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rqk-follow-legend", children: [
1798
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
1799
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", { className: "rqk-follow-legend-ok", children: "\u7EFF" }),
1862
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "rqk-follow-legend", children: [
1863
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { children: [
1864
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", { className: "rqk-follow-legend-ok", children: "\u7EFF" }),
1800
1865
  " \u226580"
1801
1866
  ] }),
1802
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
1803
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", { className: "rqk-follow-legend-warn", children: "\u9EC4" }),
1867
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { children: [
1868
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", { className: "rqk-follow-legend-warn", children: "\u9EC4" }),
1804
1869
  " 60\u201380"
1805
1870
  ] }),
1806
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { children: [
1807
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("i", { className: "rqk-follow-legend-bad", children: "\u7EA2" }),
1871
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { children: [
1872
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("i", { className: "rqk-follow-legend-bad", children: "\u7EA2" }),
1808
1873
  " <60"
1809
1874
  ] })
1810
1875
  ] }),
1811
- ((_h = data.sentence) == null ? void 0 : _h.translation) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "rqk-follow-translation", children: data.sentence.translation }) : null
1876
+ ((_h = data.sentence) == null ? void 0 : _h.translation) ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rqk-follow-translation", children: data.sentence.translation }) : null
1812
1877
  ] }),
1813
- stage === "scoring" && !readonly ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "rqk-follow-scoring", "aria-live": "polite", children: [
1814
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "rqk-follow-spinner", "aria-hidden": true }),
1815
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "\u8BC4\u5206\u4E2D\u2026" })
1878
+ stage === "scoring" && !readonly ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "rqk-follow-scoring", "aria-live": "polite", children: [
1879
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "rqk-follow-spinner", "aria-hidden": true }),
1880
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: "\u8BC4\u5206\u4E2D\u2026" })
1816
1881
  ] }) : null
1817
1882
  ] });
1818
1883
  }
1819
1884
 
1820
1885
  // src/primitives/celebration.tsx
1821
1886
  var import_react10 = require("react");
1822
- var import_jsx_runtime22 = require("react/jsx-runtime");
1887
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1823
1888
  var CONFETTI_COLORS = [
1824
1889
  "var(--rqk-gold)",
1825
1890
  "#ff6b6b",
@@ -1854,15 +1919,15 @@ function Celebration({
1854
1919
  return () => window.clearTimeout(timer);
1855
1920
  }, [autoHideMs, grade]);
1856
1921
  if (hidden) return null;
1857
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: classNames("rqk-celebrate", className), "data-grade": grade, role: "status", children: [
1858
- withConfetti ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rqk-confetti", "aria-hidden": true, children: Array.from({ length: CONFETTI_COUNT }).map((_, index) => {
1922
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: classNames("rqk-celebrate", className), "data-grade": grade, role: "status", children: [
1923
+ withConfetti ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "rqk-confetti", "aria-hidden": true, children: Array.from({ length: CONFETTI_COUNT }).map((_, index) => {
1859
1924
  const x = 4 + index * 37 % 93;
1860
1925
  const y = 8 + index * 11 % 26;
1861
1926
  const delay = index * 7 % 6 * 0.07;
1862
1927
  const duration = 1.1 + index * 5 % 7 * 0.1;
1863
1928
  const spin = 180 + index * 41 % 180;
1864
1929
  const drift = index * 13 % 48 - 24;
1865
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1930
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1866
1931
  "span",
1867
1932
  {
1868
1933
  className: "rqk-confetti-piece",
@@ -1881,16 +1946,16 @@ function Celebration({
1881
1946
  index
1882
1947
  );
1883
1948
  }) }) : null,
1884
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StarRating, { value: config.stars, size: 26, animate: true }),
1885
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rqk-celebrate-title", children: title != null ? title : config.title }),
1886
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rqk-celebrate-ribbon", children: ribbon != null ? ribbon : config.ribbon }),
1887
- note ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "rqk-celebrate-note", children: note }) : null
1949
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StarRating, { value: config.stars, size: 26, animate: true }),
1950
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "rqk-celebrate-title", children: title != null ? title : config.title }),
1951
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "rqk-celebrate-ribbon", children: ribbon != null ? ribbon : config.ribbon }),
1952
+ note ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "rqk-celebrate-note", children: note }) : null
1888
1953
  ] });
1889
1954
  }
1890
1955
 
1891
1956
  // src/primitives/record-cluster.tsx
1892
1957
  var import_react11 = require("react");
1893
- var import_jsx_runtime23 = require("react/jsx-runtime");
1958
+ var import_jsx_runtime24 = require("react/jsx-runtime");
1894
1959
  function formatClock(value) {
1895
1960
  const total = Math.max(0, Math.floor(value));
1896
1961
  return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
@@ -1953,9 +2018,9 @@ function RecordCluster({
1953
2018
  else start();
1954
2019
  };
1955
2020
  const statusText = hint != null ? hint : recording ? "\u6B63\u5728\u5F55\u97F3 \xB7 \u70B9\u51FB\u7ED3\u675F" : scoring ? "\u8BC4\u5206\u4E2D\u2026" : state === "done" ? "\u91CD\u65B0\u5F55\u97F3" : "\u70B9\u51FB\u8DDF\u8BFB";
1956
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: classNames("rqk-record-cluster", className), children: [
1957
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "rqk-record-row", children: [
1958
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2021
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: classNames("rqk-record-cluster", className), children: [
2022
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "rqk-record-row", children: [
2023
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
1959
2024
  "button",
1960
2025
  {
1961
2026
  type: "button",
@@ -1967,14 +2032,14 @@ function RecordCluster({
1967
2032
  "aria-label": "\u64AD\u653E\u8303\u8BFB",
1968
2033
  "aria-pressed": activeSide === "demo",
1969
2034
  children: [
1970
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "rqk-record-side-icon", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SpeakerIcon, { size: 22 }) }),
1971
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "rqk-record-side-label", children: "\u53D1\u97F3" })
2035
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "rqk-record-side-icon", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SpeakerIcon, { size: 22 }) }),
2036
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "rqk-record-side-label", children: "\u53D1\u97F3" })
1972
2037
  ]
1973
2038
  }
1974
2039
  ),
1975
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "rqk-record-main", children: [
1976
- recording ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("svg", { className: "rqk-record-ring", viewBox: "0 0 100 100", "aria-hidden": true, children: [
1977
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2040
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "rqk-record-main", children: [
2041
+ recording ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("svg", { className: "rqk-record-ring", viewBox: "0 0 100 100", "aria-hidden": true, children: [
2042
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1978
2043
  "circle",
1979
2044
  {
1980
2045
  className: "rqk-record-ring-track",
@@ -1984,9 +2049,9 @@ function RecordCluster({
1984
2049
  strokeDasharray: "283"
1985
2050
  }
1986
2051
  ),
1987
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: "50", cy: "50", r: "45", strokeDasharray: "283", strokeDashoffset: ringOffset })
2052
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("circle", { cx: "50", cy: "50", r: "45", strokeDasharray: "283", strokeDashoffset: ringOffset })
1988
2053
  ] }) : null,
1989
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2054
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1990
2055
  "button",
1991
2056
  {
1992
2057
  type: "button",
@@ -1995,11 +2060,11 @@ function RecordCluster({
1995
2060
  disabled: disabled || scoring,
1996
2061
  "aria-label": recording ? "\u7ED3\u675F\u5F55\u97F3" : "\u5F00\u59CB\u5F55\u97F3",
1997
2062
  "aria-pressed": recording,
1998
- children: recording ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "rqk-record-stop", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MicIcon, { size: 30 })
2063
+ children: recording ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "rqk-record-stop", "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MicIcon, { size: 30 })
1999
2064
  }
2000
2065
  )
2001
2066
  ] }),
2002
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2067
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2003
2068
  "button",
2004
2069
  {
2005
2070
  type: "button",
@@ -2011,35 +2076,35 @@ function RecordCluster({
2011
2076
  "aria-label": "\u64AD\u653E\u6211\u7684\u5F55\u97F3",
2012
2077
  "aria-pressed": activeSide === "mine",
2013
2078
  children: [
2014
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "rqk-record-side-icon", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PlayIcon, { size: 20 }) }),
2015
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "rqk-record-side-label", children: "\u6211\u7684" })
2079
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "rqk-record-side-icon", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PlayIcon, { size: 20 }) }),
2080
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "rqk-record-side-label", children: "\u6211\u7684" })
2016
2081
  ]
2017
2082
  }
2018
2083
  )
2019
2084
  ] }),
2020
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2085
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2021
2086
  "div",
2022
2087
  {
2023
2088
  className: classNames("rqk-record-status", hintTone !== "default" && `rqk-is-${hintTone}`),
2024
2089
  children: [
2025
- recording ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
2026
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "rqk-record-status-timer", children: [
2090
+ recording ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
2091
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "rqk-record-status-timer", children: [
2027
2092
  formatClock(seconds),
2028
2093
  " / ",
2029
2094
  formatClock(maxSeconds)
2030
2095
  ] }),
2031
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "rqk-record-status-sep", "aria-hidden": true, children: "\xB7" })
2096
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "rqk-record-status-sep", "aria-hidden": true, children: "\xB7" })
2032
2097
  ] }) : null,
2033
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: statusText })
2098
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: statusText })
2034
2099
  ]
2035
2100
  }
2036
2101
  ),
2037
- detail ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: classNames("rqk-record-detail", detailTone === "bad" && "rqk-is-bad"), children: detail }) : null
2102
+ detail ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: classNames("rqk-record-detail", detailTone === "bad" && "rqk-is-bad"), children: detail }) : null
2038
2103
  ] });
2039
2104
  }
2040
2105
 
2041
2106
  // src/questions/follow-read/follow-controls.tsx
2042
- var import_jsx_runtime24 = require("react/jsx-runtime");
2107
+ var import_jsx_runtime25 = require("react/jsx-runtime");
2043
2108
  function FollowControls({
2044
2109
  grade,
2045
2110
  ribbon,
@@ -2059,9 +2124,9 @@ function FollowControls({
2059
2124
  onPlayDemo
2060
2125
  }) {
2061
2126
  const gradeValue = grade && grade !== "noise" ? grade : "again";
2062
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "rqk-follow-bottom", children: [
2063
- grade && grade !== "noise" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Celebration, { grade: gradeValue, ribbon, autoHideMs: 3200 }) : null,
2064
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2127
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "rqk-follow-bottom", children: [
2128
+ grade && grade !== "noise" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Celebration, { grade: gradeValue, ribbon, autoHideMs: 3200 }) : null,
2129
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2065
2130
  RecordCluster,
2066
2131
  {
2067
2132
  state: readonly ? "idle" : recordState2,
@@ -2357,7 +2422,7 @@ function useFollowRead({
2357
2422
  }
2358
2423
 
2359
2424
  // src/questions/follow-read/index.tsx
2360
- var import_jsx_runtime25 = require("react/jsx-runtime");
2425
+ var import_jsx_runtime26 = require("react/jsx-runtime");
2361
2426
  function FollowRead({
2362
2427
  data,
2363
2428
  mode = "answer",
@@ -2392,13 +2457,13 @@ function FollowRead({
2392
2457
  onNext
2393
2458
  });
2394
2459
  const displayTitle = title != null ? title : data.kind === "word" ? "\u5355\u8BCD\u8DDF\u8BFB" : "\u53E5\u5B50\u8DDF\u8BFB";
2395
- const instructionText = instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
2460
+ const instructionText = instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2396
2461
  "\u542C\u5355\u8BCD\u793A\u8303\uFF0C\u70B9\u51FB\u9EA6\u514B\u98CE",
2397
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("b", { children: "\u5927\u58F0\u8DDF\u8BFB" }),
2462
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("b", { children: "\u5927\u58F0\u8DDF\u8BFB" }),
2398
2463
  "\uFF0C\u81EA\u52A8\u8BC4\u5206"
2399
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
2464
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2400
2465
  "\u542C\u53E5\u5B50\u793A\u8303\uFF0C\u70B9\u51FB\u9EA6\u514B\u98CE",
2401
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("b", { children: "\u5927\u58F0\u8DDF\u8BFB" }),
2466
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("b", { children: "\u5927\u58F0\u8DDF\u8BFB" }),
2402
2467
  "\uFF0C\u9010\u8BCD\u8BC4\u5206"
2403
2468
  ] });
2404
2469
  const detail = detailHint({
@@ -2413,7 +2478,7 @@ function FollowRead({
2413
2478
  });
2414
2479
  const hasPrev = index > 1 && Boolean(onPrev);
2415
2480
  const hasFooter = actions.length > 0 || hasPrev;
2416
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2481
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2417
2482
  QuestShell,
2418
2483
  {
2419
2484
  mode,
@@ -2429,11 +2494,11 @@ function FollowRead({
2429
2494
  className
2430
2495
  ),
2431
2496
  dataQuest: "follow-read",
2432
- footer: hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ActionBar, { actions, index, onPrev }) : void 0,
2497
+ footer: hasFooter ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ActionBar, { actions, index, total, onPrev }) : void 0,
2433
2498
  children: [
2434
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
2435
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "rqk-follow-instr", children: instructionText }),
2436
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2499
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
2500
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "rqk-follow-instr", children: instructionText }),
2501
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2437
2502
  FollowContent,
2438
2503
  {
2439
2504
  data,
@@ -2444,7 +2509,7 @@ function FollowRead({
2444
2509
  startBadgeVisible: !model.readonly && model.stage === "ready"
2445
2510
  }
2446
2511
  ),
2447
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2512
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2448
2513
  FollowControls,
2449
2514
  {
2450
2515
  grade: model.grade,
@@ -2466,7 +2531,7 @@ function FollowRead({
2466
2531
  }
2467
2532
  )
2468
2533
  ] }),
2469
- model.demoFail ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FollowReadToast, { message: "\u8303\u8BFB\u52A0\u8F7D\u5931\u8D25 \xB7 \u53EF\u91CD\u8BD5 3 \u6B21" }) : null
2534
+ model.demoFail ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FollowReadToast, { message: "\u8303\u8BFB\u52A0\u8F7D\u5931\u8D25 \xB7 \u53EF\u91CD\u8BD5 3 \u6B21" }) : null
2470
2535
  ]
2471
2536
  }
2472
2537
  );
@@ -2503,7 +2568,7 @@ function linkMatchActions({
2503
2568
  }
2504
2569
 
2505
2570
  // src/questions/link-match/feedback.tsx
2506
- var import_jsx_runtime26 = require("react/jsx-runtime");
2571
+ var import_jsx_runtime27 = require("react/jsx-runtime");
2507
2572
  function LinkMatchFeedback({
2508
2573
  readonly,
2509
2574
  phase,
@@ -2512,7 +2577,7 @@ function LinkMatchFeedback({
2512
2577
  answerText
2513
2578
  }) {
2514
2579
  if (readonly) {
2515
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2580
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2516
2581
  FeedbackSheet,
2517
2582
  {
2518
2583
  tone: "ok",
@@ -2524,13 +2589,13 @@ function LinkMatchFeedback({
2524
2589
  );
2525
2590
  }
2526
2591
  if (phase === "retry") {
2527
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u8FDE\u9519\u7684\u7EBF\uFF0C\u518D\u8BD5\u4E00\u6B21", detail: "\u6B63\u786E\u7684\u8FDE\u7EBF\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
2592
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u8FDE\u9519\u7684\u7EBF\uFF0C\u518D\u8BD5\u4E00\u6B21", detail: "\u6B63\u786E\u7684\u8FDE\u7EBF\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
2528
2593
  }
2529
2594
  if (phase === "correct") {
2530
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll });
2595
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll });
2531
2596
  }
2532
2597
  if (phase === "locked") {
2533
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2598
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2534
2599
  FeedbackSheet,
2535
2600
  {
2536
2601
  tone: "bad",
@@ -2576,7 +2641,7 @@ function nodeOk(data, side, nodeIndex) {
2576
2641
  }
2577
2642
 
2578
2643
  // src/questions/link-match/link-node.tsx
2579
- var import_jsx_runtime27 = require("react/jsx-runtime");
2644
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2580
2645
  var BARS = [8, 14, 20, 10, 24, 16, 9, 18, 12];
2581
2646
  function LinkNode({
2582
2647
  side,
@@ -2593,7 +2658,7 @@ function LinkNode({
2593
2658
  }) {
2594
2659
  var _a, _b;
2595
2660
  const label = nodeLabel(node, kind, nodeIndex);
2596
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2661
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2597
2662
  "button",
2598
2663
  {
2599
2664
  type: "button",
@@ -2614,10 +2679,10 @@ function LinkNode({
2614
2679
  "aria-pressed": picked,
2615
2680
  "aria-label": label,
2616
2681
  children: [
2617
- side === "right" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rqk-link-node-marker", children: optionLetter(nodeIndex) }) : null,
2618
- kind === "image" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "rqk-link-node-media", children: [
2619
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rqk-link-node-media-fallback", children: (_a = node.imageAlt) != null ? _a : typeof node.text === "string" ? node.text : "\u56FE\u7247" }),
2620
- node.image ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2682
+ side === "right" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rqk-link-node-marker", children: optionLetter(nodeIndex) }) : null,
2683
+ kind === "image" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "rqk-link-node-media", children: [
2684
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rqk-link-node-media-fallback", children: (_a = node.imageAlt) != null ? _a : typeof node.text === "string" ? node.text : "\u56FE\u7247" }),
2685
+ node.image ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2621
2686
  "img",
2622
2687
  {
2623
2688
  className: "rqk-link-node-image-media",
@@ -2627,27 +2692,27 @@ function LinkNode({
2627
2692
  event.currentTarget.style.opacity = "0";
2628
2693
  }
2629
2694
  }
2630
- ) : node.art ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rqk-link-node-art", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Art, { name: node.art }) }) : null
2631
- ] }) : kind === "audio" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "rqk-link-node-audio", children: [
2632
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rqk-link-node-audio-icon", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rqk-link-node-audio-triangle" }) }),
2633
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rqk-link-node-wave", "aria-hidden": true, children: BARS.map((height, barIndex) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { style: { height } }, barIndex)) })
2634
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
2635
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rqk-link-node-text", children: node.text }),
2636
- node.phonetic ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rqk-link-node-sub", children: node.phonetic }) : null,
2637
- node.speak || node.audio ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "rqk-link-node-sound", "aria-hidden": true, children: [
2638
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", {}),
2639
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", {}),
2640
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", {})
2695
+ ) : node.art ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rqk-link-node-art", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Art, { name: node.art }) }) : null
2696
+ ] }) : kind === "audio" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "rqk-link-node-audio", children: [
2697
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rqk-link-node-audio-icon", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rqk-link-node-audio-triangle" }) }),
2698
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rqk-link-node-wave", "aria-hidden": true, children: BARS.map((height, barIndex) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { style: { height } }, barIndex)) })
2699
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
2700
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rqk-link-node-text", children: node.text }),
2701
+ node.phonetic ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rqk-link-node-sub", children: node.phonetic }) : null,
2702
+ node.speak || node.audio ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "rqk-link-node-sound", "aria-hidden": true, children: [
2703
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", {}),
2704
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", {}),
2705
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", {})
2641
2706
  ] }) : null
2642
2707
  ] }),
2643
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rqk-link-dot", "aria-hidden": true })
2708
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "rqk-link-dot", "aria-hidden": true })
2644
2709
  ]
2645
2710
  }
2646
2711
  );
2647
2712
  }
2648
2713
 
2649
2714
  // src/questions/link-match/link-board.tsx
2650
- var import_jsx_runtime28 = require("react/jsx-runtime");
2715
+ var import_jsx_runtime29 = require("react/jsx-runtime");
2651
2716
  function LinkBoard({
2652
2717
  data,
2653
2718
  leftKind,
@@ -2665,7 +2730,7 @@ function LinkBoard({
2665
2730
  readonly,
2666
2731
  onNode
2667
2732
  }) {
2668
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
2733
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
2669
2734
  "div",
2670
2735
  {
2671
2736
  className: classNames("rqk-link-board", `rqk-link-board-h-${boardHeightKind}`),
@@ -2673,7 +2738,7 @@ function LinkBoard({
2673
2738
  boardRef.current = element;
2674
2739
  },
2675
2740
  children: [
2676
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("svg", { className: "rqk-link-lines", width: size.width, height: size.height, "aria-hidden": true, children: paths.map((path) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2741
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { className: "rqk-link-lines", width: size.width, height: size.height, "aria-hidden": true, children: paths.map((path) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2677
2742
  "path",
2678
2743
  {
2679
2744
  d: path.d,
@@ -2689,7 +2754,7 @@ function LinkBoard({
2689
2754
  const kind = side === "left" ? leftKind : rightKind;
2690
2755
  const nodes = side === "left" ? data.left : data.right;
2691
2756
  const refs = side === "left" ? leftRefs : rightRefs;
2692
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2757
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2693
2758
  "div",
2694
2759
  {
2695
2760
  className: classNames(
@@ -2705,7 +2770,7 @@ function LinkBoard({
2705
2770
  const isPlaying = (playing == null ? void 0 : playing.side) === side && playing.index === nodeIndex;
2706
2771
  const correct = phase === "locked" || readonly ? nodeOk(data, side, nodeIndex) : false;
2707
2772
  const wrong = phase === "locked" && side === "left" && !nodeOk(data, side, nodeIndex);
2708
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2773
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2709
2774
  LinkNode,
2710
2775
  {
2711
2776
  side,
@@ -2947,7 +3012,7 @@ function projectKind(side, leftKind, rightKind) {
2947
3012
  }
2948
3013
 
2949
3014
  // src/questions/link-match/index.tsx
2950
- var import_jsx_runtime29 = require("react/jsx-runtime");
3015
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2951
3016
  function LinkMatch({
2952
3017
  data,
2953
3018
  mode = "answer",
@@ -2996,7 +3061,7 @@ function LinkMatch({
2996
3061
  onSubmit: pairs.handleSubmit,
2997
3062
  onRetry: pairs.judge.retry
2998
3063
  });
2999
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3064
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3000
3065
  QuestShell,
3001
3066
  {
3002
3067
  mode,
@@ -3007,7 +3072,7 @@ function LinkMatch({
3007
3072
  onBack,
3008
3073
  className: classNames("rqk-quest", className),
3009
3074
  dataQuest: "link-match",
3010
- feedback: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3075
+ feedback: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3011
3076
  LinkMatchFeedback,
3012
3077
  {
3013
3078
  readonly: pairs.readonly,
@@ -3017,10 +3082,10 @@ function LinkMatch({
3017
3082
  answerText: pairs.answerText
3018
3083
  }
3019
3084
  ),
3020
- footer: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ActionBar, { actions, index, onPrev }),
3021
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
3022
- data.hint ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "rqk-link-hint", children: data.hint }) : null,
3023
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3085
+ footer: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ActionBar, { actions, index, total, onPrev }),
3086
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
3087
+ data.hint ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "rqk-link-hint", children: data.hint }) : null,
3088
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3024
3089
  LinkBoard,
3025
3090
  {
3026
3091
  data,
@@ -3069,7 +3134,7 @@ function rearrangeActions({
3069
3134
  }
3070
3135
 
3071
3136
  // src/questions/rearrange/feedback.tsx
3072
- var import_jsx_runtime30 = require("react/jsx-runtime");
3137
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3073
3138
  function RearrangeFeedback({
3074
3139
  readonly,
3075
3140
  phase,
@@ -3078,7 +3143,7 @@ function RearrangeFeedback({
3078
3143
  answerText
3079
3144
  }) {
3080
3145
  if (readonly) {
3081
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3146
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3082
3147
  FeedbackSheet,
3083
3148
  {
3084
3149
  tone: "ok",
@@ -3090,7 +3155,7 @@ function RearrangeFeedback({
3090
3155
  );
3091
3156
  }
3092
3157
  if (phase === "retry") {
3093
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3158
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3094
3159
  FeedbackSheet,
3095
3160
  {
3096
3161
  tone: "warn",
@@ -3100,10 +3165,10 @@ function RearrangeFeedback({
3100
3165
  );
3101
3166
  }
3102
3167
  if (phase === "correct") {
3103
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
3168
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
3104
3169
  }
3105
3170
  if (phase === "locked") {
3106
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3171
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3107
3172
  FeedbackSheet,
3108
3173
  {
3109
3174
  tone: "bad",
@@ -3119,7 +3184,7 @@ function RearrangeFeedback({
3119
3184
  }
3120
3185
 
3121
3186
  // src/primitives/word-chip.tsx
3122
- var import_jsx_runtime31 = require("react/jsx-runtime");
3187
+ var import_jsx_runtime32 = require("react/jsx-runtime");
3123
3188
  function WordChip({
3124
3189
  children,
3125
3190
  onClick,
@@ -3130,7 +3195,7 @@ function WordChip({
3130
3195
  className,
3131
3196
  ariaLabel
3132
3197
  }) {
3133
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
3198
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3134
3199
  "button",
3135
3200
  {
3136
3201
  type: "button",
@@ -3145,14 +3210,14 @@ function WordChip({
3145
3210
  "aria-label": ariaLabel,
3146
3211
  children: [
3147
3212
  children,
3148
- removable ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CrossIcon, { className: "rqk-chip-remove", size: 14 }) : null
3213
+ removable ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CrossIcon, { className: "rqk-chip-remove", size: 14 }) : null
3149
3214
  ]
3150
3215
  }
3151
3216
  );
3152
3217
  }
3153
3218
 
3154
3219
  // src/questions/rearrange/bank-card.tsx
3155
- var import_jsx_runtime32 = require("react/jsx-runtime");
3220
+ var import_jsx_runtime33 = require("react/jsx-runtime");
3156
3221
  function RearrangeBank({
3157
3222
  data,
3158
3223
  bank,
@@ -3160,11 +3225,11 @@ function RearrangeBank({
3160
3225
  tileUsed,
3161
3226
  onPick
3162
3227
  }) {
3163
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Card, { className: "rqk-rearrange-bank", children: [
3164
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "rqk-rearrange-bank-label", children: data.kind === "word" ? "\u53EF\u9009\u5B57\u6BCD" : "\u53EF\u9009\u5355\u8BCD" }),
3165
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "rqk-rearrange-tiles", children: bank.map((tile, tileIndex) => {
3228
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Card, { className: "rqk-rearrange-bank", children: [
3229
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "rqk-rearrange-bank-label", children: data.kind === "word" ? "\u53EF\u9009\u5B57\u6BCD" : "\u53EF\u9009\u5355\u8BCD" }),
3230
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "rqk-rearrange-tiles", children: bank.map((tile, tileIndex) => {
3166
3231
  const used = tileUsed(tile);
3167
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3232
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
3168
3233
  WordChip,
3169
3234
  {
3170
3235
  variant: data.kind === "word" ? "letter" : "bank",
@@ -3180,7 +3245,7 @@ function RearrangeBank({
3180
3245
  }
3181
3246
 
3182
3247
  // src/questions/rearrange/slots-card.tsx
3183
- var import_jsx_runtime33 = require("react/jsx-runtime");
3248
+ var import_jsx_runtime34 = require("react/jsx-runtime");
3184
3249
  function RearrangeSlots({
3185
3250
  data,
3186
3251
  slots,
@@ -3190,15 +3255,15 @@ function RearrangeSlots({
3190
3255
  isSlotOk,
3191
3256
  onSlot
3192
3257
  }) {
3193
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Card, { className: "rqk-rearrange-slots", children: [
3194
- data.hint ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "rqk-rearrange-hint", children: [
3258
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Card, { className: "rqk-rearrange-slots", children: [
3259
+ data.hint ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "rqk-rearrange-hint", children: [
3195
3260
  "\u63D0\u793A\uFF1A",
3196
3261
  data.hint
3197
3262
  ] }) : null,
3198
3263
  slots.map((slot, slotIndex) => {
3199
3264
  const value = slot.holder ? slot.char : filled[slotIndex];
3200
3265
  const current = !slot.holder && !value && cursor === slotIndex;
3201
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
3266
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
3202
3267
  "button",
3203
3268
  {
3204
3269
  type: "button",
@@ -3214,7 +3279,7 @@ function RearrangeSlots({
3214
3279
  disabled: slot.holder,
3215
3280
  children: [
3216
3281
  value,
3217
- current ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "rqk-rearrange-caret" }) : null
3282
+ current ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "rqk-rearrange-caret" }) : null
3218
3283
  ]
3219
3284
  },
3220
3285
  slotIndex
@@ -3224,7 +3289,7 @@ function RearrangeSlots({
3224
3289
  }
3225
3290
 
3226
3291
  // src/questions/rearrange/rearrange-page.tsx
3227
- var import_jsx_runtime34 = require("react/jsx-runtime");
3292
+ var import_jsx_runtime35 = require("react/jsx-runtime");
3228
3293
  function RearrangePage({
3229
3294
  data,
3230
3295
  slots,
@@ -3238,8 +3303,8 @@ function RearrangePage({
3238
3303
  onSlot,
3239
3304
  onPick
3240
3305
  }) {
3241
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
3242
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3306
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
3307
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3243
3308
  RearrangeSlots,
3244
3309
  {
3245
3310
  data,
@@ -3251,7 +3316,7 @@ function RearrangePage({
3251
3316
  onSlot
3252
3317
  }
3253
3318
  ),
3254
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RearrangeBank, { data, bank, frozen, tileUsed, onPick })
3319
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RearrangeBank, { data, bank, frozen, tileUsed, onPick })
3255
3320
  ] });
3256
3321
  }
3257
3322
 
@@ -3431,7 +3496,7 @@ function useRearrange({
3431
3496
  }
3432
3497
 
3433
3498
  // src/questions/rearrange/index.tsx
3434
- var import_jsx_runtime35 = require("react/jsx-runtime");
3499
+ var import_jsx_runtime36 = require("react/jsx-runtime");
3435
3500
  function Rearrange({
3436
3501
  data,
3437
3502
  mode = "answer",
@@ -3457,26 +3522,26 @@ function Rearrange({
3457
3522
  onSubmit: model.handleSubmit,
3458
3523
  onRetry: model.judge.retry
3459
3524
  });
3460
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3525
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3461
3526
  QuestShell,
3462
3527
  {
3463
3528
  mode,
3464
3529
  title: title != null ? title : data.kind === "word" ? "\u5355\u8BCD\u91CD\u7EC4" : "\u53E5\u5B50\u91CD\u7EC4",
3465
3530
  index,
3466
3531
  total,
3467
- instruction: instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
3532
+ instruction: instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
3468
3533
  "\u6309\u5B57\u6BCD\u987A\u5E8F\u586B\u5165",
3469
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("b", { children: "\u6A2A\u7EBF" }),
3534
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("b", { children: "\u6A2A\u7EBF" }),
3470
3535
  "\uFF0C\u62FC\u51FA\u5355\u8BCD"
3471
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
3536
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
3472
3537
  "\u6309\u6B63\u786E\u987A\u5E8F\u628A\u8BCD\u5757\u586B\u5165",
3473
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("b", { children: "\u6A2A\u7EBF" }),
3538
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("b", { children: "\u6A2A\u7EBF" }),
3474
3539
  "\uFF0C\u62FC\u51FA\u53E5\u5B50"
3475
3540
  ] }),
3476
3541
  onBack,
3477
3542
  className: classNames("rqk-quest", "rqk-rearrange", className),
3478
3543
  dataQuest: "rearrange",
3479
- feedback: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3544
+ feedback: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3480
3545
  RearrangeFeedback,
3481
3546
  {
3482
3547
  readonly: model.readonly,
@@ -3486,8 +3551,8 @@ function Rearrange({
3486
3551
  answerText: targetAnswerText(data)
3487
3552
  }
3488
3553
  ),
3489
- footer: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ActionBar, { actions, index, onPrev }),
3490
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3554
+ footer: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ActionBar, { actions, index, total, onPrev }),
3555
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3491
3556
  RearrangePage,
3492
3557
  {
3493
3558
  data,
@@ -3531,20 +3596,20 @@ function classifyActions({
3531
3596
  }
3532
3597
 
3533
3598
  // src/questions/classify/bank-card.tsx
3534
- var import_jsx_runtime36 = require("react/jsx-runtime");
3599
+ var import_jsx_runtime37 = require("react/jsx-runtime");
3535
3600
  function ClassifyBank({
3536
3601
  data,
3537
3602
  remaining,
3538
3603
  frozen,
3539
3604
  onPick
3540
3605
  }) {
3541
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Card, { className: "rqk-classify-bank", children: [
3542
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "rqk-classify-bank-label", children: [
3606
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Card, { className: "rqk-classify-bank", children: [
3607
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "rqk-classify-bank-label", children: [
3543
3608
  "\u5F85\u5206\u7C7B \xB7 \u5269\u4F59 ",
3544
3609
  remaining.length,
3545
3610
  " \u9879"
3546
3611
  ] }),
3547
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "rqk-classify-bank-items", children: remaining.length ? remaining.map((itemIndex) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3612
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "rqk-classify-bank-items", children: remaining.length ? remaining.map((itemIndex) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3548
3613
  WordChip,
3549
3614
  {
3550
3615
  variant: "bank",
@@ -3553,12 +3618,12 @@ function ClassifyBank({
3553
3618
  children: data.items[itemIndex].text
3554
3619
  },
3555
3620
  itemIndex
3556
- )) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "rqk-classify-empty", children: "\u5DF2\u5168\u90E8\u5F52\u7C7B" }) })
3621
+ )) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "rqk-classify-empty", children: "\u5DF2\u5168\u90E8\u5F52\u7C7B" }) })
3557
3622
  ] });
3558
3623
  }
3559
3624
 
3560
3625
  // src/questions/classify/category-card.tsx
3561
- var import_jsx_runtime37 = require("react/jsx-runtime");
3626
+ var import_jsx_runtime38 = require("react/jsx-runtime");
3562
3627
  function ClassifyCategory({
3563
3628
  categoryIndex,
3564
3629
  category,
@@ -3572,7 +3637,7 @@ function ClassifyCategory({
3572
3637
  }) {
3573
3638
  const items = data.items.map((_item, itemIndex) => placed[itemIndex] === categoryIndex ? itemIndex : null).filter((itemIndex) => itemIndex !== null);
3574
3639
  const focused = !frozen && current === categoryIndex;
3575
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
3640
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
3576
3641
  "div",
3577
3642
  {
3578
3643
  className: classNames("rqk-card", "rqk-classify-cat", focused && "rqk-is-selected"),
@@ -3586,20 +3651,20 @@ function ClassifyCategory({
3586
3651
  role: "button",
3587
3652
  tabIndex: frozen ? -1 : 0,
3588
3653
  children: [
3589
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "rqk-classify-cat-head", children: [
3590
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "rqk-classify-cat-name", children: [
3654
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "rqk-classify-cat-head", children: [
3655
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "rqk-classify-cat-name", children: [
3591
3656
  category.label,
3592
- category.sub ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("em", { className: "rqk-classify-cat-sub", children: category.sub }) : null
3657
+ category.sub ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("em", { className: "rqk-classify-cat-sub", children: category.sub }) : null
3593
3658
  ] }),
3594
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "rqk-classify-cat-count", children: [
3659
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "rqk-classify-cat-count", children: [
3595
3660
  items.length,
3596
3661
  " \u9879"
3597
3662
  ] })
3598
3663
  ] }),
3599
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "rqk-classify-cat-body", children: items.length ? items.map((itemIndex) => {
3664
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "rqk-classify-cat-body", children: items.length ? items.map((itemIndex) => {
3600
3665
  const item = data.items[itemIndex];
3601
3666
  const slotOk = placed[itemIndex] === item.category;
3602
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3667
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3603
3668
  WordChip,
3604
3669
  {
3605
3670
  variant: "placed",
@@ -3614,14 +3679,14 @@ function ClassifyCategory({
3614
3679
  },
3615
3680
  itemIndex
3616
3681
  );
3617
- }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "rqk-classify-empty", children: "\u70B9\u51FB\u9009\u9879\u653E\u5165\u8FD9\u4E00\u7C7B" }) })
3682
+ }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "rqk-classify-empty", children: "\u70B9\u51FB\u9009\u9879\u653E\u5165\u8FD9\u4E00\u7C7B" }) })
3618
3683
  ]
3619
3684
  }
3620
3685
  );
3621
3686
  }
3622
3687
 
3623
3688
  // src/questions/classify/classify-page.tsx
3624
- var import_jsx_runtime38 = require("react/jsx-runtime");
3689
+ var import_jsx_runtime39 = require("react/jsx-runtime");
3625
3690
  function ClassifyPage({
3626
3691
  data,
3627
3692
  placed,
@@ -3633,8 +3698,8 @@ function ClassifyPage({
3633
3698
  onUnplace,
3634
3699
  onPick
3635
3700
  }) {
3636
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
3637
- data.categories.map((category, categoryIndex) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3701
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
3702
+ data.categories.map((category, categoryIndex) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3638
3703
  ClassifyCategory,
3639
3704
  {
3640
3705
  categoryIndex,
@@ -3649,12 +3714,12 @@ function ClassifyPage({
3649
3714
  },
3650
3715
  categoryIndex
3651
3716
  )),
3652
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ClassifyBank, { data, remaining, frozen, onPick })
3717
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ClassifyBank, { data, remaining, frozen, onPick })
3653
3718
  ] });
3654
3719
  }
3655
3720
 
3656
3721
  // src/questions/classify/feedback.tsx
3657
- var import_jsx_runtime39 = require("react/jsx-runtime");
3722
+ var import_jsx_runtime40 = require("react/jsx-runtime");
3658
3723
  function ClassifyFeedback({
3659
3724
  readonly,
3660
3725
  phase,
@@ -3663,7 +3728,7 @@ function ClassifyFeedback({
3663
3728
  answerText
3664
3729
  }) {
3665
3730
  if (readonly) {
3666
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3731
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3667
3732
  FeedbackSheet,
3668
3733
  {
3669
3734
  tone: "ok",
@@ -3675,13 +3740,13 @@ function ClassifyFeedback({
3675
3740
  );
3676
3741
  }
3677
3742
  if (phase === "retry") {
3678
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u653E\u9519\u7C7B\u522B\u7684\u5355\u8BCD", detail: "\u5206\u7C7B\u6B63\u786E\u7684\u5355\u8BCD\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
3743
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u653E\u9519\u7C7B\u522B\u7684\u5355\u8BCD", detail: "\u5206\u7C7B\u6B63\u786E\u7684\u5355\u8BCD\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
3679
3744
  }
3680
3745
  if (phase === "correct") {
3681
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
3746
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
3682
3747
  }
3683
3748
  if (phase === "locked") {
3684
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3749
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3685
3750
  FeedbackSheet,
3686
3751
  {
3687
3752
  tone: "bad",
@@ -3779,7 +3844,7 @@ function useClassify({
3779
3844
  }
3780
3845
 
3781
3846
  // src/questions/classify/index.tsx
3782
- var import_jsx_runtime40 = require("react/jsx-runtime");
3847
+ var import_jsx_runtime41 = require("react/jsx-runtime");
3783
3848
  function Classify({
3784
3849
  data,
3785
3850
  mode = "answer",
@@ -3805,21 +3870,21 @@ function Classify({
3805
3870
  onSubmit: model.handleSubmit,
3806
3871
  onRetry: model.judge.retry
3807
3872
  });
3808
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3873
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3809
3874
  QuestShell,
3810
3875
  {
3811
3876
  mode,
3812
3877
  title: title != null ? title : "\u5206\u7C7B\u9898",
3813
3878
  index,
3814
3879
  total,
3815
- instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
3880
+ instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
3816
3881
  "\u628A\u5355\u8BCD\u70B9\u9009\u5230",
3817
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("b", { children: "\u6B63\u786E\u7684\u7C7B\u522B" })
3882
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("b", { children: "\u6B63\u786E\u7684\u7C7B\u522B" })
3818
3883
  ] }),
3819
3884
  onBack,
3820
3885
  className: classNames("rqk-quest", "rqk-classify", className),
3821
3886
  dataQuest: "classify",
3822
- feedback: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3887
+ feedback: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3823
3888
  ClassifyFeedback,
3824
3889
  {
3825
3890
  readonly: model.readonly,
@@ -3829,8 +3894,8 @@ function Classify({
3829
3894
  answerText: model.answerText
3830
3895
  }
3831
3896
  ),
3832
- footer: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ActionBar, { actions, index, onPrev }),
3833
- children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
3897
+ footer: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ActionBar, { actions, index, total, onPrev }),
3898
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3834
3899
  ClassifyPage,
3835
3900
  {
3836
3901
  data,
@@ -3878,7 +3943,7 @@ function rewriteActions({
3878
3943
  }
3879
3944
 
3880
3945
  // src/questions/rewrite/answer-card.tsx
3881
- var import_jsx_runtime41 = require("react/jsx-runtime");
3946
+ var import_jsx_runtime42 = require("react/jsx-runtime");
3882
3947
  function RewriteAnswerCard({
3883
3948
  data,
3884
3949
  value,
@@ -3890,12 +3955,12 @@ function RewriteAnswerCard({
3890
3955
  showAnswers
3891
3956
  }) {
3892
3957
  var _a, _b;
3893
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Card, { className: "rqk-rewrite-card", children: [
3894
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "rqk-rewrite-stem", children: [
3895
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "rqk-rewrite-badge", children: "\u539F\u53E5" }),
3958
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Card, { className: "rqk-rewrite-card", children: [
3959
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "rqk-rewrite-stem", children: [
3960
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "rqk-rewrite-badge", children: "\u539F\u53E5" }),
3896
3961
  data.stem
3897
3962
  ] }),
3898
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
3963
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3899
3964
  "textarea",
3900
3965
  {
3901
3966
  ref: (element) => {
@@ -3915,12 +3980,12 @@ function RewriteAnswerCard({
3915
3980
  disabled: readonly || phase === "locked"
3916
3981
  }
3917
3982
  ),
3918
- showAnswers ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "rqk-rewrite-answers", children: data.answers.map((answer, answerIndex2) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "rqk-rewrite-answer-chip", children: answer }, answerIndex2)) }) : null
3983
+ showAnswers ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "rqk-rewrite-answers", children: data.answers.map((answer, answerIndex2) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "rqk-rewrite-answer-chip", children: answer }, answerIndex2)) }) : null
3919
3984
  ] });
3920
3985
  }
3921
3986
 
3922
3987
  // src/questions/rewrite/feedback.tsx
3923
- var import_jsx_runtime42 = require("react/jsx-runtime");
3988
+ var import_jsx_runtime43 = require("react/jsx-runtime");
3924
3989
  function RewriteFeedback({
3925
3990
  readonly,
3926
3991
  phase,
@@ -3928,7 +3993,7 @@ function RewriteFeedback({
3928
3993
  labels
3929
3994
  }) {
3930
3995
  if (readonly) {
3931
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
3996
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3932
3997
  FeedbackSheet,
3933
3998
  {
3934
3999
  tone: "ok",
@@ -3940,13 +4005,13 @@ function RewriteFeedback({
3940
4005
  );
3941
4006
  }
3942
4007
  if (phase === "retry") {
3943
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FeedbackSheet, { tone: "warn", title: "\u518D\u68C0\u67E5\u4E00\u4E0B\u8BED\u5E8F\u4E0E\u65F6\u6001", detail: "\u6CE8\u610F\u4FDD\u6301\u539F\u53E5\u7684\u4EBA\u79F0\u548C\u65F6\u6001" });
4008
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FeedbackSheet, { tone: "warn", title: "\u518D\u68C0\u67E5\u4E00\u4E0B\u8BED\u5E8F\u4E0E\u65F6\u6001", detail: "\u6CE8\u610F\u4FDD\u6301\u539F\u53E5\u7684\u4EBA\u79F0\u548C\u65F6\u6001" });
3944
4009
  }
3945
4010
  if (phase === "correct") {
3946
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: data.answers[0] });
4011
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: data.answers[0] });
3947
4012
  }
3948
4013
  if (phase === "locked") {
3949
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
4014
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
3950
4015
  FeedbackSheet,
3951
4016
  {
3952
4017
  tone: "bad",
@@ -3962,10 +4027,10 @@ function RewriteFeedback({
3962
4027
  }
3963
4028
 
3964
4029
  // src/questions/rewrite/kb-hint.tsx
3965
- var import_jsx_runtime43 = require("react/jsx-runtime");
4030
+ var import_jsx_runtime44 = require("react/jsx-runtime");
3966
4031
  function RewriteKbHint({ text }) {
3967
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "rqk-tx-kb-hint", children: [
3968
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(KeyboardIcon, {}),
4032
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "rqk-tx-kb-hint", children: [
4033
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(KeyboardIcon, {}),
3969
4034
  text
3970
4035
  ] });
3971
4036
  }
@@ -4027,7 +4092,7 @@ function useRewrite({
4027
4092
  }
4028
4093
 
4029
4094
  // src/questions/rewrite/index.tsx
4030
- var import_jsx_runtime44 = require("react/jsx-runtime");
4095
+ var import_jsx_runtime45 = require("react/jsx-runtime");
4031
4096
  function Rewrite({
4032
4097
  data,
4033
4098
  mode = "answer",
@@ -4054,7 +4119,7 @@ function Rewrite({
4054
4119
  onSubmit: model.handleSubmit,
4055
4120
  onRetry: model.judge.retry
4056
4121
  });
4057
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4122
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4058
4123
  QuestShell,
4059
4124
  {
4060
4125
  mode,
@@ -4065,7 +4130,7 @@ function Rewrite({
4065
4130
  onBack,
4066
4131
  className: classNames("rqk-quest", "rqk-rewrite", className),
4067
4132
  dataQuest: "rewrite",
4068
- feedback: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4133
+ feedback: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4069
4134
  RewriteFeedback,
4070
4135
  {
4071
4136
  readonly: model.readonly,
@@ -4074,9 +4139,9 @@ function Rewrite({
4074
4139
  labels: model.labels
4075
4140
  }
4076
4141
  ),
4077
- footer: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ActionBar, { actions, index, onPrev }),
4078
- children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
4079
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4142
+ footer: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ActionBar, { actions, index, total, onPrev }),
4143
+ children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
4144
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4080
4145
  RewriteAnswerCard,
4081
4146
  {
4082
4147
  data,
@@ -4089,7 +4154,7 @@ function Rewrite({
4089
4154
  showAnswers: model.showAnswers
4090
4155
  }
4091
4156
  ),
4092
- !model.readonly && !model.graded ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RewriteKbHint, { text: "\u70B9\u51FB\u8F93\u5165\u6846\uFF0C\u7CFB\u7EDF\u952E\u76D8\u81EA\u52A8\u5F39\u51FA" }) : null
4157
+ !model.readonly && !model.graded ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(RewriteKbHint, { text: "\u70B9\u51FB\u8F93\u5165\u6846\uFF0C\u7CFB\u7EDF\u952E\u76D8\u81EA\u52A8\u5F39\u51FA" }) : null
4093
4158
  ] })
4094
4159
  }
4095
4160
  );
@@ -4120,7 +4185,7 @@ function fillBlankActions({
4120
4185
  }
4121
4186
 
4122
4187
  // src/questions/fill-blank/feedback.tsx
4123
- var import_jsx_runtime45 = require("react/jsx-runtime");
4188
+ var import_jsx_runtime46 = require("react/jsx-runtime");
4124
4189
  function FillBlankFeedback({
4125
4190
  readonly,
4126
4191
  phase,
@@ -4129,7 +4194,7 @@ function FillBlankFeedback({
4129
4194
  answerText
4130
4195
  }) {
4131
4196
  if (readonly) {
4132
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4197
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4133
4198
  FeedbackSheet,
4134
4199
  {
4135
4200
  tone: "ok",
@@ -4141,7 +4206,7 @@ function FillBlankFeedback({
4141
4206
  );
4142
4207
  }
4143
4208
  if (phase === "retry") {
4144
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4209
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4145
4210
  FeedbackSheet,
4146
4211
  {
4147
4212
  tone: "warn",
@@ -4151,10 +4216,10 @@ function FillBlankFeedback({
4151
4216
  );
4152
4217
  }
4153
4218
  if (phase === "correct") {
4154
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
4219
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
4155
4220
  }
4156
4221
  if (phase === "locked") {
4157
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
4222
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4158
4223
  FeedbackSheet,
4159
4224
  {
4160
4225
  tone: "bad",
@@ -4170,7 +4235,7 @@ function FillBlankFeedback({
4170
4235
  }
4171
4236
 
4172
4237
  // src/questions/fill-blank/blank-input.tsx
4173
- var import_jsx_runtime46 = require("react/jsx-runtime");
4238
+ var import_jsx_runtime47 = require("react/jsx-runtime");
4174
4239
  function BlankInput({
4175
4240
  blank,
4176
4241
  blankIndex,
@@ -4185,7 +4250,7 @@ function BlankInput({
4185
4250
  7,
4186
4251
  Math.min(18, normalizeAnswer(value).length || normalizeAnswer((_a = blank.answers[0]) != null ? _a : "").length)
4187
4252
  );
4188
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4253
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4189
4254
  "input",
4190
4255
  {
4191
4256
  className: classNames("rqk-fill-input", graded && (ok ? "rqk-is-correct" : "rqk-is-wrong")),
@@ -4200,7 +4265,7 @@ function BlankInput({
4200
4265
  }
4201
4266
 
4202
4267
  // src/questions/fill-blank/passage-card.tsx
4203
- var import_jsx_runtime47 = require("react/jsx-runtime");
4268
+ var import_jsx_runtime48 = require("react/jsx-runtime");
4204
4269
  function FillBlankPassage({
4205
4270
  data,
4206
4271
  values,
@@ -4209,16 +4274,16 @@ function FillBlankPassage({
4209
4274
  readonly,
4210
4275
  onChange
4211
4276
  }) {
4212
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Card, { className: "rqk-fill-card", children: [
4213
- /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "rqk-fill-tip", children: [
4214
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "rqk-fill-badge", children: "\u77ED\u6587" }),
4277
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Card, { className: "rqk-fill-card", children: [
4278
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "rqk-fill-tip", children: [
4279
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "rqk-fill-badge", children: "\u77ED\u6587" }),
4215
4280
  "\u6BCF\u7A7A\u586B\u4E00\u4E2A\u5355\u8BCD"
4216
4281
  ] }),
4217
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "rqk-fill-passage", children: data.segments.map((segment, segmentIndex) => {
4282
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "rqk-fill-passage", children: data.segments.map((segment, segmentIndex) => {
4218
4283
  var _a;
4219
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { children: [
4284
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
4220
4285
  segment,
4221
- segmentIndex < data.blanks.length ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4286
+ segmentIndex < data.blanks.length ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4222
4287
  BlankInput,
4223
4288
  {
4224
4289
  blank: data.blanks[segmentIndex],
@@ -4232,7 +4297,7 @@ function FillBlankPassage({
4232
4297
  ) : null
4233
4298
  ] }, segmentIndex);
4234
4299
  }) }),
4235
- data.translation ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "rqk-fill-translation", children: [
4300
+ data.translation ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "rqk-fill-translation", children: [
4236
4301
  "\u8BD1\uFF1A",
4237
4302
  data.translation
4238
4303
  ] }) : null
@@ -4312,7 +4377,7 @@ function useFillBlank({
4312
4377
  }
4313
4378
 
4314
4379
  // src/questions/fill-blank/index.tsx
4315
- var import_jsx_runtime48 = require("react/jsx-runtime");
4380
+ var import_jsx_runtime49 = require("react/jsx-runtime");
4316
4381
  function FillBlank({
4317
4382
  data,
4318
4383
  mode = "answer",
@@ -4338,22 +4403,22 @@ function FillBlank({
4338
4403
  onSubmit: model.handleSubmit,
4339
4404
  onRetry: model.judge.retry
4340
4405
  });
4341
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4406
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4342
4407
  QuestShell,
4343
4408
  {
4344
4409
  mode,
4345
4410
  title: title != null ? title : "\u586B\u7A7A\u9898",
4346
4411
  index,
4347
4412
  total,
4348
- instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
4413
+ instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
4349
4414
  "\u8BFB\u77ED\u6587\uFF0C\u5728",
4350
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("b", { children: "\u6A2A\u7EBF" }),
4415
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("b", { children: "\u6A2A\u7EBF" }),
4351
4416
  "\u5904\u8F93\u5165\u6B63\u786E\u7684\u8BCD"
4352
4417
  ] }),
4353
4418
  onBack,
4354
4419
  className: classNames("rqk-quest", "rqk-fill-blank", className),
4355
4420
  dataQuest: "fill-blank",
4356
- feedback: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4421
+ feedback: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4357
4422
  FillBlankFeedback,
4358
4423
  {
4359
4424
  readonly: model.readonly,
@@ -4363,9 +4428,9 @@ function FillBlank({
4363
4428
  answerText: model.answerText
4364
4429
  }
4365
4430
  ),
4366
- footer: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActionBar, { actions, index, onPrev }),
4367
- children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
4368
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
4431
+ footer: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ActionBar, { actions, index, total, onPrev }),
4432
+ children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
4433
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4369
4434
  FillBlankPassage,
4370
4435
  {
4371
4436
  data,
@@ -4376,8 +4441,8 @@ function FillBlank({
4376
4441
  onChange: model.updateBlank
4377
4442
  }
4378
4443
  ),
4379
- !model.readonly && !model.graded ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "rqk-tx-kb-hint", children: [
4380
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(KeyboardIcon, {}),
4444
+ !model.readonly && !model.graded ? /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "rqk-tx-kb-hint", children: [
4445
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(KeyboardIcon, {}),
4381
4446
  "\u70B9\u51FB\u6A2A\u7EBF\u8F93\u5165\uFF0C\u7CFB\u7EDF\u952E\u76D8\u81EA\u52A8\u5F39\u51FA"
4382
4447
  ] }) : null
4383
4448
  ] })
@@ -4409,7 +4474,7 @@ function wordSelectActions({
4409
4474
  }
4410
4475
 
4411
4476
  // src/questions/word-select/bank-card.tsx
4412
- var import_jsx_runtime49 = require("react/jsx-runtime");
4477
+ var import_jsx_runtime50 = require("react/jsx-runtime");
4413
4478
  function WordSelectBank({
4414
4479
  bank,
4415
4480
  interaction,
@@ -4417,9 +4482,9 @@ function WordSelectBank({
4417
4482
  tileUsed,
4418
4483
  onPick
4419
4484
  }) {
4420
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Card, { className: "rqk-word-select-bank", children: [
4421
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "rqk-word-select-bank-label", children: interaction === "sequence" ? "\u70B9\u9009\u9879\u4F9D\u5E8F\u586B\u5165" : "\u5148\u9009\u6A2A\u7EBF\uFF0C\u518D\u70B9\u9009\u9879" }),
4422
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "rqk-word-select-bank-items", children: bank.map((tile, tileIndex) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
4485
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Card, { className: "rqk-word-select-bank", children: [
4486
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "rqk-word-select-bank-label", children: interaction === "sequence" ? "\u70B9\u9009\u9879\u4F9D\u5E8F\u586B\u5165" : "\u5148\u9009\u6A2A\u7EBF\uFF0C\u518D\u70B9\u9009\u9879" }),
4487
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "rqk-word-select-bank-items", children: bank.map((tile, tileIndex) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4423
4488
  WordChip,
4424
4489
  {
4425
4490
  variant: "word",
@@ -4434,7 +4499,7 @@ function WordSelectBank({
4434
4499
  }
4435
4500
 
4436
4501
  // src/questions/word-select/feedback.tsx
4437
- var import_jsx_runtime50 = require("react/jsx-runtime");
4502
+ var import_jsx_runtime51 = require("react/jsx-runtime");
4438
4503
  function WordSelectFeedback({
4439
4504
  readonly,
4440
4505
  phase,
@@ -4443,7 +4508,7 @@ function WordSelectFeedback({
4443
4508
  answerText
4444
4509
  }) {
4445
4510
  if (readonly) {
4446
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4511
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4447
4512
  FeedbackSheet,
4448
4513
  {
4449
4514
  tone: "ok",
@@ -4455,13 +4520,13 @@ function WordSelectFeedback({
4455
4520
  );
4456
4521
  }
4457
4522
  if (phase === "retry") {
4458
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u7A7A\u653E\u9519\u4E86\u4F4D\u7F6E", detail: "\u6B63\u786E\u7684\u8BCD\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
4523
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u7A7A\u653E\u9519\u4E86\u4F4D\u7F6E", detail: "\u6B63\u786E\u7684\u8BCD\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
4459
4524
  }
4460
4525
  if (phase === "correct") {
4461
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
4526
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
4462
4527
  }
4463
4528
  if (phase === "locked") {
4464
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
4529
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4465
4530
  FeedbackSheet,
4466
4531
  {
4467
4532
  tone: "bad",
@@ -4477,7 +4542,7 @@ function WordSelectFeedback({
4477
4542
  }
4478
4543
 
4479
4544
  // src/questions/word-select/passage-card.tsx
4480
- var import_jsx_runtime51 = require("react/jsx-runtime");
4545
+ var import_jsx_runtime52 = require("react/jsx-runtime");
4481
4546
  function WordSelectPassage({
4482
4547
  data,
4483
4548
  filled,
@@ -4486,18 +4551,18 @@ function WordSelectPassage({
4486
4551
  phase,
4487
4552
  onSlot
4488
4553
  }) {
4489
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Card, { className: "rqk-word-select-card", children: [
4490
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "rqk-fill-tip", children: [
4491
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "rqk-fill-badge", children: "\u77ED\u6587" }),
4554
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Card, { className: "rqk-word-select-card", children: [
4555
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "rqk-fill-tip", children: [
4556
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "rqk-fill-badge", children: "\u77ED\u6587" }),
4492
4557
  "\u6BCF\u4E2A\u8BCD\u53EA\u80FD\u4F7F\u7528\u4E00\u6B21"
4493
4558
  ] }),
4494
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "rqk-fill-passage", children: data.segments.map((segment, segmentIndex) => {
4559
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "rqk-fill-passage", children: data.segments.map((segment, segmentIndex) => {
4495
4560
  const value = filled[segmentIndex];
4496
4561
  const active = !frozen && !value && selected === segmentIndex;
4497
4562
  const correct = value ? matchesAny(value, [data.blanks[segmentIndex].answer]) : false;
4498
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { children: [
4563
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { children: [
4499
4564
  segment,
4500
- segmentIndex < data.blanks.length ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4565
+ segmentIndex < data.blanks.length ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
4501
4566
  "button",
4502
4567
  {
4503
4568
  type: "button",
@@ -4515,7 +4580,7 @@ function WordSelectPassage({
4515
4580
  ) : null
4516
4581
  ] }, segmentIndex);
4517
4582
  }) }),
4518
- data.translation ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "rqk-fill-translation", children: [
4583
+ data.translation ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "rqk-fill-translation", children: [
4519
4584
  "\u8BD1\uFF1A",
4520
4585
  data.translation
4521
4586
  ] }) : null
@@ -4643,7 +4708,7 @@ function useWordSelect({
4643
4708
  }
4644
4709
 
4645
4710
  // src/questions/word-select/index.tsx
4646
- var import_jsx_runtime52 = require("react/jsx-runtime");
4711
+ var import_jsx_runtime53 = require("react/jsx-runtime");
4647
4712
  function WordSelect({
4648
4713
  data,
4649
4714
  mode = "answer",
@@ -4669,22 +4734,22 @@ function WordSelect({
4669
4734
  onSubmit: model.handleSubmit,
4670
4735
  onRetry: model.judge.retry
4671
4736
  });
4672
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
4737
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
4673
4738
  QuestShell,
4674
4739
  {
4675
4740
  mode,
4676
4741
  title: title != null ? title : "\u9009\u8BCD\u586B\u7A7A",
4677
4742
  index,
4678
4743
  total,
4679
- instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
4744
+ instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
4680
4745
  "\u4ECE\u9009\u9879\u5E93",
4681
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("b", { children: "\u9009\u8BCD" }),
4746
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("b", { children: "\u9009\u8BCD" }),
4682
4747
  "\uFF0C\u8865\u5168\u77ED\u6587"
4683
4748
  ] }),
4684
4749
  onBack,
4685
4750
  className: classNames("rqk-quest", "rqk-word-select", className),
4686
4751
  dataQuest: "word-select",
4687
- feedback: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
4752
+ feedback: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
4688
4753
  WordSelectFeedback,
4689
4754
  {
4690
4755
  readonly: model.readonly,
@@ -4694,9 +4759,9 @@ function WordSelect({
4694
4759
  answerText: model.answerText
4695
4760
  }
4696
4761
  ),
4697
- footer: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ActionBar, { actions, index, onPrev }),
4698
- children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
4699
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
4762
+ footer: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ActionBar, { actions, index, total, onPrev }),
4763
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
4764
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
4700
4765
  WordSelectPassage,
4701
4766
  {
4702
4767
  data,
@@ -4707,7 +4772,7 @@ function WordSelect({
4707
4772
  onSlot: model.tapSlot
4708
4773
  }
4709
4774
  ),
4710
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
4775
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
4711
4776
  WordSelectBank,
4712
4777
  {
4713
4778
  bank: model.bank,
@@ -4717,7 +4782,7 @@ function WordSelect({
4717
4782
  onPick: model.pickWord
4718
4783
  }
4719
4784
  ),
4720
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Toast, { children: model.notice })
4785
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Toast, { children: model.notice })
4721
4786
  ] })
4722
4787
  }
4723
4788
  );
@@ -4752,7 +4817,7 @@ function sortSentencesActions({
4752
4817
  }
4753
4818
 
4754
4819
  // src/questions/sort-sentences/feedback.tsx
4755
- var import_jsx_runtime53 = require("react/jsx-runtime");
4820
+ var import_jsx_runtime54 = require("react/jsx-runtime");
4756
4821
  function SortSentencesFeedback({
4757
4822
  readonly,
4758
4823
  phase,
@@ -4760,7 +4825,7 @@ function SortSentencesFeedback({
4760
4825
  labels
4761
4826
  }) {
4762
4827
  if (readonly) {
4763
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
4828
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4764
4829
  FeedbackSheet,
4765
4830
  {
4766
4831
  tone: "ok",
@@ -4772,13 +4837,13 @@ function SortSentencesFeedback({
4772
4837
  );
4773
4838
  }
4774
4839
  if (phase === "retry") {
4775
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u53E5\u5B50\u653E\u9519\u4E86\u4F4D\u7F6E", detail: "\u987A\u5E8F\u6B63\u786E\u7684\u884C\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
4840
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u53E5\u5B50\u653E\u9519\u4E86\u4F4D\u7F6E", detail: "\u987A\u5E8F\u6B63\u786E\u7684\u884C\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
4776
4841
  }
4777
4842
  if (phase === "correct") {
4778
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll });
4843
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll });
4779
4844
  }
4780
4845
  if (phase === "locked") {
4781
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
4846
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4782
4847
  FeedbackSheet,
4783
4848
  {
4784
4849
  tone: "bad",
@@ -4794,7 +4859,7 @@ function SortSentencesFeedback({
4794
4859
  }
4795
4860
 
4796
4861
  // src/questions/sort-sentences/sort-bank.tsx
4797
- var import_jsx_runtime54 = require("react/jsx-runtime");
4862
+ var import_jsx_runtime55 = require("react/jsx-runtime");
4798
4863
  function SortBank({
4799
4864
  bank,
4800
4865
  readonly,
@@ -4802,9 +4867,9 @@ function SortBank({
4802
4867
  tileUsed,
4803
4868
  onPick
4804
4869
  }) {
4805
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Card, { className: "rqk-sort-bank", children: [
4806
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "rqk-sort-bank-label", children: readonly ? "\u6B63\u786E\u987A\u5E8F" : "\u5F85\u6392\u5E8F\u53E5\u5B50" }),
4807
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "rqk-sort-bank-items", children: bank.map((tile, tileIndex) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4870
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Card, { className: "rqk-sort-bank", children: [
4871
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "rqk-sort-bank-label", children: readonly ? "\u6B63\u786E\u987A\u5E8F" : "\u5F85\u6392\u5E8F\u53E5\u5B50" }),
4872
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "rqk-sort-bank-items", children: bank.map((tile, tileIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4808
4873
  "button",
4809
4874
  {
4810
4875
  type: "button",
@@ -4819,7 +4884,7 @@ function SortBank({
4819
4884
  }
4820
4885
 
4821
4886
  // src/questions/sort-sentences/sort-rows.tsx
4822
- var import_jsx_runtime55 = require("react/jsx-runtime");
4887
+ var import_jsx_runtime56 = require("react/jsx-runtime");
4823
4888
  function SortRows({
4824
4889
  rows,
4825
4890
  order,
@@ -4827,7 +4892,7 @@ function SortRows({
4827
4892
  phase,
4828
4893
  onRow
4829
4894
  }) {
4830
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "rqk-sort-rows", children: rows.map((sentence, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
4895
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "rqk-sort-rows", children: rows.map((sentence, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
4831
4896
  "div",
4832
4897
  {
4833
4898
  className: classNames(
@@ -4845,8 +4910,8 @@ function SortRows({
4845
4910
  }
4846
4911
  },
4847
4912
  children: [
4848
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "rqk-sort-row-number", children: rowIndex + 1 }),
4849
- sentence ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "rqk-sort-row-text", children: sentence }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "rqk-sort-row-placeholder", children: [
4913
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "rqk-sort-row-number", children: rowIndex + 1 }),
4914
+ sentence ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "rqk-sort-row-text", children: sentence }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "rqk-sort-row-placeholder", children: [
4850
4915
  "\u70B9\u51FB\u4E0B\u65B9\u53E5\u5B50\u653E\u5165\u7B2C ",
4851
4916
  rowIndex + 1,
4852
4917
  " \u884C"
@@ -4953,7 +5018,7 @@ function useSortSentences({
4953
5018
  }
4954
5019
 
4955
5020
  // src/questions/sort-sentences/index.tsx
4956
- var import_jsx_runtime56 = require("react/jsx-runtime");
5021
+ var import_jsx_runtime57 = require("react/jsx-runtime");
4957
5022
  function SortSentences({
4958
5023
  data,
4959
5024
  mode = "answer",
@@ -4979,22 +5044,22 @@ function SortSentences({
4979
5044
  onSubmit: model.handleSubmit,
4980
5045
  onRetry: model.judge.retry
4981
5046
  });
4982
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5047
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
4983
5048
  QuestShell,
4984
5049
  {
4985
5050
  mode,
4986
5051
  title: title != null ? title : "\u53E5\u5B50\u6392\u5E8F",
4987
5052
  index,
4988
5053
  total,
4989
- instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
5054
+ instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
4990
5055
  "\u6309\u6B63\u786E",
4991
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("b", { children: "\u987A\u5E8F" }),
5056
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("b", { children: "\u987A\u5E8F" }),
4992
5057
  "\u6392\u5217\u53E5\u5B50\uFF0C\u70B9\u51FB\u7A7A\u884C\u653E\u5165"
4993
5058
  ] }),
4994
5059
  onBack,
4995
5060
  className: classNames("rqk-quest", "rqk-sort", className),
4996
5061
  dataQuest: "sort-sentences",
4997
- feedback: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5062
+ feedback: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
4998
5063
  SortSentencesFeedback,
4999
5064
  {
5000
5065
  readonly: model.readonly,
@@ -5003,9 +5068,9 @@ function SortSentences({
5003
5068
  labels: model.labels
5004
5069
  }
5005
5070
  ),
5006
- footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ActionBar, { actions, index, onPrev }) : void 0,
5007
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
5008
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5071
+ footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ActionBar, { actions, index, total, onPrev }) : void 0,
5072
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
5073
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5009
5074
  SortRows,
5010
5075
  {
5011
5076
  rows: model.rows,
@@ -5015,7 +5080,7 @@ function SortSentences({
5015
5080
  onRow: model.tapRow
5016
5081
  }
5017
5082
  ),
5018
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5083
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5019
5084
  SortBank,
5020
5085
  {
5021
5086
  bank: model.bank,
@@ -5025,7 +5090,7 @@ function SortSentences({
5025
5090
  onPick: model.tapBank
5026
5091
  }
5027
5092
  ),
5028
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Toast, { children: model.notice })
5093
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Toast, { children: model.notice })
5029
5094
  ] })
5030
5095
  }
5031
5096
  );
@@ -5055,7 +5120,7 @@ function clozeActions({
5055
5120
  }
5056
5121
 
5057
5122
  // src/questions/cloze/feedback.tsx
5058
- var import_jsx_runtime57 = require("react/jsx-runtime");
5123
+ var import_jsx_runtime58 = require("react/jsx-runtime");
5059
5124
  function ClozeFeedback({
5060
5125
  readonly,
5061
5126
  phase,
@@ -5064,7 +5129,7 @@ function ClozeFeedback({
5064
5129
  answerText
5065
5130
  }) {
5066
5131
  if (readonly) {
5067
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5132
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5068
5133
  FeedbackSheet,
5069
5134
  {
5070
5135
  tone: "ok",
@@ -5076,13 +5141,13 @@ function ClozeFeedback({
5076
5141
  );
5077
5142
  }
5078
5143
  if (phase === "retry") {
5079
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u7A7A\u9009\u9519\u4E86", detail: "\u9009\u62E9\u6B63\u786E\u7684\u7A7A\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
5144
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u7A7A\u9009\u9519\u4E86", detail: "\u9009\u62E9\u6B63\u786E\u7684\u7A7A\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
5080
5145
  }
5081
5146
  if (phase === "correct") {
5082
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
5147
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
5083
5148
  }
5084
5149
  if (phase === "locked") {
5085
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5150
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5086
5151
  FeedbackSheet,
5087
5152
  {
5088
5153
  tone: "bad",
@@ -5098,7 +5163,7 @@ function ClozeFeedback({
5098
5163
  }
5099
5164
 
5100
5165
  // src/questions/cloze/option-grid.tsx
5101
- var import_jsx_runtime58 = require("react/jsx-runtime");
5166
+ var import_jsx_runtime59 = require("react/jsx-runtime");
5102
5167
  function ClozeOptions({
5103
5168
  data,
5104
5169
  current,
@@ -5110,17 +5175,17 @@ function ClozeOptions({
5110
5175
  var _a;
5111
5176
  const options = (_a = data.options[current]) != null ? _a : [];
5112
5177
  const currentChosen = selected[current];
5113
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Card, { className: "rqk-cloze-options", children: [
5114
- /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "rqk-cloze-options-label", children: [
5178
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Card, { className: "rqk-cloze-options", children: [
5179
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "rqk-cloze-options-label", children: [
5115
5180
  "\u7B2C ",
5116
5181
  current + 1,
5117
5182
  " \u7A7A \xB7 \u9009\u62E9\u7B54\u6848"
5118
5183
  ] }),
5119
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "rqk-cloze-options-grid", children: options.map((option, optionIndex) => {
5184
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "rqk-cloze-options-grid", children: options.map((option, optionIndex) => {
5120
5185
  var _a2;
5121
5186
  const chosen = currentChosen === optionIndex;
5122
5187
  const isAnswer = option === ((_a2 = data.gaps[current]) == null ? void 0 : _a2.answer);
5123
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
5188
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
5124
5189
  "button",
5125
5190
  {
5126
5191
  type: "button",
@@ -5133,7 +5198,7 @@ function ClozeOptions({
5133
5198
  onClick: () => onPick(optionIndex),
5134
5199
  disabled: frozen,
5135
5200
  children: [
5136
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "rqk-cloze-option-key", children: String.fromCharCode(65 + optionIndex) }),
5201
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("span", { className: "rqk-cloze-option-key", children: String.fromCharCode(65 + optionIndex) }),
5137
5202
  option
5138
5203
  ]
5139
5204
  },
@@ -5144,7 +5209,7 @@ function ClozeOptions({
5144
5209
  }
5145
5210
 
5146
5211
  // src/questions/cloze/passage-card.tsx
5147
- var import_jsx_runtime59 = require("react/jsx-runtime");
5212
+ var import_jsx_runtime60 = require("react/jsx-runtime");
5148
5213
  function ClozePassage({
5149
5214
  data,
5150
5215
  selected,
@@ -5153,15 +5218,15 @@ function ClozePassage({
5153
5218
  phase,
5154
5219
  onGap
5155
5220
  }) {
5156
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Card, { className: "rqk-cloze-card", children: [
5157
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "rqk-fill-passage", children: data.segments.map((segment, segmentIndex) => {
5221
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Card, { className: "rqk-cloze-card", children: [
5222
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "rqk-fill-passage", children: data.segments.map((segment, segmentIndex) => {
5158
5223
  var _a, _b;
5159
5224
  const optionIndex = selected[segmentIndex];
5160
5225
  const gap = data.gaps[segmentIndex];
5161
5226
  const value = optionIndex === null || segmentIndex >= data.gaps.length ? "\uFF3F\uFF3F" : (_b = (_a = data.options[segmentIndex]) == null ? void 0 : _a[optionIndex]) != null ? _b : "\uFF3F\uFF3F";
5162
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("span", { children: [
5227
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("span", { children: [
5163
5228
  segment,
5164
- segmentIndex < data.gaps.length ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5229
+ segmentIndex < data.gaps.length ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5165
5230
  "button",
5166
5231
  {
5167
5232
  type: "button",
@@ -5179,7 +5244,7 @@ function ClozePassage({
5179
5244
  ) : null
5180
5245
  ] }, segmentIndex);
5181
5246
  }) }),
5182
- data.translation ? /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "rqk-fill-translation", children: [
5247
+ data.translation ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "rqk-fill-translation", children: [
5183
5248
  "\u8BD1\uFF1A",
5184
5249
  data.translation
5185
5250
  ] }) : null
@@ -5283,7 +5348,7 @@ function useCloze({
5283
5348
  }
5284
5349
 
5285
5350
  // src/questions/cloze/index.tsx
5286
- var import_jsx_runtime60 = require("react/jsx-runtime");
5351
+ var import_jsx_runtime61 = require("react/jsx-runtime");
5287
5352
  function Cloze({
5288
5353
  data,
5289
5354
  mode = "answer",
@@ -5309,7 +5374,7 @@ function Cloze({
5309
5374
  onSubmit: model.handleSubmit,
5310
5375
  onRetry: model.judge.retry
5311
5376
  });
5312
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5377
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5313
5378
  QuestShell,
5314
5379
  {
5315
5380
  mode,
@@ -5320,7 +5385,7 @@ function Cloze({
5320
5385
  onBack,
5321
5386
  className: classNames("rqk-quest", "rqk-cloze", className),
5322
5387
  dataQuest: "cloze",
5323
- feedback: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5388
+ feedback: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5324
5389
  ClozeFeedback,
5325
5390
  {
5326
5391
  readonly: model.readonly,
@@ -5330,9 +5395,9 @@ function Cloze({
5330
5395
  answerText: model.answerText
5331
5396
  }
5332
5397
  ),
5333
- footer: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ActionBar, { actions, index, onPrev }),
5334
- children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
5335
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5398
+ footer: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ActionBar, { actions, index, total, onPrev }),
5399
+ children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
5400
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5336
5401
  ClozePassage,
5337
5402
  {
5338
5403
  data,
@@ -5343,7 +5408,7 @@ function Cloze({
5343
5408
  onGap: model.tapGap
5344
5409
  }
5345
5410
  ),
5346
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5411
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5347
5412
  ClozeOptions,
5348
5413
  {
5349
5414
  data,
@@ -5388,7 +5453,7 @@ function readingActions({
5388
5453
  }
5389
5454
 
5390
5455
  // src/questions/reading-comprehension/feedback.tsx
5391
- var import_jsx_runtime61 = require("react/jsx-runtime");
5456
+ var import_jsx_runtime62 = require("react/jsx-runtime");
5392
5457
  function ReadingFeedback({
5393
5458
  readonly,
5394
5459
  phase,
@@ -5397,7 +5462,7 @@ function ReadingFeedback({
5397
5462
  answerText
5398
5463
  }) {
5399
5464
  if (readonly) {
5400
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5465
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5401
5466
  FeedbackSheet,
5402
5467
  {
5403
5468
  tone: "ok",
@@ -5409,10 +5474,10 @@ function ReadingFeedback({
5409
5474
  );
5410
5475
  }
5411
5476
  if (phase === "retry") {
5412
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u5C0F\u9898\u7B54\u9519\u4E86", detail: "\u7B54\u5BF9\u7684\u5C0F\u9898\u5DF2\u9501\u5B9A\uFF0C\u9519\u9898\u53EF\u91CD\u65B0\u9009\u62E9" });
5477
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(FeedbackSheet, { tone: "warn", title: "\u6709\u5C0F\u9898\u7B54\u9519\u4E86", detail: "\u7B54\u5BF9\u7684\u5C0F\u9898\u5DF2\u9501\u5B9A\uFF0C\u9519\u9898\u53EF\u91CD\u65B0\u9009\u62E9" });
5413
5478
  }
5414
5479
  if (phase === "correct") {
5415
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5480
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5416
5481
  FeedbackSheet,
5417
5482
  {
5418
5483
  tone: "ok",
@@ -5423,7 +5488,7 @@ function ReadingFeedback({
5423
5488
  );
5424
5489
  }
5425
5490
  if (phase === "locked") {
5426
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5491
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5427
5492
  FeedbackSheet,
5428
5493
  {
5429
5494
  tone: "bad",
@@ -5439,7 +5504,7 @@ function ReadingFeedback({
5439
5504
  }
5440
5505
 
5441
5506
  // src/questions/reading-comprehension/passage-card.tsx
5442
- var import_jsx_runtime62 = require("react/jsx-runtime");
5507
+ var import_jsx_runtime63 = require("react/jsx-runtime");
5443
5508
  function ReadingPassage({
5444
5509
  data,
5445
5510
  collapsible,
@@ -5448,10 +5513,10 @@ function ReadingPassage({
5448
5513
  textRef,
5449
5514
  onToggle
5450
5515
  }) {
5451
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Card, { className: "rqk-reading-card", children: [
5452
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "rqk-reading-head", children: [
5453
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "rqk-reading-title", children: data.title }),
5454
- collapsible ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5516
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Card, { className: "rqk-reading-card", children: [
5517
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "rqk-reading-head", children: [
5518
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "rqk-reading-title", children: data.title }),
5519
+ collapsible ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5455
5520
  "button",
5456
5521
  {
5457
5522
  type: "button",
@@ -5462,12 +5527,12 @@ function ReadingPassage({
5462
5527
  }
5463
5528
  ) : null
5464
5529
  ] }),
5465
- /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5530
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5466
5531
  "div",
5467
5532
  {
5468
5533
  className: classNames("rqk-reading-body", folded && "rqk-is-collapsed"),
5469
5534
  style: { maxHeight: folded ? 80 : fullHeight || void 0 },
5470
- children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5535
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5471
5536
  "div",
5472
5537
  {
5473
5538
  ref: (element) => {
@@ -5483,7 +5548,7 @@ function ReadingPassage({
5483
5548
  }
5484
5549
 
5485
5550
  // src/questions/reading-comprehension/question-chips.tsx
5486
- var import_jsx_runtime63 = require("react/jsx-runtime");
5551
+ var import_jsx_runtime64 = require("react/jsx-runtime");
5487
5552
  function ReadingChips({
5488
5553
  data,
5489
5554
  answers,
@@ -5493,12 +5558,12 @@ function ReadingChips({
5493
5558
  readonly,
5494
5559
  onPick
5495
5560
  }) {
5496
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "rqk-reading-chips", children: [
5497
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "rqk-reading-chips-label", children: "\u5C0F\u9898" }),
5561
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "rqk-reading-chips", children: [
5562
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "rqk-reading-chips-label", children: "\u5C0F\u9898" }),
5498
5563
  data.questions.map((item, questionIndex) => {
5499
5564
  const value = answers[questionIndex];
5500
5565
  const ok = judged && value === item.answer;
5501
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5566
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
5502
5567
  "button",
5503
5568
  {
5504
5569
  type: "button",
@@ -5521,7 +5586,7 @@ function ReadingChips({
5521
5586
  }
5522
5587
 
5523
5588
  // src/questions/reading-comprehension/question-card.tsx
5524
- var import_jsx_runtime64 = require("react/jsx-runtime");
5589
+ var import_jsx_runtime65 = require("react/jsx-runtime");
5525
5590
  function ReadingQuestion({
5526
5591
  data,
5527
5592
  current,
@@ -5533,18 +5598,18 @@ function ReadingQuestion({
5533
5598
  }) {
5534
5599
  const question = data.questions[current];
5535
5600
  if (!question) return null;
5536
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Card, { className: "rqk-reading-question", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "rqk-reading-qbody", children: [
5537
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "rqk-reading-stem", children: [
5538
- /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("span", { className: "rqk-reading-stem-index", children: [
5601
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Card, { className: "rqk-reading-question", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "rqk-reading-qbody", children: [
5602
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "rqk-reading-stem", children: [
5603
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "rqk-reading-stem-index", children: [
5539
5604
  current + 1,
5540
5605
  "."
5541
5606
  ] }),
5542
5607
  question.stem
5543
5608
  ] }),
5544
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "rqk-reading-options", children: question.options.map((option, optionIndex) => {
5609
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "rqk-reading-options", children: question.options.map((option, optionIndex) => {
5545
5610
  const chosen = answers[current] === optionIndex;
5546
5611
  const isAnswer = optionIndex === question.answer;
5547
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
5612
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
5548
5613
  "button",
5549
5614
  {
5550
5615
  type: "button",
@@ -5558,7 +5623,7 @@ function ReadingQuestion({
5558
5623
  onClick: () => onPick(optionIndex),
5559
5624
  disabled: readonly || locked[current],
5560
5625
  children: [
5561
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "rqk-reading-option-key", children: optionLetter(optionIndex) }),
5626
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "rqk-reading-option-key", children: optionLetter(optionIndex) }),
5562
5627
  option
5563
5628
  ]
5564
5629
  },
@@ -5569,7 +5634,7 @@ function ReadingQuestion({
5569
5634
  }
5570
5635
 
5571
5636
  // src/questions/reading-comprehension/reading-page.tsx
5572
- var import_jsx_runtime65 = require("react/jsx-runtime");
5637
+ var import_jsx_runtime66 = require("react/jsx-runtime");
5573
5638
  function ReadingPage({
5574
5639
  data,
5575
5640
  collapsible,
@@ -5585,8 +5650,8 @@ function ReadingPage({
5585
5650
  onChip,
5586
5651
  onPick
5587
5652
  }) {
5588
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
5589
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
5653
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
5654
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5590
5655
  ReadingPassage,
5591
5656
  {
5592
5657
  data,
@@ -5597,7 +5662,7 @@ function ReadingPage({
5597
5662
  onToggle
5598
5663
  }
5599
5664
  ),
5600
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
5665
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5601
5666
  ReadingChips,
5602
5667
  {
5603
5668
  data,
@@ -5609,7 +5674,7 @@ function ReadingPage({
5609
5674
  onPick: onChip
5610
5675
  }
5611
5676
  ),
5612
- /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
5677
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5613
5678
  ReadingQuestion,
5614
5679
  {
5615
5680
  data,
@@ -5776,7 +5841,7 @@ function useReadingComprehension({
5776
5841
  }
5777
5842
 
5778
5843
  // src/questions/reading-comprehension/index.tsx
5779
- var import_jsx_runtime66 = require("react/jsx-runtime");
5844
+ var import_jsx_runtime67 = require("react/jsx-runtime");
5780
5845
  function ReadingComprehension({
5781
5846
  data,
5782
5847
  mode = "answer",
@@ -5810,22 +5875,22 @@ function ReadingComprehension({
5810
5875
  onSubmit: model.handleSubmit,
5811
5876
  onRetry: model.judge.retry
5812
5877
  });
5813
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
5878
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
5814
5879
  QuestShell,
5815
5880
  {
5816
5881
  mode,
5817
5882
  title: title != null ? title : "\u9605\u8BFB\u7406\u89E3",
5818
5883
  index,
5819
5884
  total,
5820
- instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
5885
+ instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
5821
5886
  "\u9605\u8BFB\u77ED\u6587\uFF0C\u5B8C\u6210 ",
5822
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("b", { children: data.questions.length }),
5887
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("b", { children: data.questions.length }),
5823
5888
  " \u9053\u5C0F\u9898"
5824
5889
  ] }),
5825
5890
  onBack,
5826
5891
  className: classNames("rqk-quest", "rqk-reading", className),
5827
5892
  dataQuest: "reading-comprehension",
5828
- feedback: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5893
+ feedback: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5829
5894
  ReadingFeedback,
5830
5895
  {
5831
5896
  readonly: model.readonly,
@@ -5835,9 +5900,9 @@ function ReadingComprehension({
5835
5900
  answerText: model.answerText
5836
5901
  }
5837
5902
  ),
5838
- footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ActionBar, { actions, index, onPrev }) : void 0,
5903
+ footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ActionBar, { actions, index, total, onPrev }) : void 0,
5839
5904
  children: [
5840
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5905
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5841
5906
  ReadingPage,
5842
5907
  {
5843
5908
  data,
@@ -5855,7 +5920,7 @@ function ReadingComprehension({
5855
5920
  onPick: model.pick
5856
5921
  }
5857
5922
  ),
5858
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Toast, { children: model.notice })
5923
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Toast, { children: model.notice })
5859
5924
  ]
5860
5925
  }
5861
5926
  );
@@ -5865,67 +5930,69 @@ function ReadingComprehension({
5865
5930
  function listenTaskActions({
5866
5931
  feedback,
5867
5932
  completed,
5868
- onReplay,
5933
+ readonly,
5934
+ labels,
5869
5935
  onSubmit,
5870
5936
  onNext
5871
5937
  }) {
5872
5938
  const actions = [];
5873
5939
  if (feedback) {
5874
- actions.push({ key: "again", label: "\u518D\u542C\u4E00\u904D", variant: "ghost", onClick: onReplay });
5875
- actions.push({ key: "next", label: "\u5B8C\u6210\u5E76\u8FD4\u56DE", onClick: onNext });
5940
+ actions.push({ key: "next", label: labels.next, onClick: onNext });
5876
5941
  } else {
5877
5942
  actions.push({
5878
5943
  key: "submit",
5879
5944
  label: "\u63D0\u4EA4\u5E76\u67E5\u770B\u7EDF\u8BA1",
5880
5945
  onClick: onSubmit,
5881
- disabled: !completed
5946
+ disabled: !completed || readonly
5882
5947
  });
5883
5948
  }
5884
5949
  return actions;
5885
5950
  }
5886
5951
 
5887
5952
  // src/questions/listen-task/feedback.tsx
5888
- var import_jsx_runtime67 = require("react/jsx-runtime");
5953
+ var import_jsx_runtime68 = require("react/jsx-runtime");
5889
5954
  function ListenFeedback({
5890
5955
  data,
5891
- progress,
5892
- percent
5956
+ tracks,
5957
+ overall,
5958
+ timeOnTask
5893
5959
  }) {
5894
- var _a;
5960
+ var _a, _b;
5895
5961
  const stats = (_a = data.stats) != null ? _a : [
5896
5962
  {
5897
5963
  label: "\u542C\u97F3\u9891\u65F6\u957F",
5898
- value: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
5899
- (progress.timeOnTask / 60).toFixed(1),
5900
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("small", { children: "min" })
5964
+ value: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
5965
+ (timeOnTask / 60).toFixed(1),
5966
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("small", { children: "min" })
5901
5967
  ] })
5902
5968
  },
5903
5969
  {
5904
5970
  label: "\u97F3\u9891\u6570\u91CF",
5905
- value: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
5906
- "1",
5907
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("small", { children: "\u6BB5" })
5971
+ value: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
5972
+ tracks.length,
5973
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("small", { children: "\u6BB5" })
5908
5974
  ] })
5909
5975
  },
5910
5976
  {
5911
5977
  label: "\u5B8C\u6210\u5EA6",
5912
- value: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
5913
- percent,
5914
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("small", { children: "%" })
5978
+ value: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
5979
+ overall,
5980
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("small", { children: "%" })
5915
5981
  ] })
5916
5982
  }
5917
5983
  ];
5918
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "rqk-listen-feedback", children: [
5919
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Art, { name: "trophy", className: "rqk-listen-feedback-art" }),
5920
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("h2", { className: "rqk-listen-feedback-title", children: "\u542C\u529B\u5B8C\u6210" }),
5921
- /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("p", { className: "rqk-listen-feedback-sub", children: [
5922
- "\u5DF2\u542C\u5B8C 1 \u6BB5\u97F3\u9891 \xB7 \u6709\u6548\u64AD\u653E ",
5923
- percent,
5984
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "rqk-listen-feedback", children: [
5985
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Art, { name: "trophy", className: "rqk-listen-feedback-art" }),
5986
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("h2", { className: "rqk-listen-feedback-title", children: (_b = data.finishTitle) != null ? _b : "\u542C\u529B\u5B8C\u6210" }),
5987
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("p", { className: "rqk-listen-feedback-sub", children: [
5988
+ tracks.length,
5989
+ " \u6BB5\u97F3\u9891\u5168\u90E8\u5B8C\u6210 \xB7 \u6709\u6548\u64AD\u653E ",
5990
+ overall,
5924
5991
  "%"
5925
5992
  ] }),
5926
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "rqk-listen-stats", children: stats.map((stat, statIndex) => /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "rqk-listen-stat", children: [
5927
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "rqk-listen-stat-value", children: stat.value }),
5928
- /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "rqk-listen-stat-label", children: stat.label })
5993
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "rqk-listen-stats", children: stats.map((stat, statIndex) => /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "rqk-listen-stat", children: [
5994
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "rqk-listen-stat-value", children: stat.value }),
5995
+ /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "rqk-listen-stat-label", children: stat.label })
5929
5996
  ] }, statIndex)) })
5930
5997
  ] });
5931
5998
  }
@@ -5939,27 +6006,56 @@ function isArtName(value) {
5939
6006
  }
5940
6007
 
5941
6008
  // src/questions/listen-task/listen-hero.tsx
5942
- var import_jsx_runtime68 = require("react/jsx-runtime");
5943
- function ListenHero({ data }) {
5944
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(Card, { className: "rqk-listen-hero", children: [
5945
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "rqk-listen-art", children: [
5946
- data.cover && isArtName(data.cover) ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Art, { name: data.cover, className: "rqk-listen-cover-art" }) : data.cover ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("img", { className: "rqk-listen-cover-img", src: data.cover, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Art, { name: "headphones", className: "rqk-listen-cover-art" }),
5947
- data.badge ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "rqk-listen-badge", children: data.badge }) : null
6009
+ var import_jsx_runtime69 = require("react/jsx-runtime");
6010
+ function ListenHero({ data, compact = false }) {
6011
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Card, { className: classNames("rqk-listen-hero", compact && "rqk-is-compact"), children: [
6012
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "rqk-listen-art", children: [
6013
+ data.cover && isArtName(data.cover) ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Art, { name: data.cover, className: "rqk-listen-cover-art" }) : data.cover ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("img", { className: "rqk-listen-cover-img", src: data.cover, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Art, { name: "headphones", className: "rqk-listen-cover-art" }),
6014
+ data.badge ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "rqk-listen-badge", children: data.badge }) : null
5948
6015
  ] }),
5949
- /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "rqk-listen-meta", children: [
5950
- /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "rqk-listen-name", children: data.title }),
5951
- data.subtitle ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "rqk-listen-subtitle", children: data.subtitle }) : null
6016
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "rqk-listen-meta", children: [
6017
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "rqk-listen-name", children: data.title }),
6018
+ data.subtitle ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "rqk-listen-subtitle", children: data.subtitle }) : null
5952
6019
  ] })
5953
6020
  ] });
5954
6021
  }
5955
6022
 
6023
+ // src/questions/listen-task/listen-list.tsx
6024
+ var import_jsx_runtime70 = require("react/jsx-runtime");
6025
+ function ListenList({
6026
+ tracks,
6027
+ current,
6028
+ done,
6029
+ readonly,
6030
+ onSelect
6031
+ }) {
6032
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "rqk-listen-list", children: tracks.map((track, trackIndex) => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
6033
+ "button",
6034
+ {
6035
+ type: "button",
6036
+ className: classNames("rqk-listen-item", trackIndex === current && "rqk-is-current"),
6037
+ disabled: readonly,
6038
+ onClick: () => onSelect(trackIndex),
6039
+ children: [
6040
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "rqk-listen-item-no", children: trackIndex + 1 }),
6041
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("span", { className: "rqk-listen-item-text", children: [
6042
+ track.title,
6043
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("small", { children: trackIndex === current ? "\u5F53\u524D\u97F3\u9891" : `\u65F6\u957F ${formatTime(track.duration)}` })
6044
+ ] }),
6045
+ done(trackIndex) ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "rqk-listen-item-ok", children: "\u2713" }) : null
6046
+ ]
6047
+ },
6048
+ trackIndex
6049
+ )) });
6050
+ }
6051
+
5956
6052
  // src/questions/listen-task/listen-ring.tsx
5957
- var import_jsx_runtime69 = require("react/jsx-runtime");
6053
+ var import_jsx_runtime71 = require("react/jsx-runtime");
5958
6054
  function ListenRing({ percent }) {
5959
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "rqk-listen-ring", children: [
5960
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("svg", { width: "48", height: "48", viewBox: "0 0 48 48", "aria-hidden": true, children: [
5961
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("circle", { className: "rqk-listen-ring-bg", cx: "24", cy: "24", r: "20" }),
5962
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
6055
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "rqk-listen-ring", children: [
6056
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("svg", { width: "48", height: "48", viewBox: "0 0 48 48", "aria-hidden": true, children: [
6057
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("circle", { className: "rqk-listen-ring-bg", cx: "24", cy: "24", r: "20" }),
6058
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5963
6059
  "circle",
5964
6060
  {
5965
6061
  className: "rqk-listen-ring-fg",
@@ -5971,7 +6067,7 @@ function ListenRing({ percent }) {
5971
6067
  }
5972
6068
  )
5973
6069
  ] }),
5974
- /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("span", { className: classNames("rqk-listen-ring-text", percent >= 100 && "rqk-is-full"), children: [
6070
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("span", { className: classNames("rqk-listen-ring-text", percent >= 100 && "rqk-is-full"), children: [
5975
6071
  percent,
5976
6072
  "%"
5977
6073
  ] })
@@ -5979,107 +6075,111 @@ function ListenRing({ percent }) {
5979
6075
  }
5980
6076
 
5981
6077
  // src/questions/listen-task/listen-player.tsx
5982
- var import_jsx_runtime70 = require("react/jsx-runtime");
5983
- function ListenPlayer({
5984
- data,
5985
- progress,
5986
- percent
5987
- }) {
5988
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "rqk-listen-player", children: [
5989
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "rqk-listen-top", children: [
5990
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
6078
+ var import_jsx_runtime72 = require("react/jsx-runtime");
6079
+ function ListenPlayer({ model }) {
6080
+ var _a;
6081
+ const track = model.track;
6082
+ if (!track) return null;
6083
+ const percent = model.percentFor(model.current);
6084
+ const credit = (_a = model.credits[model.current]) != null ? _a : 0;
6085
+ const duration = Math.max(track.duration, 0);
6086
+ const ratio = duration ? Math.min(1, model.position / duration) : 0;
6087
+ return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "rqk-listen-player", children: [
6088
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "rqk-listen-top", children: [
6089
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5991
6090
  "button",
5992
6091
  {
5993
6092
  type: "button",
5994
6093
  className: "rqk-listen-play",
5995
- onClick: progress.toggle,
5996
- "aria-label": progress.playing ? "\u6682\u505C" : "\u64AD\u653E",
5997
- children: progress.playing ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PauseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PlayIcon, {})
6094
+ onClick: model.toggle,
6095
+ "aria-label": model.playing ? "\u6682\u505C" : "\u64AD\u653E",
6096
+ children: model.playing ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(PauseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(PlayIcon, {})
5998
6097
  }
5999
6098
  ),
6000
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "rqk-listen-info", children: [
6001
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "rqk-listen-state", children: progress.playing ? "\u6B63\u5728\u64AD\u653E\u2026" : progress.finished ? "\u64AD\u653E\u5B8C\u6BD5" : "\u5DF2\u6682\u505C" }),
6002
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "rqk-listen-hint", children: progress.playing ? "\u64AD\u653E\u4E2D\u2026" : "\u70B9\u51FB\u64AD\u653E" })
6099
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "rqk-listen-info", children: [
6100
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "rqk-listen-state", children: model.playing ? "\u6B63\u5728\u64AD\u653E\u2026" : model.finished ? "\u64AD\u653E\u5B8C\u6BD5" : "\u5DF2\u6682\u505C" }),
6101
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "rqk-listen-hint", children: model.tracks.length > 1 ? `\u7B2C ${model.current + 1} \u6BB5 \xB7 \u5171 ${model.tracks.length} \u6BB5` : model.playing ? "\u64AD\u653E\u4E2D\u2026" : "\u70B9\u51FB\u64AD\u653E" })
6003
6102
  ] })
6004
6103
  ] }),
6005
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
6104
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
6006
6105
  "div",
6007
6106
  {
6008
6107
  className: "rqk-listen-track",
6009
6108
  onPointerDown: (event) => {
6109
+ if (model.readonly) return;
6010
6110
  const rect = event.currentTarget.getBoundingClientRect();
6011
- const ratio = Math.min(1, Math.max(0, (event.clientX - rect.left) / rect.width));
6012
- progress.seek(ratio * data.duration);
6111
+ const next = Math.min(1, Math.max(0, (event.clientX - rect.left) / rect.width));
6112
+ model.seek(next * duration);
6013
6113
  },
6014
6114
  children: [
6015
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "rqk-listen-buffer" }),
6016
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
6017
- "div",
6018
- {
6019
- className: "rqk-listen-fill",
6020
- style: { width: `${progress.position / data.duration * 100}%` }
6021
- }
6022
- ),
6023
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
6024
- "div",
6025
- {
6026
- className: "rqk-listen-knob",
6027
- style: { left: `${progress.position / data.duration * 100}%` }
6028
- }
6029
- )
6115
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "rqk-listen-buffer" }),
6116
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "rqk-listen-fill", style: { width: `${ratio * 100}%` } }),
6117
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "rqk-listen-knob", style: { left: `${ratio * 100}%` } })
6030
6118
  ]
6031
6119
  }
6032
6120
  ),
6033
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "rqk-listen-times", children: [
6034
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { children: formatTime(progress.position) }),
6035
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { children: formatTime(data.duration) })
6121
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "rqk-listen-times", children: [
6122
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { children: formatTime(model.position) }),
6123
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { children: formatTime(duration) })
6036
6124
  ] }),
6037
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "rqk-listen-controls", children: [
6038
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
6125
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "rqk-listen-controls", children: [
6126
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
6039
6127
  "button",
6040
6128
  {
6041
6129
  type: "button",
6042
- className: classNames("rqk-listen-loop", progress.loop && "rqk-is-on"),
6043
- onClick: () => progress.setLoop(!progress.loop),
6130
+ className: classNames("rqk-listen-loop", model.loop && "rqk-is-on"),
6131
+ disabled: model.readonly,
6132
+ onClick: () => model.setLoop(!model.loop),
6044
6133
  children: [
6045
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(LoopIcon, {}),
6134
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(LoopIcon, {}),
6046
6135
  "\u5FAA\u73AF"
6047
6136
  ]
6048
6137
  }
6049
6138
  ),
6050
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
6139
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
6051
6140
  SegmentedControl,
6052
6141
  {
6053
6142
  ariaLabel: "\u64AD\u653E\u901F\u5EA6",
6054
6143
  className: "rqk-listen-speeds",
6055
6144
  options: SPEED_OPTIONS,
6056
- value: `${progress.speed}`,
6057
- onChange: (value) => progress.setSpeed(Number(value))
6145
+ value: `${model.speed}`,
6146
+ disabled: model.readonly,
6147
+ onChange: (value) => model.setSpeed(Number(value))
6058
6148
  }
6059
6149
  )
6060
6150
  ] }),
6061
- /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "rqk-listen-progress", children: [
6062
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ListenRing, { percent }),
6063
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "rqk-listen-credit", children: Math.abs(progress.position - progress.credited) > 0.75 ? /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
6151
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "rqk-listen-progress", children: [
6152
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ListenRing, { percent }),
6153
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "rqk-listen-credit", children: Math.abs(model.position - credit) > 0.75 ? /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
6064
6154
  "\u64AD\u653E ",
6065
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("b", { children: formatTime(progress.position) }),
6155
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("b", { children: formatTime(model.position) }),
6066
6156
  " / ",
6067
- formatTime(data.duration),
6068
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "rqk-listen-credit-sep", children: "\xB7" }),
6157
+ formatTime(duration),
6158
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "rqk-listen-credit-sep", children: "\xB7" }),
6069
6159
  "\u6709\u6548 ",
6070
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("b", { children: formatTime(progress.credited) })
6071
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
6160
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("b", { children: formatTime(credit) })
6161
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
6072
6162
  "\u6709\u6548\u64AD\u653E ",
6073
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("b", { children: formatTime(progress.credited) }),
6163
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("b", { children: formatTime(credit) }),
6074
6164
  " / ",
6075
- formatTime(data.duration)
6165
+ formatTime(duration)
6076
6166
  ] }) })
6077
6167
  ] }),
6078
- data.audio ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
6168
+ model.tracks.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
6169
+ ListenList,
6170
+ {
6171
+ tracks: model.tracks,
6172
+ current: model.current,
6173
+ done: model.done,
6174
+ readonly: model.readonly,
6175
+ onSelect: model.selectTrack
6176
+ }
6177
+ ) : null,
6178
+ track.audio ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
6079
6179
  "audio",
6080
6180
  {
6081
- ref: progress.mediaRef,
6082
- src: data.audio,
6181
+ ref: model.audioRef,
6182
+ src: track.audio,
6083
6183
  preload: "metadata"
6084
6184
  }
6085
6185
  ) : null
@@ -6088,32 +6188,222 @@ function ListenPlayer({
6088
6188
 
6089
6189
  // src/questions/listen-task/use-listen-task.ts
6090
6190
  var import_react27 = require("react");
6091
- function useListenTask({ data, onSubmit }) {
6191
+ var TICK_MS2 = 100;
6192
+ function useListenTask({
6193
+ data,
6194
+ onSubmit,
6195
+ mode = "answer",
6196
+ initialRatios
6197
+ }) {
6198
+ var _a, _b, _c, _d, _e;
6199
+ const tracks = (0, import_react27.useMemo)(() => {
6200
+ var _a2, _b2;
6201
+ if ((_a2 = data.audios) == null ? void 0 : _a2.length) return data.audios;
6202
+ return [{ title: data.title, audio: data.audio, duration: (_b2 = data.duration) != null ? _b2 : 0 }];
6203
+ }, [data]);
6204
+ const readonly = mode === "lookup" || mode === "preview";
6205
+ const ratios = tracks.map(
6206
+ (_, index) => {
6207
+ var _a2;
6208
+ return Math.min(1, Math.max(0, (_a2 = initialRatios == null ? void 0 : initialRatios[index]) != null ? _a2 : 0));
6209
+ }
6210
+ );
6211
+ const secondsFor = (ratio, track2) => Math.min(track2.duration, Math.max(0, ratio * track2.duration));
6212
+ const initial = tracks.map((track2, index) => secondsFor(ratios[index], track2));
6092
6213
  const [view, setView] = (0, import_react27.useState)("task");
6093
- const progress = useMediaProgress({
6094
- duration: data.duration,
6095
- src: data.audio,
6096
- speed: 1
6097
- });
6098
- const percent = Math.min(100, Math.round(progress.ratio * 100));
6214
+ const [current, setCurrent] = (0, import_react27.useState)(0);
6215
+ const [position, setPosition] = (0, import_react27.useState)((_a = initial[0]) != null ? _a : 0);
6216
+ const [credits, setCredits] = (0, import_react27.useState)(initial);
6217
+ const [playing, setPlaying] = (0, import_react27.useState)(false);
6218
+ const [finished, setFinished] = (0, import_react27.useState)(false);
6219
+ const [speed, setSpeedState] = (0, import_react27.useState)(1);
6220
+ const [loop, setLoopState] = (0, import_react27.useState)(false);
6221
+ const [timeOnTask, setTimeOnTask] = (0, import_react27.useState)(0);
6222
+ const audioRef = (0, import_react27.useRef)(null);
6223
+ const positionRef = (0, import_react27.useRef)((_b = initial[0]) != null ? _b : 0);
6224
+ const creditRef = (0, import_react27.useRef)((_c = initial[0]) != null ? _c : 0);
6225
+ const playingRef = (0, import_react27.useRef)(false);
6226
+ const speedRef = (0, import_react27.useRef)(1);
6227
+ const loopRef = (0, import_react27.useRef)(false);
6228
+ const track = (_d = tracks[current]) != null ? _d : tracks[0];
6229
+ const duration = (_e = track == null ? void 0 : track.duration) != null ? _e : 0;
6230
+ (0, import_react27.useEffect)(() => {
6231
+ var _a2;
6232
+ const next = tracks.map((t, i) => secondsFor(ratios[i], t));
6233
+ setCredits(next);
6234
+ const credit = (_a2 = next[current]) != null ? _a2 : 0;
6235
+ creditRef.current = credit;
6236
+ positionRef.current = Math.min(track.duration, credit);
6237
+ setPosition(positionRef.current);
6238
+ }, [tracks]);
6239
+ const applyPosition = (value) => {
6240
+ const next = Math.min(duration, Math.max(0, value));
6241
+ positionRef.current = next;
6242
+ setPosition(next);
6243
+ };
6244
+ const applyCredit = (value) => {
6245
+ const next = Math.min(duration, Math.max(0, value));
6246
+ creditRef.current = next;
6247
+ setCredits((values) => values.map((item, itemIndex) => itemIndex === current ? next : item));
6248
+ };
6249
+ const pause = () => {
6250
+ var _a2;
6251
+ playingRef.current = false;
6252
+ setPlaying(false);
6253
+ (_a2 = audioRef.current) == null ? void 0 : _a2.pause();
6254
+ };
6255
+ const toggle = () => {
6256
+ var _a2;
6257
+ if (playingRef.current) {
6258
+ pause();
6259
+ return;
6260
+ }
6261
+ if (positionRef.current >= duration) {
6262
+ applyPosition(0);
6263
+ setFinished(false);
6264
+ }
6265
+ playingRef.current = true;
6266
+ setPlaying(true);
6267
+ if (track == null ? void 0 : track.audio) void ((_a2 = audioRef.current) == null ? void 0 : _a2.play().catch(() => void 0));
6268
+ };
6269
+ const seek = (seconds) => {
6270
+ if (readonly) return;
6271
+ applyPosition(seconds);
6272
+ if (seconds < duration) setFinished(false);
6273
+ if (audioRef.current) audioRef.current.currentTime = Math.max(0, Math.min(duration, seconds));
6274
+ };
6275
+ const setSpeed = (value) => {
6276
+ if (readonly) return;
6277
+ speedRef.current = value;
6278
+ setSpeedState(value);
6279
+ if (audioRef.current) audioRef.current.playbackRate = value;
6280
+ };
6281
+ const setLoop = (value) => {
6282
+ if (readonly) return;
6283
+ loopRef.current = value;
6284
+ setLoopState(value);
6285
+ if (audioRef.current) audioRef.current.loop = value;
6286
+ };
6287
+ const selectTrack = (trackIndex) => {
6288
+ var _a2, _b2;
6289
+ if (readonly || trackIndex === current) return;
6290
+ playingRef.current = false;
6291
+ setPlaying(false);
6292
+ setFinished(false);
6293
+ (_a2 = audioRef.current) == null ? void 0 : _a2.pause();
6294
+ setCurrent(trackIndex);
6295
+ positionRef.current = 0;
6296
+ creditRef.current = (_b2 = credits[trackIndex]) != null ? _b2 : 0;
6297
+ setPosition(0);
6298
+ };
6299
+ (0, import_react27.useEffect)(() => {
6300
+ if ((track == null ? void 0 : track.audio) || !playing) return void 0;
6301
+ const timer = window.setInterval(() => {
6302
+ if (!playingRef.current) return;
6303
+ const delta = TICK_MS2 / 1e3 * speedRef.current;
6304
+ let next = positionRef.current + delta;
6305
+ let stopped = false;
6306
+ if (next >= duration) {
6307
+ if (loopRef.current && duration > 0) {
6308
+ next -= duration;
6309
+ } else {
6310
+ next = duration;
6311
+ stopped = true;
6312
+ }
6313
+ }
6314
+ applyPosition(next);
6315
+ applyCredit(creditRef.current + delta);
6316
+ setTimeOnTask((value) => value + TICK_MS2 / 1e3);
6317
+ if (stopped) {
6318
+ playingRef.current = false;
6319
+ setPlaying(false);
6320
+ setFinished(true);
6321
+ }
6322
+ }, TICK_MS2);
6323
+ return () => window.clearInterval(timer);
6324
+ }, [duration, playing, track == null ? void 0 : track.audio]);
6325
+ (0, import_react27.useEffect)(() => {
6326
+ const media = audioRef.current;
6327
+ if (!media || !(track == null ? void 0 : track.audio)) return void 0;
6328
+ media.playbackRate = speedRef.current;
6329
+ media.loop = loopRef.current;
6330
+ const handleTime = () => {
6331
+ const next = media.currentTime;
6332
+ const delta = next - positionRef.current;
6333
+ if (delta > 0 && delta < 1.2) {
6334
+ applyCredit(creditRef.current + delta);
6335
+ setTimeOnTask((value) => value + delta);
6336
+ }
6337
+ applyPosition(next);
6338
+ };
6339
+ const handleEnded = () => {
6340
+ setFinished(true);
6341
+ if (!loopRef.current) {
6342
+ playingRef.current = false;
6343
+ setPlaying(false);
6344
+ }
6345
+ };
6346
+ media.addEventListener("timeupdate", handleTime);
6347
+ media.addEventListener("ended", handleEnded);
6348
+ return () => {
6349
+ media.removeEventListener("timeupdate", handleTime);
6350
+ media.removeEventListener("ended", handleEnded);
6351
+ };
6352
+ }, [current, track == null ? void 0 : track.audio]);
6353
+ const percentFor = (trackIndex) => {
6354
+ var _a2;
6355
+ const item = tracks[trackIndex];
6356
+ if (!item || item.duration <= 0) return 0;
6357
+ return Math.min(100, Math.round(((_a2 = credits[trackIndex]) != null ? _a2 : 0) / item.duration * 100));
6358
+ };
6359
+ const done = (trackIndex) => percentFor(trackIndex) >= 90;
6360
+ const allDone = tracks.every((_item, trackIndex) => done(trackIndex));
6361
+ const overall = Math.round(
6362
+ tracks.reduce(
6363
+ (sum, item, trackIndex) => {
6364
+ var _a2;
6365
+ return sum + (item.duration > 0 ? Math.min(1, ((_a2 = credits[trackIndex]) != null ? _a2 : 0) / item.duration) : 0);
6366
+ },
6367
+ 0
6368
+ ) / tracks.length * 100
6369
+ );
6099
6370
  const handleSubmit = () => {
6100
6371
  setView("feedback");
6101
6372
  onSubmit == null ? void 0 : onSubmit({
6102
6373
  correct: true,
6103
6374
  attempts: 1,
6104
- answer: { ratio: progress.ratio }
6375
+ answer: { credits }
6105
6376
  });
6106
6377
  };
6107
- const replay = () => {
6108
- progress.pause();
6109
- progress.seek(0);
6110
- setView("task");
6378
+ return {
6379
+ allDone,
6380
+ audioRef,
6381
+ credits,
6382
+ current,
6383
+ done,
6384
+ finished,
6385
+ handleSubmit,
6386
+ loop,
6387
+ overall,
6388
+ percentFor,
6389
+ playing,
6390
+ position,
6391
+ readonly,
6392
+ selectTrack,
6393
+ setLoop,
6394
+ setSpeed,
6395
+ speed,
6396
+ timeOnTask,
6397
+ toggle,
6398
+ track,
6399
+ tracks,
6400
+ view,
6401
+ seek
6111
6402
  };
6112
- return { handleSubmit, percent, progress, replay, view };
6113
6403
  }
6114
6404
 
6115
6405
  // src/questions/listen-task/index.tsx
6116
- var import_jsx_runtime71 = require("react/jsx-runtime");
6406
+ var import_jsx_runtime73 = require("react/jsx-runtime");
6117
6407
  function ListenTask({
6118
6408
  data,
6119
6409
  mode = "answer",
@@ -6125,35 +6415,50 @@ function ListenTask({
6125
6415
  onPrev,
6126
6416
  onNext,
6127
6417
  onSubmit,
6128
- className
6418
+ bare,
6419
+ className,
6420
+ initialRatios
6129
6421
  }) {
6130
- const model = useListenTask({ data, onSubmit });
6422
+ const labels = useQuestLabels();
6423
+ const model = useListenTask({ data, onSubmit, mode, initialRatios });
6131
6424
  const actions = listenTaskActions({
6132
6425
  feedback: model.view === "feedback",
6133
- completed: model.progress.completed,
6134
- onReplay: model.replay,
6426
+ completed: model.allDone,
6427
+ readonly: model.readonly,
6428
+ labels,
6135
6429
  onSubmit: model.handleSubmit,
6136
6430
  onNext
6137
6431
  });
6138
- return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
6432
+ return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
6139
6433
  QuestShell,
6140
6434
  {
6141
6435
  mode,
6142
6436
  title: title != null ? title : model.view === "feedback" ? "\u542C\u529B\u7EDF\u8BA1" : "\u542C\u529B\u4EFB\u52A1",
6143
6437
  index,
6144
6438
  total,
6145
- instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, { children: [
6146
- "\u542C\u5B8C\u97F3\u9891\uFF0C\u6709\u6548\u64AD\u653E ",
6147
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("b", { children: "\u226590%" }),
6148
- " \u89C6\u4E3A\u5B8C\u6210"
6439
+ instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
6440
+ model.tracks.length > 1 ? "\u542C\u5B8C\u6BCF\u6BB5\u97F3\u9891" : "\u542C\u5B8C\u97F3\u9891",
6441
+ "\uFF0C\u6709\u6548\u64AD\u653E ",
6442
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("b", { children: "\u226590%" }),
6443
+ " ",
6444
+ "\u89C6\u4E3A\u5B8C\u6210"
6149
6445
  ] }),
6150
6446
  onBack,
6447
+ bare,
6151
6448
  className: classNames("rqk-quest", "rqk-listen", className),
6152
6449
  dataQuest: "listen-task",
6153
- footer: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ActionBar, { actions, index, onPrev }),
6154
- children: model.view === "feedback" ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ListenFeedback, { data, progress: model.progress, percent: model.percent }) : /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_jsx_runtime71.Fragment, { children: [
6155
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ListenHero, { data }),
6156
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ListenPlayer, { data, progress: model.progress, percent: model.percent })
6450
+ footer: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ActionBar, { actions, index, total, onPrev }),
6451
+ children: model.view === "feedback" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
6452
+ ListenFeedback,
6453
+ {
6454
+ data,
6455
+ tracks: model.tracks,
6456
+ overall: model.overall,
6457
+ timeOnTask: model.timeOnTask
6458
+ }
6459
+ ) : /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
6460
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ListenHero, { data, compact: model.tracks.length > 1 }),
6461
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ListenPlayer, { model })
6157
6462
  ] })
6158
6463
  }
6159
6464
  );
@@ -6163,14 +6468,13 @@ function ListenTask({
6163
6468
  function videoTaskActions({
6164
6469
  feedback,
6165
6470
  allDone,
6166
- onReplay,
6471
+ labels,
6167
6472
  onSubmit,
6168
6473
  onNext
6169
6474
  }) {
6170
6475
  const actions = [];
6171
6476
  if (feedback) {
6172
- actions.push({ key: "again", label: "\u518D\u770B\u4E00\u904D", variant: "ghost", onClick: onReplay });
6173
- actions.push({ key: "next", label: "\u5B8C\u6210\u5E76\u8FD4\u56DE", onClick: onNext });
6477
+ actions.push({ key: "next", label: labels.next, onClick: onNext });
6174
6478
  } else {
6175
6479
  actions.push({
6176
6480
  key: "submit",
@@ -6183,7 +6487,7 @@ function videoTaskActions({
6183
6487
  }
6184
6488
 
6185
6489
  // src/questions/video-task/feedback.tsx
6186
- var import_jsx_runtime72 = require("react/jsx-runtime");
6490
+ var import_jsx_runtime74 = require("react/jsx-runtime");
6187
6491
  function VideoFeedback({
6188
6492
  data,
6189
6493
  overall,
@@ -6193,63 +6497,63 @@ function VideoFeedback({
6193
6497
  const stats = (_a = data.stats) != null ? _a : [
6194
6498
  {
6195
6499
  label: "\u89C2\u770B\u65F6\u957F",
6196
- value: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
6500
+ value: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
6197
6501
  (timeOnTask / 60).toFixed(1),
6198
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("small", { children: "min" })
6502
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("small", { children: "min" })
6199
6503
  ] })
6200
6504
  },
6201
6505
  {
6202
6506
  label: "\u89C6\u9891\u6570\u91CF",
6203
- value: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
6507
+ value: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
6204
6508
  data.videos.length,
6205
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("small", { children: "\u4E2A" })
6509
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("small", { children: "\u4E2A" })
6206
6510
  ] })
6207
6511
  },
6208
6512
  {
6209
6513
  label: "\u5B8C\u6210\u5EA6",
6210
- value: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
6514
+ value: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
6211
6515
  overall,
6212
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("small", { children: "%" })
6516
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("small", { children: "%" })
6213
6517
  ] })
6214
6518
  }
6215
6519
  ];
6216
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "rqk-video-feedback", children: [
6217
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Art, { name: "trophy", className: "rqk-video-feedback-art" }),
6218
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("h2", { className: "rqk-video-feedback-title", children: (_b = data.finishTitle) != null ? _b : "\u89C6\u9891\u770B\u5B8C\u5566" }),
6219
- /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("p", { className: "rqk-video-feedback-sub", children: [
6520
+ return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "rqk-video-feedback", children: [
6521
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Art, { name: "trophy", className: "rqk-video-feedback-art" }),
6522
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("h2", { className: "rqk-video-feedback-title", children: (_b = data.finishTitle) != null ? _b : "\u89C6\u9891\u770B\u5B8C\u5566" }),
6523
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("p", { className: "rqk-video-feedback-sub", children: [
6220
6524
  data.videos.length,
6221
6525
  " \u4E2A\u89C6\u9891\u5168\u90E8\u5B8C\u6210 \xB7 \u6709\u6548\u89C2\u770B ",
6222
6526
  overall,
6223
6527
  "%"
6224
6528
  ] }),
6225
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "rqk-video-stats", children: stats.map((stat, statIndex) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "rqk-video-stat", children: [
6226
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "rqk-video-stat-value", children: stat.value }),
6227
- /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "rqk-video-stat-label", children: stat.label })
6529
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "rqk-video-stats", children: stats.map((stat, statIndex) => /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "rqk-video-stat", children: [
6530
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "rqk-video-stat-value", children: stat.value }),
6531
+ /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "rqk-video-stat-label", children: stat.label })
6228
6532
  ] }, statIndex)) })
6229
6533
  ] });
6230
6534
  }
6231
6535
 
6232
6536
  // src/questions/video-task/video-list.tsx
6233
- var import_jsx_runtime73 = require("react/jsx-runtime");
6537
+ var import_jsx_runtime75 = require("react/jsx-runtime");
6234
6538
  function VideoList({
6235
6539
  data,
6236
6540
  current,
6237
6541
  done,
6238
6542
  onSelect
6239
6543
  }) {
6240
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "rqk-video-list", children: data.videos.map((item, videoIndex) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
6544
+ return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "rqk-video-list", children: data.videos.map((item, videoIndex) => /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
6241
6545
  "button",
6242
6546
  {
6243
6547
  type: "button",
6244
6548
  className: classNames("rqk-video-item", videoIndex === current && "rqk-is-current"),
6245
6549
  onClick: () => onSelect(videoIndex),
6246
6550
  children: [
6247
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "rqk-video-item-no", children: videoIndex + 1 }),
6248
- /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "rqk-video-item-text", children: [
6551
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "rqk-video-item-no", children: videoIndex + 1 }),
6552
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("span", { className: "rqk-video-item-text", children: [
6249
6553
  item.title,
6250
- /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("small", { children: videoIndex === current ? "\u6B63\u5728\u89C2\u770B" : `\u65F6\u957F ${formatTime(item.duration)}` })
6554
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("small", { children: videoIndex === current ? "\u6B63\u5728\u89C2\u770B" : `\u65F6\u957F ${formatTime(item.duration)}` })
6251
6555
  ] }),
6252
- done(videoIndex) ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "rqk-video-item-ok", children: "\u2713" }) : null
6556
+ done(videoIndex) ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "rqk-video-item-ok", children: "\u2713" }) : null
6253
6557
  ]
6254
6558
  },
6255
6559
  videoIndex
@@ -6257,12 +6561,12 @@ function VideoList({
6257
6561
  }
6258
6562
 
6259
6563
  // src/questions/video-task/video-ring.tsx
6260
- var import_jsx_runtime74 = require("react/jsx-runtime");
6564
+ var import_jsx_runtime76 = require("react/jsx-runtime");
6261
6565
  function VideoRing({ percent }) {
6262
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "rqk-video-ring", children: [
6263
- /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("svg", { width: "48", height: "48", viewBox: "0 0 48 48", "aria-hidden": true, children: [
6264
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("circle", { className: "rqk-video-ring-bg", cx: "24", cy: "24", r: "20" }),
6265
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
6566
+ return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "rqk-video-ring", children: [
6567
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("svg", { width: "48", height: "48", viewBox: "0 0 48 48", "aria-hidden": true, children: [
6568
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("circle", { className: "rqk-video-ring-bg", cx: "24", cy: "24", r: "20" }),
6569
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
6266
6570
  "circle",
6267
6571
  {
6268
6572
  className: "rqk-video-ring-fg",
@@ -6275,7 +6579,7 @@ function VideoRing({ percent }) {
6275
6579
  }
6276
6580
  )
6277
6581
  ] }),
6278
- /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("span", { className: classNames("rqk-video-ring-text", percent >= 100 && "rqk-is-full"), children: [
6582
+ /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("span", { className: classNames("rqk-video-ring-text", percent >= 100 && "rqk-is-full"), children: [
6279
6583
  percent,
6280
6584
  "%"
6281
6585
  ] })
@@ -6283,7 +6587,7 @@ function VideoRing({ percent }) {
6283
6587
  }
6284
6588
 
6285
6589
  // src/questions/video-task/video-controls.tsx
6286
- var import_jsx_runtime75 = require("react/jsx-runtime");
6590
+ var import_jsx_runtime77 = require("react/jsx-runtime");
6287
6591
  function VideoControls({
6288
6592
  data,
6289
6593
  video,
@@ -6300,24 +6604,24 @@ function VideoControls({
6300
6604
  applyPosition
6301
6605
  }) {
6302
6606
  var _a, _b, _c;
6303
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Card, { className: "rqk-video-controls", children: [
6304
- /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "rqk-video-ctrl", children: [
6305
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
6607
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Card, { className: "rqk-video-controls", children: [
6608
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "rqk-video-ctrl", children: [
6609
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
6306
6610
  "button",
6307
6611
  {
6308
6612
  type: "button",
6309
6613
  className: "rqk-video-mini",
6310
6614
  onClick: onToggle,
6311
6615
  "aria-label": playing ? "\u6682\u505C" : "\u64AD\u653E",
6312
- children: playing ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(PauseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(PlayIcon, {})
6616
+ children: playing ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(PauseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(PlayIcon, {})
6313
6617
  }
6314
6618
  ),
6315
- /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "rqk-video-scrub", children: [
6316
- /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "rqk-video-times", children: [
6317
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { children: formatTime(position) }),
6318
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { children: formatTime(video.duration) })
6619
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "rqk-video-scrub", children: [
6620
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "rqk-video-times", children: [
6621
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: formatTime(position) }),
6622
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: formatTime(video.duration) })
6319
6623
  ] }),
6320
- /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
6624
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
6321
6625
  "div",
6322
6626
  {
6323
6627
  className: "rqk-video-track",
@@ -6327,14 +6631,14 @@ function VideoControls({
6327
6631
  applyPosition(ratio * video.duration);
6328
6632
  },
6329
6633
  children: [
6330
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
6634
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
6331
6635
  "div",
6332
6636
  {
6333
6637
  className: "rqk-video-fill",
6334
6638
  style: { width: `${position / video.duration * 100}%` }
6335
6639
  }
6336
6640
  ),
6337
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
6641
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
6338
6642
  "div",
6339
6643
  {
6340
6644
  className: "rqk-video-knob",
@@ -6345,40 +6649,40 @@ function VideoControls({
6345
6649
  }
6346
6650
  )
6347
6651
  ] }),
6348
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
6652
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
6349
6653
  "button",
6350
6654
  {
6351
6655
  type: "button",
6352
6656
  className: classNames("rqk-video-mini", fullscreen && "rqk-is-on"),
6353
6657
  onClick: onFullscreen,
6354
6658
  "aria-label": "\u5207\u6362\u5168\u5C4F",
6355
- children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FullscreenIcon, {})
6659
+ children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(FullscreenIcon, {})
6356
6660
  }
6357
6661
  )
6358
6662
  ] }),
6359
- /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "rqk-video-progress", children: [
6360
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(VideoRing, { percent: percentFor(current) }),
6361
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "rqk-video-credit", children: Math.abs(position - ((_a = credits[current]) != null ? _a : 0)) > 0.75 ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
6663
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "rqk-video-progress", children: [
6664
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(VideoRing, { percent: percentFor(current) }),
6665
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "rqk-video-credit", children: Math.abs(position - ((_a = credits[current]) != null ? _a : 0)) > 0.75 ? /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
6362
6666
  "\u64AD\u653E ",
6363
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("b", { children: formatTime(position) }),
6667
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("b", { children: formatTime(position) }),
6364
6668
  " / ",
6365
6669
  formatTime(video.duration),
6366
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "rqk-video-credit-sep", children: "\xB7" }),
6670
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "rqk-video-credit-sep", children: "\xB7" }),
6367
6671
  "\u6709\u6548 ",
6368
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("b", { children: formatTime((_b = credits[current]) != null ? _b : 0) })
6369
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
6672
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("b", { children: formatTime((_b = credits[current]) != null ? _b : 0) })
6673
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
6370
6674
  "\u6709\u6548\u89C2\u770B ",
6371
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("b", { children: formatTime((_c = credits[current]) != null ? _c : 0) }),
6675
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("b", { children: formatTime((_c = credits[current]) != null ? _c : 0) }),
6372
6676
  " / ",
6373
6677
  formatTime(video.duration)
6374
6678
  ] }) })
6375
6679
  ] }),
6376
- /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(VideoList, { data, current, done, onSelect })
6680
+ /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(VideoList, { data, current, done, onSelect })
6377
6681
  ] });
6378
6682
  }
6379
6683
 
6380
6684
  // src/questions/video-task/video-stage.tsx
6381
- var import_jsx_runtime76 = require("react/jsx-runtime");
6685
+ var import_jsx_runtime78 = require("react/jsx-runtime");
6382
6686
  function VideoStage({
6383
6687
  video,
6384
6688
  position,
@@ -6388,15 +6692,15 @@ function VideoStage({
6388
6692
  onToggle,
6389
6693
  onStageFullscreen
6390
6694
  }) {
6391
- const cover = video.poster ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("img", { className: "rqk-video-poster", src: video.poster, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Art, { name: "screen", className: "rqk-video-cover-art" });
6392
- return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: classNames("rqk-video-stage", fullscreen && "rqk-is-fullscreen"), children: [
6393
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "rqk-video-cover", children: cover }),
6394
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "rqk-video-dim" }),
6395
- playing ? null : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("button", { type: "button", className: "rqk-video-bigplay", onClick: onToggle, "aria-label": "\u64AD\u653E", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(PlayIcon, {}) }),
6396
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "rqk-video-duration", children: formatTime(video.duration) }),
6397
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("button", { type: "button", className: "rqk-video-fs", onClick: onStageFullscreen, "aria-label": "\u5168\u5C4F", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FullscreenIcon, {}) }),
6398
- /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "rqk-video-nowbar", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("i", { style: { width: `${position / video.duration * 100}%` } }) }),
6399
- video.src ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
6695
+ const cover = video.poster ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("img", { className: "rqk-video-poster", src: video.poster, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Art, { name: "screen", className: "rqk-video-cover-art" });
6696
+ return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: classNames("rqk-video-stage", fullscreen && "rqk-is-fullscreen"), children: [
6697
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "rqk-video-cover", children: cover }),
6698
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "rqk-video-dim" }),
6699
+ playing ? null : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("button", { type: "button", className: "rqk-video-bigplay", onClick: onToggle, "aria-label": "\u64AD\u653E", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(PlayIcon, {}) }),
6700
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "rqk-video-duration", children: formatTime(video.duration) }),
6701
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("button", { type: "button", className: "rqk-video-fs", onClick: onStageFullscreen, "aria-label": "\u5168\u5C4F", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(FullscreenIcon, {}) }),
6702
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "rqk-video-nowbar", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("i", { style: { width: `${position / video.duration * 100}%` } }) }),
6703
+ video.src ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
6400
6704
  "video",
6401
6705
  {
6402
6706
  ref: (element) => {
@@ -6418,7 +6722,7 @@ var import_react29 = require("react");
6418
6722
  var import_react28 = require("react");
6419
6723
 
6420
6724
  // src/questions/video-task/constants.ts
6421
- var TICK_MS2 = 100;
6725
+ var TICK_MS3 = 100;
6422
6726
 
6423
6727
  // src/questions/video-task/use-video-clock.ts
6424
6728
  function useVideoClock({
@@ -6445,7 +6749,7 @@ function useVideoClock({
6445
6749
  if (video.src || !playing) return void 0;
6446
6750
  const timer = window.setInterval(() => {
6447
6751
  if (!playingRef.current) return;
6448
- const delta = TICK_MS2 / 1e3;
6752
+ const delta = TICK_MS3 / 1e3;
6449
6753
  const next = positionRef.current + delta;
6450
6754
  applyPosition(next);
6451
6755
  applyCredit(creditRef.current + delta);
@@ -6454,7 +6758,7 @@ function useVideoClock({
6454
6758
  playingRef.current = false;
6455
6759
  setPlaying(false);
6456
6760
  }
6457
- }, TICK_MS2);
6761
+ }, TICK_MS3);
6458
6762
  return () => window.clearInterval(timer);
6459
6763
  }, [playing, video.duration, video.src]);
6460
6764
  (0, import_react28.useEffect)(() => {
@@ -6570,10 +6874,6 @@ function useVideoTask({ data, onSubmit }) {
6570
6874
  answer: { credits }
6571
6875
  });
6572
6876
  };
6573
- const replay = () => {
6574
- setView("task");
6575
- applyPosition(0);
6576
- };
6577
6877
  const toggleStageFullscreen = () => {
6578
6878
  var _a2, _b, _c, _d;
6579
6879
  setFullscreen((value) => !value);
@@ -6595,7 +6895,6 @@ function useVideoTask({ data, onSubmit }) {
6595
6895
  percentFor,
6596
6896
  playing,
6597
6897
  position,
6598
- replay,
6599
6898
  selectVideo,
6600
6899
  setFullscreen,
6601
6900
  timeOnTask,
@@ -6608,7 +6907,7 @@ function useVideoTask({ data, onSubmit }) {
6608
6907
  }
6609
6908
 
6610
6909
  // src/questions/video-task/index.tsx
6611
- var import_jsx_runtime77 = require("react/jsx-runtime");
6910
+ var import_jsx_runtime79 = require("react/jsx-runtime");
6612
6911
  function VideoTask({
6613
6912
  data,
6614
6913
  mode = "answer",
@@ -6622,32 +6921,33 @@ function VideoTask({
6622
6921
  onSubmit,
6623
6922
  className
6624
6923
  }) {
6924
+ const labels = useQuestLabels();
6625
6925
  const model = useVideoTask({ data, onSubmit });
6626
6926
  const actions = videoTaskActions({
6627
6927
  feedback: model.view === "feedback",
6628
6928
  allDone: model.allDone,
6629
- onReplay: model.replay,
6929
+ labels,
6630
6930
  onSubmit: model.handleSubmit,
6631
6931
  onNext
6632
6932
  });
6633
- return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
6933
+ return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
6634
6934
  QuestShell,
6635
6935
  {
6636
6936
  mode,
6637
6937
  title: title != null ? title : model.view === "feedback" ? "\u89C6\u9891\u7EDF\u8BA1" : "\u89C6\u9891\u4EFB\u52A1",
6638
6938
  index,
6639
6939
  total,
6640
- instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
6940
+ instruction: instruction != null ? instruction : /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
6641
6941
  "\u89C2\u770B\u89C6\u9891\uFF0C\u6709\u6548\u89C2\u770B ",
6642
- /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("b", { children: "\u226590%" }),
6942
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("b", { children: "\u226590%" }),
6643
6943
  " \u89C6\u4E3A\u5B8C\u6210"
6644
6944
  ] }),
6645
6945
  onBack,
6646
6946
  className: classNames("rqk-quest", "rqk-video", className),
6647
6947
  dataQuest: "video-task",
6648
- footer: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ActionBar, { actions, index, onPrev }),
6649
- children: model.view === "feedback" ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(VideoFeedback, { data, overall: model.overall, timeOnTask: model.timeOnTask }) : /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
6650
- /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
6948
+ footer: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ActionBar, { actions, index, total, onPrev }),
6949
+ children: model.view === "feedback" ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(VideoFeedback, { data, overall: model.overall, timeOnTask: model.timeOnTask }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
6950
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
6651
6951
  VideoStage,
6652
6952
  {
6653
6953
  video: model.video,
@@ -6659,7 +6959,7 @@ function VideoTask({
6659
6959
  onStageFullscreen: model.toggleStageFullscreen
6660
6960
  }
6661
6961
  ),
6662
- /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
6962
+ /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
6663
6963
  VideoControls,
6664
6964
  {
6665
6965
  data,
@@ -6683,7 +6983,7 @@ function VideoTask({
6683
6983
  }
6684
6984
 
6685
6985
  // src/primitives/blank-input.tsx
6686
- var import_jsx_runtime78 = require("react/jsx-runtime");
6986
+ var import_jsx_runtime80 = require("react/jsx-runtime");
6687
6987
  function BlankInput2({
6688
6988
  value,
6689
6989
  onChange,
@@ -6698,7 +6998,7 @@ function BlankInput2({
6698
6998
  var _a;
6699
6999
  const measured = Math.max(value.length, (_a = placeholder == null ? void 0 : placeholder.length) != null ? _a : 0, minCh);
6700
7000
  const width = `${Math.min(18, Math.max(minCh, measured))}ch`;
6701
- return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
7001
+ return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
6702
7002
  "input",
6703
7003
  {
6704
7004
  className: classNames(
@@ -6721,10 +7021,11 @@ function BlankInput2({
6721
7021
  }
6722
7022
 
6723
7023
  // src/index.tsx
6724
- var version = "1.0.3";
7024
+ var version = "1.0.4";
6725
7025
  var questkit = {
6726
7026
  version,
6727
7027
  QuestShell,
7028
+ QuestComplete,
6728
7029
  OptionItem,
6729
7030
  FeedbackSheet,
6730
7031
  Instruction,
@@ -6766,6 +7067,7 @@ var index_default = questkit;
6766
7067
  OptionItem,
6767
7068
  PictureBox,
6768
7069
  Progress,
7070
+ QuestComplete,
6769
7071
  QuestConfigProvider,
6770
7072
  QuestProvider,
6771
7073
  QuestShell,