wrong-notebook 2026.11.4 → 2026.11.5-2

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.
Files changed (391) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +1 -0
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/routes-manifest.json +6 -0
  5. package/.next/server/app/_global-error.html +1 -1
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/admin/page.js.nft.json +1 -1
  13. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
  15. package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
  17. package/.next/server/app/api/admin/dashboard/route.js +6 -6
  18. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  19. package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
  20. package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
  21. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  22. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  23. package/.next/server/app/api/admin/users/[id]/detail/route.js +6 -6
  24. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  25. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  26. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  27. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  28. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  29. package/.next/server/app/api/analytics/route.js +2 -2
  30. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  31. package/.next/server/app/api/analyze/route.js +11 -11
  32. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  33. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  34. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  35. package/.next/server/app/api/error-items/[id]/figure/route.js +5 -5
  36. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  37. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +2 -2
  38. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  39. package/.next/server/app/api/error-items/[id]/geogebra/route.js +7 -7
  40. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  41. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  42. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  43. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  44. package/.next/server/app/api/error-items/[id]/reanswer/route.js +7 -7
  45. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  46. package/.next/server/app/api/error-items/[id]/retag/route.js +1 -1
  47. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  48. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  49. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +12 -12
  50. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
  51. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +12 -12
  52. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  53. package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -1
  54. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  55. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  56. package/.next/server/app/api/error-items/export-questions/route.js.nft.json +1 -1
  57. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  58. package/.next/server/app/api/error-items/route.js +8 -8
  59. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  60. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  61. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  62. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +9 -9
  63. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  64. package/.next/server/app/api/exams/[id]/results/route.js +2 -2
  65. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  66. package/.next/server/app/api/exams/[id]/retry/route.js +7 -7
  67. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  68. package/.next/server/app/api/exams/[id]/route.js +5 -5
  69. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  70. package/.next/server/app/api/exams/route.js +6 -6
  71. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  72. package/.next/server/app/api/export/route.js.nft.json +1 -1
  73. package/.next/server/app/api/geogebra-analyze/route.js +2 -2
  74. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  75. package/.next/server/app/api/health/route.js.nft.json +1 -1
  76. package/.next/server/app/api/import/route.js +9 -9
  77. package/.next/server/app/api/import/route.js.nft.json +1 -1
  78. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +17 -17
  79. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
  80. package/.next/server/app/api/import-batches/[id]/fix-text/route.js +4 -4
  81. package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
  82. package/.next/server/app/api/import-batches/[id]/read/route.js +16 -16
  83. package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
  84. package/.next/server/app/api/import-batches/[id]/retry/route.js +17 -17
  85. package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
  86. package/.next/server/app/api/import-batches/[id]/route.js +16 -16
  87. package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
  88. package/.next/server/app/api/import-batches/[id]/start/route.js +16 -16
  89. package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
  90. package/.next/server/app/api/import-batches/route.js +16 -16
  91. package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
  92. package/.next/server/app/api/import-tasks/[id]/confirm/route.js +19 -19
  93. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
  94. package/.next/server/app/api/import-tasks/[id]/read/route.js +19 -19
  95. package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
  96. package/.next/server/app/api/import-tasks/[id]/retry/route.js +19 -19
  97. package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
  98. package/.next/server/app/api/import-tasks/[id]/route.js +19 -19
  99. package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
  100. package/.next/server/app/api/import-tasks/route.js +16 -16
  101. package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
  102. package/.next/server/app/api/initialize/route.js.nft.json +1 -1
  103. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  104. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  105. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  106. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  107. package/.next/server/app/api/notebooks/[id]/retag/route.js +1 -1
  108. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  109. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  110. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  111. package/.next/server/app/api/openclaw/batch-upload/route.js +5 -5
  112. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  113. package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
  114. package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
  115. package/.next/server/app/api/practice/generate/route.js +6 -6
  116. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  117. package/.next/server/app/api/practice/grade/route.js +5 -5
  118. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  119. package/.next/server/app/api/practice/record/[id]/route.js +5 -5
  120. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  121. package/.next/server/app/api/practice/record/route.js +4 -4
  122. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  123. package/.next/server/app/api/reanswer/route.js +3 -3
  124. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  125. package/.next/server/app/api/register/route.js.nft.json +1 -1
  126. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  127. package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
  128. package/.next/server/app/api/review/due/route.js +3 -3
  129. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  130. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  131. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  132. package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
  133. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  134. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  135. package/.next/server/app/api/stats/repeated-mistakes/route.js +2 -2
  136. package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
  137. package/.next/server/app/api/stats/weak-tags/route.js +2 -2
  138. package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
  139. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  140. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  141. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  142. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  143. package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
  144. package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
  145. package/.next/server/app/api/tts/route.js.nft.json +1 -1
  146. package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
  147. package/.next/server/app/api/user/ai-consent/route/app-paths-manifest.json +3 -0
  148. package/.next/server/app/api/user/ai-consent/route/build-manifest.json +12 -0
  149. package/.next/server/app/api/user/ai-consent/route/server-reference-manifest.json +4 -0
  150. package/.next/server/app/api/user/ai-consent/route.js +12 -0
  151. package/.next/server/app/api/user/ai-consent/route.js.map +5 -0
  152. package/.next/server/app/api/user/ai-consent/route.js.nft.json +1 -0
  153. package/.next/server/app/api/user/ai-consent/route_client-reference-manifest.js +3 -0
  154. package/.next/server/app/api/user/route.js +4 -4
  155. package/.next/server/app/api/user/route.js.nft.json +1 -1
  156. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  157. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  158. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  159. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  160. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  161. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  162. package/.next/server/app/exams/page.js.nft.json +1 -1
  163. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  164. package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
  165. package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
  166. package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
  167. package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
  168. package/.next/server/app/import-tasks/page.js.nft.json +1 -1
  169. package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
  170. package/.next/server/app/initialize/page.js.nft.json +1 -1
  171. package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
  172. package/.next/server/app/login/page.js.nft.json +1 -1
  173. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  174. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  175. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  176. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  177. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  178. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  179. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  180. package/.next/server/app/page.js.nft.json +1 -1
  181. package/.next/server/app/page_client-reference-manifest.js +1 -1
  182. package/.next/server/app/practice/page.js.nft.json +1 -1
  183. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  184. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  185. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  186. package/.next/server/app/register/page.js.nft.json +1 -1
  187. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  188. package/.next/server/app/review/page.js.nft.json +1 -1
  189. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  190. package/.next/server/app/setup/page.js.nft.json +1 -1
  191. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  192. package/.next/server/app/stats/page.js.nft.json +1 -1
  193. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  194. package/.next/server/app/tags/page.js.nft.json +1 -1
  195. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  196. package/.next/server/app-paths-manifest.json +1 -0
  197. package/.next/server/chunks/[root-of-the-server]__0-d_vh1kcmw7g._.js +1 -1
  198. package/.next/server/chunks/{[root-of-the-server]__025dluj5es8w4._.js → [root-of-the-server]__0-zi_nkxp9dof._.js} +1 -1
  199. package/.next/server/chunks/{[root-of-the-server]__0l8sbsrfjhttk._.js → [root-of-the-server]__02kuxxv4mod1v._.js} +2 -2
  200. package/.next/server/chunks/{[root-of-the-server]__01jxyfokd6l4_._.js → [root-of-the-server]__032tjseth76z3._.js} +1 -1
  201. package/.next/server/chunks/{[root-of-the-server]__00w9qhjl8kvr4._.js → [root-of-the-server]__05wem-_dvlzug._.js} +1 -1
  202. package/.next/server/chunks/{[root-of-the-server]__00w_kxg7h-9_p._.js → [root-of-the-server]__06-v15r8ror-q._.js} +1 -1
  203. package/.next/server/chunks/[root-of-the-server]__06irm2njvcb2a._.js +3 -0
  204. package/.next/server/chunks/{[root-of-the-server]__13a3izu1xb4m4._.js → [root-of-the-server]__07twbtie04xx6._.js} +2 -2
  205. package/.next/server/chunks/{[root-of-the-server]__0-ii_w4q2w_78._.js → [root-of-the-server]__08wrx5aay9znc._.js} +2 -2
  206. package/.next/server/chunks/{[root-of-the-server]__1e7_e83zxstdw._.js → [root-of-the-server]__0_e69dt7jrpui._.js} +2 -2
  207. package/.next/server/chunks/[root-of-the-server]__0_icvdlc-nqy_._.js +3 -0
  208. package/.next/server/chunks/[root-of-the-server]__0aynxvfd9wp_r._.js +3 -0
  209. package/.next/server/chunks/[root-of-the-server]__0dv_e-7ip1wts._.js +3 -0
  210. package/.next/server/chunks/{[root-of-the-server]__02fu_lp66613e._.js → [root-of-the-server]__0eyqs-2hri164._.js} +2 -2
  211. package/.next/server/chunks/{[root-of-the-server]__14gc66h_h3i2i._.js → [root-of-the-server]__0f8kzoc_gaf8y._.js} +2 -2
  212. package/.next/server/chunks/{[root-of-the-server]__163ocf8u6v-xl._.js → [root-of-the-server]__0fembrq8pciz5._.js} +2 -2
  213. package/.next/server/chunks/{[root-of-the-server]__04yihz3dovm0z._.js → [root-of-the-server]__0g0van70ibkrj._.js} +2 -2
  214. package/.next/server/chunks/[root-of-the-server]__0g2s86ce159k0._.js +3 -0
  215. package/.next/server/chunks/{[root-of-the-server]__05a4j8yu5_bg1._.js → [root-of-the-server]__0gankrx12ee4n._.js} +2 -2
  216. package/.next/server/chunks/[root-of-the-server]__0hxujtysw2kwx._.js +3 -0
  217. package/.next/server/chunks/[root-of-the-server]__0ilrqq68_5wg5._.js +3 -0
  218. package/.next/server/chunks/[root-of-the-server]__0ky9-3kyba1lu._.js +3 -0
  219. package/.next/server/chunks/[root-of-the-server]__0lgbdth9-z6qg._.js +1 -1
  220. package/.next/server/chunks/[root-of-the-server]__0lwuci8tnhggb._.js +3 -0
  221. package/.next/server/chunks/[root-of-the-server]__0m4dmn-gj2fnm._.js +3 -0
  222. package/.next/server/chunks/[root-of-the-server]__0ntfbtwf-s7a6._.js +3 -0
  223. package/.next/server/chunks/[root-of-the-server]__0of02idkcau3l._.js +3 -0
  224. package/.next/server/chunks/{[root-of-the-server]__0svpy5s3x369z._.js → [root-of-the-server]__0ohg2cyilt44e._.js} +2 -2
  225. package/.next/server/chunks/[root-of-the-server]__0rsgnrk2qy8wo._.js +3 -0
  226. package/.next/server/chunks/[root-of-the-server]__0si2-m5an9zl7._.js +1 -1
  227. package/.next/server/chunks/[root-of-the-server]__0svdqovwfpro2._.js +1 -1
  228. package/.next/server/chunks/[root-of-the-server]__0v0tr1bn12xyu._.js +3 -0
  229. package/.next/server/chunks/[root-of-the-server]__0vazs1dmyut7b._.js +3 -0
  230. package/.next/server/chunks/{[root-of-the-server]__11wpfrrg965mf._.js → [root-of-the-server]__0w9x80vsjqsbt._.js} +2 -2
  231. package/.next/server/chunks/[root-of-the-server]__0x76w78-o6bfn._.js +3 -0
  232. package/.next/server/chunks/[root-of-the-server]__0xwm-4fhj8j--._.js +3 -0
  233. package/.next/server/chunks/{[root-of-the-server]__0rwoy4jm7s8o7._.js → [root-of-the-server]__13u9cd4f8_gva._.js} +2 -2
  234. package/.next/server/chunks/[root-of-the-server]__16j73gw0vaw81._.js +3 -0
  235. package/.next/server/chunks/[root-of-the-server]__17_lgezg_8k4-._.js +3 -0
  236. package/.next/server/chunks/[root-of-the-server]__17qr9lkc0h9ta._.js +3 -0
  237. package/.next/server/chunks/{[root-of-the-server]__1bw1tevy-ufwx._.js → [root-of-the-server]__18axi_zdc2uzr._.js} +2 -2
  238. package/.next/server/chunks/[root-of-the-server]__19larrqj6rokv._.js +3 -0
  239. package/.next/server/chunks/[root-of-the-server]__1cno0cu053una._.js +3 -0
  240. package/.next/server/chunks/[root-of-the-server]__1cowc49z-6tny._.js +3 -0
  241. package/.next/server/chunks/{[root-of-the-server]__001wdwos9fkgg._.js → [root-of-the-server]__1edbiu94nqqym._.js} +2 -2
  242. package/.next/server/chunks/[root-of-the-server]__1f-ve8idsq57l._.js +1 -1
  243. package/.next/server/chunks/[root-of-the-server]__1f_ztllkdhd1g._.js +3 -0
  244. package/.next/server/chunks/[root-of-the-server]__1g_f4opcfnwwl._.js +3 -0
  245. package/.next/server/chunks/[root-of-the-server]__1iysogl93kyqq._.js +3 -0
  246. package/.next/server/chunks/[root-of-the-server]__1ka1feeszq3gt._.js +3 -0
  247. package/.next/server/chunks/[root-of-the-server]__1ke-yb4v9knf4._.js +3 -0
  248. package/.next/server/chunks/[root-of-the-server]__1kp5acqtrdysf._.js +3 -0
  249. package/.next/server/chunks/[root-of-the-server]__1kxewr0hve3xs._.js +3 -0
  250. package/.next/server/chunks/[root-of-the-server]__1l47_6jece7bq._.js +3 -0
  251. package/.next/server/chunks/{[root-of-the-server]__1gc1jsjtvhvls._.js → [root-of-the-server]__1nb3q3vglx569._.js} +2 -2
  252. package/.next/server/chunks/[root-of-the-server]__1o42aqttqc3b8._.js +3 -0
  253. package/.next/server/chunks/[root-of-the-server]__1pw5kygb6kibs._.js +3 -0
  254. package/.next/server/chunks/[root-of-the-server]__1qy_fxhx5yu1t._.js +3 -0
  255. package/.next/server/chunks/[root-of-the-server]__1sokwptzp3b3m._.js +3 -0
  256. package/.next/server/chunks/{[root-of-the-server]__0cizcawcu31he._.js → [root-of-the-server]__1ve60byz8pq4j._.js} +2 -2
  257. package/.next/server/chunks/{[root-of-the-server]__0fhi9g3nqu6k3._.js → [root-of-the-server]__1vwlmzqz2r0yr._.js} +1 -1
  258. package/.next/server/chunks/{[root-of-the-server]__1pfhgjwnx_--j._.js → [root-of-the-server]__1w_yq12h-kxx0._.js} +2 -2
  259. package/.next/server/chunks/[root-of-the-server]__1x6r0_9_fqoy-._.js +3 -0
  260. package/.next/server/chunks/[root-of-the-server]__1xx-czpwd_ny7._.js +3 -0
  261. package/.next/server/chunks/[root-of-the-server]__1zkrlusy_cbtj._.js +3 -0
  262. package/.next/server/chunks/_011-ll5i30j2e._.js +1 -1
  263. package/.next/server/chunks/_03ovgh1-4xf3f._.js +1 -1
  264. package/.next/server/chunks/_05-ouasholjra._.js +1 -1
  265. package/.next/server/chunks/_06pseal2zu-71._.js +1 -1
  266. package/.next/server/chunks/_08i9pskmlafnp._.js +1 -1
  267. package/.next/server/chunks/_0ahfgpo6w1vyz._.js +3 -0
  268. package/.next/server/chunks/_0d66myj_8567o._.js +1 -1
  269. package/.next/server/chunks/_0h1rbua_hqkox._.js +1 -1
  270. package/.next/server/chunks/_0i58-g30ox5-8._.js +1 -1
  271. package/.next/server/chunks/_0mt2ctbvzfero._.js +1 -1
  272. package/.next/server/chunks/_0r8u30vd4lix4._.js +1 -1
  273. package/.next/server/chunks/_0tl0cy5j96d7h._.js +1 -1
  274. package/.next/server/chunks/_0zs7jfzzshbfq._.js +1 -1
  275. package/.next/server/chunks/_12i51zlq-xxrl._.js +1 -1
  276. package/.next/server/chunks/_18hm5aaxkr500._.js +1 -1
  277. package/.next/server/chunks/_1a1aqmie1d3u_._.js +1 -1
  278. package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
  279. package/.next/server/chunks/_1ad8i3ukisj99._.js +1 -1
  280. package/.next/server/chunks/_1b0269xt-c8f7._.js +1 -1
  281. package/.next/server/chunks/_1cydcmia78z15._.js +1 -1
  282. package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
  283. package/.next/server/chunks/_1sp0xk1c5jx5r._.js +1 -1
  284. package/.next/server/chunks/_1zbkha-v5mkk0._.js +1 -1
  285. package/.next/server/chunks/_next-internal_server_app_api_user_ai-consent_route_actions_0g-jtv0cc92di.js +3 -0
  286. package/.next/server/chunks/src_lib_0dxltm34zaclb._.js +1 -1
  287. package/.next/server/chunks/src_lib_0g4wu08m-gibu._.js +1 -1
  288. package/.next/server/chunks/src_lib_0l0j89xrerf8m._.js +1 -1
  289. package/.next/server/chunks/src_lib_0n6nhl7_avcme._.js +1 -1
  290. package/.next/server/chunks/src_lib_0so-2topfosjo._.js +1 -1
  291. package/.next/server/chunks/src_lib_1_p9kz6i8to9n._.js +3 -0
  292. package/.next/server/chunks/src_lib_1t_-lm7x_gu08._.js +3 -0
  293. package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +2 -2
  294. package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +1 -1
  295. package/.next/server/chunks/src_lib_mastery_ts_0ybi94uxn8ut6._.js +1 -1
  296. package/.next/server/chunks/src_lib_question_0uw17e6at-i_h._.js +1 -1
  297. package/.next/server/chunks/src_lib_question_question-analysis_ts_1-3x2cfxlr3fs._.js +1 -1
  298. package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +1 -1
  299. package/.next/server/chunks/ssr/{[root-of-the-server]__1epxx0lrejssz._.js → [root-of-the-server]__1qkpcqb6ewk9r._.js} +1 -1
  300. package/.next/server/chunks/ssr/_09y2uhjubswp4._.js +1 -1
  301. package/.next/server/chunks/ssr/_0_m51opjnip8x._.js +32 -0
  302. package/.next/server/chunks/ssr/_0cmd1ubdlo_by._.js +1 -1
  303. package/.next/server/chunks/ssr/{_05gdkgyyr0suj._.js → _0fp_p60hb9ex8._.js} +1 -1
  304. package/.next/server/chunks/ssr/_0lzeodofsq9pe._.js +1 -1
  305. package/.next/server/chunks/ssr/_0ozptnii2nxuw._.js +1 -1
  306. package/.next/server/chunks/ssr/{_01zv6gqnnj9oy._.js → _0qs44fqs7b5wd._.js} +1 -1
  307. package/.next/server/chunks/ssr/{node_modules_1yz9gg4275g30._.js → node_modules_0v4btraw_y7x2._.js} +1 -1
  308. package/.next/server/chunks/ssr/{node_modules_1-wb4967v48id._.js → node_modules_1cm5684hz1o51._.js} +1 -1
  309. package/.next/server/chunks/ssr/{node_modules_1we6ggthjslzt._.js → node_modules_1im5by828hg3r._.js} +1 -1
  310. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_038nbq-p7grtd.js → node_modules_heic-to_dist_csp_heic-to_064ewwu8t3acv.js} +1 -1
  311. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_1b61b0i6philz.js → node_modules_heic-to_dist_csp_heic-to_1xp1ys7qrz7uh.js} +1 -1
  312. package/.next/server/chunks/ssr/src_1rmus42s388dk._.js +1 -1
  313. package/.next/server/chunks/ssr/src_1seqsa8jiwu83._.js +1 -1
  314. package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +2 -2
  315. package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
  316. package/.next/server/chunks/ssr/src_components_correction-editor_tsx_1p7z02t66tndx._.js +2 -2
  317. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +12 -12
  318. package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
  319. package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +1 -1
  320. package/.next/server/middleware-build-manifest.js +3 -3
  321. package/.next/server/pages/500.html +1 -1
  322. package/.next/static/chunks/{16h0nz5l970cx.js → 08pb1_yl7fhsw.js} +1 -1
  323. package/.next/static/chunks/{1-00icoq9w3_i.js → 0c3tf7izst9o8.js} +1 -1
  324. package/.next/static/chunks/{3ldaxwwj8i1r_.js → 0ddn90rrjkr7y.js} +3 -3
  325. package/.next/static/chunks/185736qwog1ar.js +1 -0
  326. package/.next/static/chunks/{0y9dgn85yuuy5.js → 1bcso9y60vl1j.js} +1 -1
  327. package/.next/static/chunks/1jsd1qdcjh3ht.js +198 -0
  328. package/.next/static/chunks/1nef598mkxf9g.js +1 -0
  329. package/.next/static/chunks/{2r3xwds8ivfso.js → 1ogj95u4nfqgm.js} +5 -5
  330. package/.next/static/chunks/2-m8at3d9m9fl.js +38 -0
  331. package/.next/static/chunks/21jkvmvb2mzaa.js +1 -0
  332. package/.next/static/chunks/32c19i38gl4zx.js +1 -0
  333. package/.next/static/chunks/34r6_zyo8ux86.js +1 -0
  334. package/.next/static/chunks/3_5fscrh8uxav.css +3 -0
  335. package/.next/static/chunks/{2gamhj4j8w-tp.js → 3lvul9moygg-1.js} +4 -4
  336. package/package.json +1 -1
  337. package/prisma/migrations/20261105000000_user_ai_data_consent/migration.sql +2 -0
  338. package/prisma/schema.prisma +1 -0
  339. package/prisma/seed.db +0 -0
  340. package/.next/server/chunks/[root-of-the-server]__07i32k2sv285o._.js +0 -3
  341. package/.next/server/chunks/[root-of-the-server]__0_le78e9b2yno._.js +0 -3
  342. package/.next/server/chunks/[root-of-the-server]__0b8rxaox_x2n1._.js +0 -3
  343. package/.next/server/chunks/[root-of-the-server]__0bvf731upd2_w._.js +0 -3
  344. package/.next/server/chunks/[root-of-the-server]__0eqjbieakyy2g._.js +0 -3
  345. package/.next/server/chunks/[root-of-the-server]__0gk6xz_lxrrer._.js +0 -3
  346. package/.next/server/chunks/[root-of-the-server]__0nin5p-dwlpf9._.js +0 -3
  347. package/.next/server/chunks/[root-of-the-server]__0nye-53zadylr._.js +0 -3
  348. package/.next/server/chunks/[root-of-the-server]__0o9oim91bxvxq._.js +0 -3
  349. package/.next/server/chunks/[root-of-the-server]__0pojh2d6n1kp6._.js +0 -3
  350. package/.next/server/chunks/[root-of-the-server]__0wea836zkhvlj._.js +0 -3
  351. package/.next/server/chunks/[root-of-the-server]__0wex3czgya39o._.js +0 -3
  352. package/.next/server/chunks/[root-of-the-server]__0yq7jm5ja3r6t._.js +0 -3
  353. package/.next/server/chunks/[root-of-the-server]__1-1ld657rjip5._.js +0 -3
  354. package/.next/server/chunks/[root-of-the-server]__11-fk0-4iuf_k._.js +0 -3
  355. package/.next/server/chunks/[root-of-the-server]__11x5u4zg5i2c6._.js +0 -3
  356. package/.next/server/chunks/[root-of-the-server]__12f6t_ozjtn42._.js +0 -3
  357. package/.next/server/chunks/[root-of-the-server]__13cos0n0yw_z6._.js +0 -3
  358. package/.next/server/chunks/[root-of-the-server]__15r55xy6cyrg3._.js +0 -3
  359. package/.next/server/chunks/[root-of-the-server]__16_meybuj-s5w._.js +0 -3
  360. package/.next/server/chunks/[root-of-the-server]__17659spbpgn__._.js +0 -3
  361. package/.next/server/chunks/[root-of-the-server]__1f0zocrmsd5p8._.js +0 -3
  362. package/.next/server/chunks/[root-of-the-server]__1fp6mylnljj_6._.js +0 -3
  363. package/.next/server/chunks/[root-of-the-server]__1gf_vv57qtjh0._.js +0 -3
  364. package/.next/server/chunks/[root-of-the-server]__1hn69stngi4kc._.js +0 -3
  365. package/.next/server/chunks/[root-of-the-server]__1ii155nyrptua._.js +0 -3
  366. package/.next/server/chunks/[root-of-the-server]__1kxecl8v-_px5._.js +0 -3
  367. package/.next/server/chunks/[root-of-the-server]__1l6v9x8xm11pl._.js +0 -3
  368. package/.next/server/chunks/[root-of-the-server]__1r5lj-ffov9r0._.js +0 -3
  369. package/.next/server/chunks/[root-of-the-server]__1uqnotrppylmw._.js +0 -3
  370. package/.next/server/chunks/[root-of-the-server]__1utvl-1o6mb8y._.js +0 -3
  371. package/.next/server/chunks/[root-of-the-server]__1vc89u7_xxhyf._.js +0 -3
  372. package/.next/server/chunks/[root-of-the-server]__1vorkvvfkrr39._.js +0 -3
  373. package/.next/server/chunks/[root-of-the-server]__1x_kq-6h3utmo._.js +0 -3
  374. package/.next/server/chunks/[root-of-the-server]__1x_yvd3pxoee7._.js +0 -3
  375. package/.next/server/chunks/[root-of-the-server]__1y9cx1kv17pl_._.js +0 -3
  376. package/.next/server/chunks/[root-of-the-server]__1z4-5hlzq34fw._.js +0 -3
  377. package/.next/server/chunks/[root-of-the-server]__20vfjg0kexwpn._.js +0 -3
  378. package/.next/server/chunks/src_lib_1-8qgpevmw3ew._.js +0 -3
  379. package/.next/server/chunks/src_lib_1w0niu4i8hnaq._.js +0 -3
  380. package/.next/server/chunks/ssr/_0haie2cnycj6w._.js +0 -32
  381. package/.next/static/chunks/15zro21ycjjle.js +0 -1
  382. package/.next/static/chunks/1vtq_er8xir3c.css +0 -3
  383. package/.next/static/chunks/28qmcol3c39_a.js +0 -198
  384. package/.next/static/chunks/3fj_icg91t5ar.js +0 -38
  385. package/.next/static/chunks/3fyp0ya1q-g_k.js +0 -1
  386. package/.next/static/chunks/3g93k83oklg4_.js +0 -1
  387. package/.next/static/chunks/3u-qpv02dkpmu.js +0 -1
  388. package/.next/static/chunks/3x0gnqbvstc69.js +0 -1
  389. /package/.next/static/{afzFj9VsDFOvE5lff98xs → oMYEAS-Ug2KhwHuve1br9}/_buildManifest.js +0 -0
  390. /package/.next/static/{afzFj9VsDFOvE5lff98xs → oMYEAS-Ug2KhwHuve1br9}/_clientMiddlewareManifest.js +0 -0
  391. /package/.next/static/{afzFj9VsDFOvE5lff98xs → oMYEAS-Ug2KhwHuve1br9}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
1
  (()=>{"use strict";module.exports=[833354,(a,b,c)=>{c._=function(a){return a&&a.__esModule?a:{default:a}}},283248,a=>{var b=a.i(164831);let c={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],283248)},141146,a=>{var b=a.i(164831);let c={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],141146)},536670,a=>{var b=a.i(164831);let c={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],536670)},168370,a=>{var b=a.i(164831);let c={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],168370)},777064,a=>{var b=a.i(164831);let c={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],777064)},483138,a=>{var b=a.i(164831);let c={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],483138)},357204,a=>{var b=a.i(164831);let c={name:"languages",size:24,node:[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],357204)},403512,a=>{var b=a.i(164831);let c={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],403512)},780767,a=>{var b=a.i(164831);let c={name:"scan-text",size:24,node:[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],780767)},344451,a=>{var b=a.i(164831);let c={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],344451)},930363,a=>{var b=a.i(785389);a.s(["f",()=>b.f])},870430,a=>{var b=a.i(187924),c=a.i(572131),d=a.i(30553),e=Object.defineProperty,f=c.forwardRef(e(function(a,c){return(0,b.jsx)(d.V.label,{...a,ref:c,onMouseDown:b=>{b.target.closest("button, input, select, textarea")||(a.onMouseDown?.(b),!b.defaultPrevented&&b.detail>1&&b.preventDefault())}})},"name",{value:"Label",configurable:!0})),g=a.i(368114);a.s(["f",0,function({className:a,...c}){return(0,b.jsx)(f,{"data-slot":"label",className:(0,g.f)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",a),...c})}],870430)},424235,a=>{a.s(["f",0,"https://github.com/margrop/wrong-notebook"])}]})();
2
2
 
3
- //# sourceMappingURL=_01zv6gqnnj9oy._.js.map
3
+ //# sourceMappingURL=_0qs44fqs7b5wd._.js.map
@@ -1,3 +1,3 @@
1
1
  module.exports=[627280,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_heic-to_dist_csp_heic-to_1a1i_ppryp81y.js"].map(b=>a.l(b))).then(()=>b(469425)))},585650,a=>{"use strict";var b=a.i(164831);let c={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};c.node;let d=(0,b.f)(c);a.s(["f",0,d],585650)},445233,a=>{"use strict";var b=a.i(57441);a.s(["z",0,b])}];
2
2
 
3
- //# sourceMappingURL=node_modules_1yz9gg4275g30._.js.map
3
+ //# sourceMappingURL=node_modules_0v4btraw_y7x2._.js.map
@@ -1,3 +1,3 @@
1
1
  module.exports=[627280,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_heic-to_dist_csp_heic-to_1a1i_ppryp81y.js"].map(b=>a.l(b))).then(()=>b(469425)))},61751,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_pdfjs-dist_build_pdf_mjs_0z37jkkqfce7_._.js"].map(b=>a.l(b))).then(()=>b(268062)))},279013,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_read-excel-file_universal_index_0ayslfrutmja5.js"].map(b=>a.l(b))).then(()=>b(459805)))},177190,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_write-excel-file_browser_index_0l2-di6rcng1b.js"].map(b=>a.l(b))).then(()=>b(884549)))}];
2
2
 
3
- //# sourceMappingURL=node_modules_1-wb4967v48id._.js.map
3
+ //# sourceMappingURL=node_modules_1cm5684hz1o51._.js.map
@@ -1,3 +1,3 @@
1
1
  module.exports=[746480,a=>{a.v(a=>Promise.resolve().then(()=>a(794618)))},177190,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__032-uso7x2eqk._.js","server/chunks/ssr/node_modules_write-excel-file_browser_index_0l2-di6rcng1b.js"].map(b=>a.l(b))).then(()=>b(884549)))}];
2
2
 
3
- //# sourceMappingURL=node_modules_1we6ggthjslzt._.js.map
3
+ //# sourceMappingURL=node_modules_1im5by828hg3r._.js.map
@@ -1,3 +1,3 @@
1
1
  module.exports=[627280,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_heic-to_dist_csp_heic-to_1a1i_ppryp81y.js"].map(b=>a.l(b))).then(()=>b(469425)))}];
2
2
 
3
- //# sourceMappingURL=node_modules_heic-to_dist_csp_heic-to_038nbq-p7grtd.js.map
3
+ //# sourceMappingURL=node_modules_heic-to_dist_csp_heic-to_064ewwu8t3acv.js.map
@@ -1,3 +1,3 @@
1
1
  module.exports=[627280,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_heic-to_dist_csp_heic-to_1a1i_ppryp81y.js"].map(b=>a.l(b))).then(()=>b(469425)))}];
2
2
 
3
- //# sourceMappingURL=node_modules_heic-to_dist_csp_heic-to_1b61b0i6philz.js.map
3
+ //# sourceMappingURL=node_modules_heic-to_dist_csp_heic-to_1xp1ys7qrz7uh.js.map
@@ -1,3 +1,3 @@
1
- (()=>{"use strict";module.exports=[897555,a=>{var b=a.i(187924),c=a.i(699570),d=a.i(550194),e=a.i(922115);a.s(["f",0,function({effectivePx:a,isCustom:f,onChange:g,onReset:h}){let{t:i}=(0,d.b)(),j=(0,e.O)(a);return(0,b.jsxs)("div",{className:"answer-space-controls print:hidden flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-2 pt-1",children:[(0,b.jsxs)("span",{children:[i.exam.questionAnswerSpace,": ",j,"px"]}),(0,b.jsx)(c.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":i.exam.decreaseAnswerSpace,disabled:j<=e.r,onClick:()=>g((0,e.O)(j-e.W)),children:"-"}),(0,b.jsx)("input",{type:"range",min:e.r,max:e.R,step:10,value:j,"aria-label":i.exam.questionAnswerSpaceSlider,onChange:a=>g((0,e.O)(Number(a.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,b.jsx)(c.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":i.exam.increaseAnswerSpace,disabled:j>=e.R,onClick:()=>g((0,e.O)(j+e.W)),children:"+"}),f&&(0,b.jsx)(c.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:h,children:i.exam.resetQuestionAnswerSpace})]})}])},922115,a=>{let b=["auto","none","small","medium","large"],c={none:0,small:60,medium:120,large:240},d={choice:12,judgment:12,fill:16,solution:240};function e(a){return Number.isFinite(a)?Math.min(600,Math.max(0,Math.round(a))):0}let f=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,g=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,h=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,i=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,j=/(\s*(\d{1,2})\s*)/g,k=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function l(a){let b=new Set;for(let c of a.matchAll(j))b.add(c[1]);for(let c of a.matchAll(k))b.add(c[1]);return Math.max(1,b.size)}a.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,e,"I",0,function(a){return"string"==typeof a&&b.includes(a)},"T",0,function(a){return"number"!=typeof a||!Number.isInteger(a)||a<0||a>600?null:a},"z",0,function(a,b,j){let k;if("number"==typeof j&&Number.isFinite(j))return e(j);if("auto"!==a)return c[a];let m=(k=new Set(Array.from(b.matchAll(f),a=>a[1]??a[2]??a[3]))).has("A")&&k.has("B")&&k.has("C")?"choice":g.test(b)?"judgment":l(b)>1||i.test(b)?"solution":h.test(b)?"fill":"solution";if("solution"!==m)return d[m];let n=(l(b)-1)*120;return Math.min(560,d.solution+n)}])},321466,a=>{var b=a.i(572131),c=a.i(922115),d=a.i(630534);a.s(["f",0,function(a,e){let[f,g]=(0,b.useState)({}),[h,i]=(0,b.useState)(!1),j=(0,b.useRef)(new Map),k=(0,b.useRef)(null),l=(0,b.useRef)(e);(0,b.useEffect)(()=>{l.current=e},[e]);let m=(0,b.useMemo)(()=>{let b={};for(let d of a){let a=d.id in f?f[d.id]:(0,c.T)(d.answerSpacePx);"number"==typeof a&&(b[d.id]=a)}return b},[a,f]),n=(0,b.useCallback)(()=>{if(k.current&&(clearTimeout(k.current),k.current=null),0===j.current.size)return;let a=Array.from(j.current,([a,b])=>({id:a,answerSpacePx:b}));j.current.clear(),l.current(a).then(()=>i(!1)).catch(a=>{i(!0),d.V.error("[AnswerSpace]","Failed to save answer space",{error:a})})},[]);(0,b.useEffect)(()=>n,[n]);let o=(0,b.useCallback)((a,b)=>{if(0!==a.length){for(let{id:b,answerSpacePx:c}of(g(b=>{let c={...b};for(let{id:b,answerSpacePx:d}of a)c[b]=d;return c}),a))j.current.set(b,c);if(b)return void n();k.current&&clearTimeout(k.current),k.current=setTimeout(n,600)}},[n]),p=(0,b.useCallback)((a,b)=>{o([{id:a,answerSpacePx:b}],null===b)},[o]),q=(0,b.useCallback)(()=>{o(Object.keys(m).map(a=>({id:a,answerSpacePx:null})),!0)},[m,o]);return{customSpaces:m,setSpace:p,resetAll:q,saveFailed:h}}])}]})();
1
+ (()=>{"use strict";module.exports=[897555,572594,a=>{var b=a.i(187924),c=a.i(699570),d=a.i(550194),e=a.i(922115);a.s(["f",0,function({effectivePx:a,isCustom:f,onChange:g,onReset:h}){let{t:i}=(0,d.b)(),j=(0,e.O)(a);return(0,b.jsxs)("div",{className:"answer-space-controls print:hidden flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-2 pt-1",children:[(0,b.jsxs)("span",{children:[i.exam.questionAnswerSpace,": ",j,"px"]}),(0,b.jsx)(c.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":i.exam.decreaseAnswerSpace,disabled:j<=e.r,onClick:()=>g((0,e.O)(j-e.W)),children:"-"}),(0,b.jsx)("input",{type:"range",min:e.r,max:e.R,step:10,value:j,"aria-label":i.exam.questionAnswerSpaceSlider,onChange:a=>g((0,e.O)(Number(a.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,b.jsx)(c.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":i.exam.increaseAnswerSpace,disabled:j>=e.R,onClick:()=>g((0,e.O)(j+e.W)),children:"+"}),f&&(0,b.jsx)(c.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:h,children:i.exam.resetQuestionAnswerSpace})]})}],897555);var f=a.i(572131),g=a.i(93907),h=a.i(78362);let i=["A","B","C","D"];function j(a){return RegExp(`^(?:${a}\\s*[..::、]|[((]${a}[))])`)}function k(a){let b=a.replace(/\$+/g,"").replace(/\\[a-zA-Z]+/g,"").replace(/[{}^_\\]/g,""),c=0;for(let a of b)c+=a.codePointAt(0)>=11904?2:1;return c}let l={4:"grid-cols-2 sm:grid-cols-4 print:grid-cols-4",2:"grid-cols-1 sm:grid-cols-2 print:grid-cols-2",1:"grid-cols-1"};a.s(["f",0,function({content:a}){let c=(0,f.useMemo)(()=>(function(a){if(!a)return null;let{masked:b,segments:c}=(0,h.F)(a.replace(/\\n/g,"\n")),d=(0,h.n)(b,"\n").split("\n"),e=d.findIndex(a=>j("A").test(a.trim()));if(e<0)return null;let f=[],g=0,l=e;for(let a=e;a<d.length&&g<i.length;a+=1){let b=d[a].trim();if(!b)continue;if(!j(i[g]).test(b))break;let c=function(a,b){let c=[],d=a,e=b;for(;e<i.length;){var f;let a=d.match(j(i[e]))[0];d=d.slice(a.length);let b=e+1<i.length?d.match((f=i[e+1],RegExp(`\\s(?:${f}\\s*[..::、]|[((]${f}[))])`))):null,g=b?.index??d.length;if(c.push({label:a.trim(),content:d.slice(0,g).trim()}),e+=1,!b)break;d=d.slice(g).trimStart()}return{options:c,next:e}}(b,g);f.push(...c.options),g=c.next,l=a+1}if(f.length<3||l-e<2)return null;let m=d.slice(l).join("\n").trim();if(g<i.length&&m)return null;let n=a=>(0,h.i)(a,c),o=f.map(a=>({label:a.label,content:n(a.content)}));return{stem:n(d.slice(0,e).join("\n").trim()),options:o,after:n(m),columns:function(a){if(a.some(({content:a})=>/!\[|\|/.test(a)))return 1;let b=Math.max(...a.map(({label:a,content:b})=>k(a)+1+k(b)));return b<=14?4:b<=34?2:1}(o)}})(a),[a]);return c?(0,b.jsxs)(b.Fragment,{children:[c.stem&&(0,b.jsx)(g.f,{content:c.stem}),(0,b.jsx)("div",{className:`choice-options mb-3 grid gap-x-6 gap-y-1 ${l[c.columns]}`,children:c.options.map(a=>(0,b.jsxs)("div",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,b.jsx)("span",{className:"shrink-0",children:a.label}),(0,b.jsx)(g.f,{content:a.content,className:"flex-1 [&_p]:mb-0"})]},a.label))}),c.after&&(0,b.jsx)(g.f,{content:c.after})]}):(0,b.jsx)(g.f,{content:a})}],572594)},922115,a=>{let b=["auto","none","small","medium","large"],c={none:0,small:60,medium:120,large:240},d={choice:12,judgment:12,fill:16,solution:240};function e(a){return Number.isFinite(a)?Math.min(600,Math.max(0,Math.round(a))):0}let f=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,g=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,h=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,i=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,j=/(\s*(\d{1,2})\s*)/g,k=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function l(a){let b=new Set;for(let c of a.matchAll(j))b.add(c[1]);for(let c of a.matchAll(k))b.add(c[1]);return Math.max(1,b.size)}a.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,e,"I",0,function(a){return"string"==typeof a&&b.includes(a)},"T",0,function(a){return"number"!=typeof a||!Number.isInteger(a)||a<0||a>600?null:a},"z",0,function(a,b,j){let k;if("number"==typeof j&&Number.isFinite(j))return e(j);if("auto"!==a)return c[a];let m=(k=new Set(Array.from(b.matchAll(f),a=>a[1]??a[2]??a[3]))).has("A")&&k.has("B")&&k.has("C")?"choice":g.test(b)?"judgment":l(b)>1||i.test(b)?"solution":h.test(b)?"fill":"solution";if("solution"!==m)return d[m];let n=(l(b)-1)*120;return Math.min(560,d.solution+n)}])},321466,a=>{var b=a.i(572131),c=a.i(922115),d=a.i(630534);a.s(["f",0,function(a,e){let[f,g]=(0,b.useState)({}),[h,i]=(0,b.useState)(!1),j=(0,b.useRef)(new Map),k=(0,b.useRef)(null),l=(0,b.useRef)(e);(0,b.useEffect)(()=>{l.current=e},[e]);let m=(0,b.useMemo)(()=>{let b={};for(let d of a){let a=d.id in f?f[d.id]:(0,c.T)(d.answerSpacePx);"number"==typeof a&&(b[d.id]=a)}return b},[a,f]),n=(0,b.useCallback)(()=>{if(k.current&&(clearTimeout(k.current),k.current=null),0===j.current.size)return;let a=Array.from(j.current,([a,b])=>({id:a,answerSpacePx:b}));j.current.clear(),l.current(a).then(()=>i(!1)).catch(a=>{i(!0),d.V.error("[AnswerSpace]","Failed to save answer space",{error:a})})},[]);(0,b.useEffect)(()=>n,[n]);let o=(0,b.useCallback)((a,b)=>{if(0!==a.length){for(let{id:b,answerSpacePx:c}of(g(b=>{let c={...b};for(let{id:b,answerSpacePx:d}of a)c[b]=d;return c}),a))j.current.set(b,c);if(b)return void n();k.current&&clearTimeout(k.current),k.current=setTimeout(n,600)}},[n]),p=(0,b.useCallback)((a,b)=>{o([{id:a,answerSpacePx:b}],null===b)},[o]),q=(0,b.useCallback)(()=>{o(Object.keys(m).map(a=>({id:a,answerSpacePx:null})),!0)},[m,o]);return{customSpaces:m,setSpace:p,resetAll:q,saveFailed:h}}])}]})();
2
2
 
3
3
  //# sourceMappingURL=src_1rmus42s388dk._.js.map
@@ -1,3 +1,3 @@
1
- (()=>{"use strict";module.exports=[897555,a=>{var b=a.i(187924),c=a.i(699570),d=a.i(550194),e=a.i(922115);a.s(["f",0,function({effectivePx:a,isCustom:f,onChange:g,onReset:h}){let{t:i}=(0,d.b)(),j=(0,e.O)(a);return(0,b.jsxs)("div",{className:"answer-space-controls print:hidden flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-2 pt-1",children:[(0,b.jsxs)("span",{children:[i.exam.questionAnswerSpace,": ",j,"px"]}),(0,b.jsx)(c.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":i.exam.decreaseAnswerSpace,disabled:j<=e.r,onClick:()=>g((0,e.O)(j-e.W)),children:"-"}),(0,b.jsx)("input",{type:"range",min:e.r,max:e.R,step:10,value:j,"aria-label":i.exam.questionAnswerSpaceSlider,onChange:a=>g((0,e.O)(Number(a.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,b.jsx)(c.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":i.exam.increaseAnswerSpace,disabled:j>=e.R,onClick:()=>g((0,e.O)(j+e.W)),children:"+"}),f&&(0,b.jsx)(c.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:h,children:i.exam.resetQuestionAnswerSpace})]})}])},922115,a=>{let b=["auto","none","small","medium","large"],c={none:0,small:60,medium:120,large:240},d={choice:12,judgment:12,fill:16,solution:240};function e(a){return Number.isFinite(a)?Math.min(600,Math.max(0,Math.round(a))):0}let f=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,g=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,h=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,i=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,j=/(\s*(\d{1,2})\s*)/g,k=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function l(a){let b=new Set;for(let c of a.matchAll(j))b.add(c[1]);for(let c of a.matchAll(k))b.add(c[1]);return Math.max(1,b.size)}a.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,e,"I",0,function(a){return"string"==typeof a&&b.includes(a)},"T",0,function(a){return"number"!=typeof a||!Number.isInteger(a)||a<0||a>600?null:a},"z",0,function(a,b,j){let k;if("number"==typeof j&&Number.isFinite(j))return e(j);if("auto"!==a)return c[a];let m=(k=new Set(Array.from(b.matchAll(f),a=>a[1]??a[2]??a[3]))).has("A")&&k.has("B")&&k.has("C")?"choice":g.test(b)?"judgment":l(b)>1||i.test(b)?"solution":h.test(b)?"fill":"solution";if("solution"!==m)return d[m];let n=(l(b)-1)*120;return Math.min(560,d.solution+n)}])},321466,a=>{var b=a.i(572131),c=a.i(922115),d=a.i(630534);a.s(["f",0,function(a,e){let[f,g]=(0,b.useState)({}),[h,i]=(0,b.useState)(!1),j=(0,b.useRef)(new Map),k=(0,b.useRef)(null),l=(0,b.useRef)(e);(0,b.useEffect)(()=>{l.current=e},[e]);let m=(0,b.useMemo)(()=>{let b={};for(let d of a){let a=d.id in f?f[d.id]:(0,c.T)(d.answerSpacePx);"number"==typeof a&&(b[d.id]=a)}return b},[a,f]),n=(0,b.useCallback)(()=>{if(k.current&&(clearTimeout(k.current),k.current=null),0===j.current.size)return;let a=Array.from(j.current,([a,b])=>({id:a,answerSpacePx:b}));j.current.clear(),l.current(a).then(()=>i(!1)).catch(a=>{i(!0),d.V.error("[AnswerSpace]","Failed to save answer space",{error:a})})},[]);(0,b.useEffect)(()=>n,[n]);let o=(0,b.useCallback)((a,b)=>{if(0!==a.length){for(let{id:b,answerSpacePx:c}of(g(b=>{let c={...b};for(let{id:b,answerSpacePx:d}of a)c[b]=d;return c}),a))j.current.set(b,c);if(b)return void n();k.current&&clearTimeout(k.current),k.current=setTimeout(n,600)}},[n]),p=(0,b.useCallback)((a,b)=>{o([{id:a,answerSpacePx:b}],null===b)},[o]),q=(0,b.useCallback)(()=>{o(Object.keys(m).map(a=>({id:a,answerSpacePx:null})),!0)},[m,o]);return{customSpaces:m,setSpace:p,resetAll:q,saveFailed:h}}])}]})();
1
+ (()=>{"use strict";module.exports=[897555,572594,a=>{var b=a.i(187924),c=a.i(699570),d=a.i(550194),e=a.i(922115);a.s(["f",0,function({effectivePx:a,isCustom:f,onChange:g,onReset:h}){let{t:i}=(0,d.b)(),j=(0,e.O)(a);return(0,b.jsxs)("div",{className:"answer-space-controls print:hidden flex flex-wrap items-center gap-2 text-xs text-muted-foreground mt-2 pt-1",children:[(0,b.jsxs)("span",{children:[i.exam.questionAnswerSpace,": ",j,"px"]}),(0,b.jsx)(c.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":i.exam.decreaseAnswerSpace,disabled:j<=e.r,onClick:()=>g((0,e.O)(j-e.W)),children:"-"}),(0,b.jsx)("input",{type:"range",min:e.r,max:e.R,step:10,value:j,"aria-label":i.exam.questionAnswerSpaceSlider,onChange:a=>g((0,e.O)(Number(a.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,b.jsx)(c.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":i.exam.increaseAnswerSpace,disabled:j>=e.R,onClick:()=>g((0,e.O)(j+e.W)),children:"+"}),f&&(0,b.jsx)(c.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:h,children:i.exam.resetQuestionAnswerSpace})]})}],897555);var f=a.i(572131),g=a.i(93907),h=a.i(78362);let i=["A","B","C","D"];function j(a){return RegExp(`^(?:${a}\\s*[..::、]|[((]${a}[))])`)}function k(a){let b=a.replace(/\$+/g,"").replace(/\\[a-zA-Z]+/g,"").replace(/[{}^_\\]/g,""),c=0;for(let a of b)c+=a.codePointAt(0)>=11904?2:1;return c}let l={4:"grid-cols-2 sm:grid-cols-4 print:grid-cols-4",2:"grid-cols-1 sm:grid-cols-2 print:grid-cols-2",1:"grid-cols-1"};a.s(["f",0,function({content:a}){let c=(0,f.useMemo)(()=>(function(a){if(!a)return null;let{masked:b,segments:c}=(0,h.F)(a.replace(/\\n/g,"\n")),d=(0,h.n)(b,"\n").split("\n"),e=d.findIndex(a=>j("A").test(a.trim()));if(e<0)return null;let f=[],g=0,l=e;for(let a=e;a<d.length&&g<i.length;a+=1){let b=d[a].trim();if(!b)continue;if(!j(i[g]).test(b))break;let c=function(a,b){let c=[],d=a,e=b;for(;e<i.length;){var f;let a=d.match(j(i[e]))[0];d=d.slice(a.length);let b=e+1<i.length?d.match((f=i[e+1],RegExp(`\\s(?:${f}\\s*[..::、]|[((]${f}[))])`))):null,g=b?.index??d.length;if(c.push({label:a.trim(),content:d.slice(0,g).trim()}),e+=1,!b)break;d=d.slice(g).trimStart()}return{options:c,next:e}}(b,g);f.push(...c.options),g=c.next,l=a+1}if(f.length<3||l-e<2)return null;let m=d.slice(l).join("\n").trim();if(g<i.length&&m)return null;let n=a=>(0,h.i)(a,c),o=f.map(a=>({label:a.label,content:n(a.content)}));return{stem:n(d.slice(0,e).join("\n").trim()),options:o,after:n(m),columns:function(a){if(a.some(({content:a})=>/!\[|\|/.test(a)))return 1;let b=Math.max(...a.map(({label:a,content:b})=>k(a)+1+k(b)));return b<=14?4:b<=34?2:1}(o)}})(a),[a]);return c?(0,b.jsxs)(b.Fragment,{children:[c.stem&&(0,b.jsx)(g.f,{content:c.stem}),(0,b.jsx)("div",{className:`choice-options mb-3 grid gap-x-6 gap-y-1 ${l[c.columns]}`,children:c.options.map(a=>(0,b.jsxs)("div",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,b.jsx)("span",{className:"shrink-0",children:a.label}),(0,b.jsx)(g.f,{content:a.content,className:"flex-1 [&_p]:mb-0"})]},a.label))}),c.after&&(0,b.jsx)(g.f,{content:c.after})]}):(0,b.jsx)(g.f,{content:a})}],572594)},922115,a=>{let b=["auto","none","small","medium","large"],c={none:0,small:60,medium:120,large:240},d={choice:12,judgment:12,fill:16,solution:240};function e(a){return Number.isFinite(a)?Math.min(600,Math.max(0,Math.round(a))):0}let f=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,g=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,h=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,i=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,j=/(\s*(\d{1,2})\s*)/g,k=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function l(a){let b=new Set;for(let c of a.matchAll(j))b.add(c[1]);for(let c of a.matchAll(k))b.add(c[1]);return Math.max(1,b.size)}a.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,e,"I",0,function(a){return"string"==typeof a&&b.includes(a)},"T",0,function(a){return"number"!=typeof a||!Number.isInteger(a)||a<0||a>600?null:a},"z",0,function(a,b,j){let k;if("number"==typeof j&&Number.isFinite(j))return e(j);if("auto"!==a)return c[a];let m=(k=new Set(Array.from(b.matchAll(f),a=>a[1]??a[2]??a[3]))).has("A")&&k.has("B")&&k.has("C")?"choice":g.test(b)?"judgment":l(b)>1||i.test(b)?"solution":h.test(b)?"fill":"solution";if("solution"!==m)return d[m];let n=(l(b)-1)*120;return Math.min(560,d.solution+n)}])},321466,a=>{var b=a.i(572131),c=a.i(922115),d=a.i(630534);a.s(["f",0,function(a,e){let[f,g]=(0,b.useState)({}),[h,i]=(0,b.useState)(!1),j=(0,b.useRef)(new Map),k=(0,b.useRef)(null),l=(0,b.useRef)(e);(0,b.useEffect)(()=>{l.current=e},[e]);let m=(0,b.useMemo)(()=>{let b={};for(let d of a){let a=d.id in f?f[d.id]:(0,c.T)(d.answerSpacePx);"number"==typeof a&&(b[d.id]=a)}return b},[a,f]),n=(0,b.useCallback)(()=>{if(k.current&&(clearTimeout(k.current),k.current=null),0===j.current.size)return;let a=Array.from(j.current,([a,b])=>({id:a,answerSpacePx:b}));j.current.clear(),l.current(a).then(()=>i(!1)).catch(a=>{i(!0),d.V.error("[AnswerSpace]","Failed to save answer space",{error:a})})},[]);(0,b.useEffect)(()=>n,[n]);let o=(0,b.useCallback)((a,b)=>{if(0!==a.length){for(let{id:b,answerSpacePx:c}of(g(b=>{let c={...b};for(let{id:b,answerSpacePx:d}of a)c[b]=d;return c}),a))j.current.set(b,c);if(b)return void n();k.current&&clearTimeout(k.current),k.current=setTimeout(n,600)}},[n]),p=(0,b.useCallback)((a,b)=>{o([{id:a,answerSpacePx:b}],null===b)},[o]),q=(0,b.useCallback)(()=>{o(Object.keys(m).map(a=>({id:a,answerSpacePx:null})),!0)},[m,o]);return{customSpaces:m,setSpace:p,resetAll:q,saveFailed:h}}])}]})();
2
2
 
3
3
  //# sourceMappingURL=src_1seqsa8jiwu83._.js.map
@@ -22,7 +22,7 @@ module.exports=[667441,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50
22
22
  .exam-sheet .markdown-content table { border-collapse: collapse; }
23
23
  .exam-sheet .markdown-content td, .exam-sheet .markdown-content th { border: 1px solid #999; padding: 2px 6px; }
24
24
  @media print { .exam-sheet { padding: 0; max-width: none; } .exam-sheet .figure-scale-editor-controls, .exam-sheet .answer-space-controls { display: none; } @page { size: A4; margin: 15mm; } }
25
- `;function p(a){return a.replace(/[&<>"']/g,a=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[a])}var q=a.i(922115),r=a.i(321466),s=a.i(185844),t=a.i(93907),u=a.i(897555),v=a.i(30671),w=a.i(404473);function x({question:a,displayNumber:c,scoreUnit:d,answerSpace:e,customSpaces:f,uniformPreview:g,onSaveFigureScale:h,onChangeCustomSpace:i}){let j,{t:k}=(0,l.b)();return(0,b.jsxs)("section",{className:"exam-question",children:[(0,b.jsxs)("div",{className:"exam-question-head",children:[(0,b.jsxs)("span",{children:[c,".","number"==typeof a.score&&`(${(0,v.s)(a.score)} ${d})`]}),(0,b.jsxs)("span",{className:"exam-source",children:[k.exam.sourceLabel,": ",a.sourceShortId]})]}),(0,b.jsx)(t.f,{content:a.questionText}),(0,b.jsx)(s.f,{svg:a.figureSvg,scale:a.figureScale,align:a.figureAlign,previewScaleOverride:g.scale,previewAlignOverride:g.align,onSave:(b,c)=>h(a.id,b,c)},`${a.id}-${a.figureScale??100}-${a.figureAlign??"center"}`),(j=(0,q.z)(e,a.questionText,f[a.id]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"exam-answer-space",style:{minHeight:`${j}px`}}),(0,b.jsx)(u.f,{effectivePx:j,isCustom:"number"==typeof f[a.id],onChange:b=>i(a.id,b),onReset:()=>i(a.id,null)})]}))]})}function y({section:a}){let{t:c}=(0,l.b)(),d=null!==a.scoreTotal?c.exam.sectionSummaryScored.replace("{count}",String(a.count)).replace("{total}",String(a.scoreTotal)):c.exam.sectionSummary.replace("{count}",String(a.count));return(0,b.jsxs)("div",{className:"exam-section-head",children:[(0,b.jsx)("h2",{children:a.title}),(0,b.jsxs)("span",{className:"exam-section-summary",children:[d,null!==a.scoreTotal&&a.unscored>0&&(0,b.jsxs)("span",{children:["(",c.exam.sectionSummaryUnscored.replace("{count}",String(a.unscored)),")"]})]})]})}let z=(0,c.forwardRef)(function({paper:a,includeAnswers:c,answerSpace:d,customSpaces:e,uniformPreview:f,onSaveFigureScale:g,onChangeCustomSpace:h},i){let{t:j,language:k}=(0,l.b)(),m=a.questions.filter(a=>"ready"===a.status&&a.questionText),n=(0,v.n)(m.map(a=>a.score??null)).total,o="en"===k?"pts":"分",p=a.groupByType?(0,w.f)(m,k):null,q=(a,c)=>(0,b.jsx)(x,{question:a,displayNumber:c,scoreUnit:o,answerSpace:d,customSpaces:e,uniformPreview:f,onSaveFigureScale:g,onChangeCustomSpace:h},a.id),r=a=>a.map(a=>(0,b.jsxs)("div",{className:"exam-question",children:[(0,b.jsxs)("div",{className:"exam-question-head",children:[(0,b.jsxs)("span",{children:[a.displayNumber,"."]}),(0,b.jsxs)("span",{className:"exam-source",children:[j.exam.sourceLabel,": ",a.question.sourceShortId]})]}),a.question.answerText&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("span",{className:"exam-label",children:[j.exam.answerLabel,j.common.colon]}),(0,b.jsx)(t.f,{content:a.question.answerText})]}),a.question.analysis&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("span",{className:"exam-label",children:[j.exam.analysisLabel,j.common.colon]}),(0,b.jsx)(t.f,{content:a.question.analysis})]})]},a.question.id));return(0,b.jsxs)("div",{ref:i,className:"exam-sheet",children:[(0,b.jsx)("h1",{children:a.title}),null!==n&&(0,b.jsx)("p",{className:"exam-full-score",children:j.exam.fullScore.replace("{total}",(0,v.s)(n))}),(0,b.jsxs)("div",{className:"exam-meta",children:[(0,b.jsxs)("span",{children:[j.exam.nameLine,j.common.colon,"________"]}),(0,b.jsxs)("span",{children:[j.exam.dateLine,j.common.colon,"________"]}),(0,b.jsxs)("span",{children:[j.exam.scoreLine,j.common.colon,"________"]})]}),p?p.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)(y,{section:a}),a.items.map(a=>q(a.question,a.displayNumber))]},a.title)):m.map((a,b)=>q(a,b+1)),c&&(0,b.jsxs)("section",{className:"exam-answer-key",children:[(0,b.jsx)("h2",{children:j.exam.answerKey}),p?p.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)(y,{section:a}),r(a.items)]},a.title)):r(m.map((a,b)=>({question:a,displayNumber:b+1})))]})]})}),A=[];a.s(["default",0,function(){let a=(0,d.useParams)(),{t:s,language:t}=(0,l.b)(),[u,v]=(0,c.useState)(null);(0,m.f)(s.exam.title,u?.title,s.pageTitle.examPrint);let[w,x]=(0,c.useState)(!0),[y,B]=(0,c.useState)(q.q),[C,D]=(0,c.useState)({scale:null,align:null}),E=(0,c.useRef)(null),F=u?.id,G=(0,c.useCallback)(async a=>{if(F){if(a.length>1&&a.every(a=>null===a.answerSpacePx))return void await n.k.patch(`/api/exams/${F}`,{answerSpacePx:null});await Promise.all(a.map(({id:a,answerSpacePx:b})=>n.k.patch(`/api/exams/${F}`,{questionId:a,answerSpacePx:b})))}},[F]),{customSpaces:H,setSpace:I,resetAll:J,saveFailed:K}=(0,r.f)(u?.questions??A,G);if((0,c.useEffect)(()=>{let a=null;try{a=localStorage.getItem(q.p)}catch{}(0,q.I)(a)&&B(a)},[]),(0,c.useEffect)(()=>{n.k.get(`/api/exams/${a.id}`).then(v).catch(()=>v(null))},[a.id]),!u)return(0,b.jsx)("div",{className:"p-8 text-center",children:s.common.loading});let L=u.questions.filter(a=>"ready"===a.status&&a.questionText&&!!a.figureSvg),M=u.questions.filter(a=>"ready"===a.status&&a.questionText).length,N=async(a,b,c)=>{await n.k.patch(`/api/exams/${u.id}`,{questionId:a,figureScale:b,figureAlign:c}),v(d=>d?{...d,questions:d.questions.map(d=>d.id===a?{...d,figureScale:b,figureAlign:c}:d)}:d)},O=async a=>{await n.k.patch(`/api/exams/${u.id}`,a),v(b=>b?{...b,questions:b.questions.map(b=>({...b,...a}))}:b)};return(0,b.jsxs)("main",{className:"min-h-screen bg-white",children:[(0,b.jsx)("style",{children:o}),(0,b.jsx)("div",{className:"print:hidden sticky top-0 z-10 border-b bg-background p-3 shadow-sm",children:(0,b.jsxs)("div",{className:"max-w-4xl mx-auto flex flex-wrap items-center gap-3",children:[(0,b.jsx)(j.f,{fallbackUrl:`/exams/${u.id}`}),(0,b.jsx)("span",{className:"font-semibold",children:s.exam.printTitle}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(h.f,{checked:w,onCheckedChange:a=>x(!0===a)}),s.exam.includeAnswers]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)("span",{className:"shrink-0",children:s.exam.answerSpace}),(0,b.jsxs)(i.d,{value:y,onValueChange:a=>{if((0,q.I)(a)){B(a);try{localStorage.setItem(q.p,a)}catch{}}},children:[(0,b.jsx)(i.P,{className:"h-8 w-40",children:(0,b.jsx)(i.U,{})}),(0,b.jsxs)(i.r,{children:[(0,b.jsx)(i.T,{value:"auto",children:s.exam.answerSpaceAuto}),(0,b.jsx)(i.T,{value:"none",children:s.exam.answerSpaceNone}),(0,b.jsx)(i.T,{value:"small",children:s.exam.answerSpaceSmall}),(0,b.jsx)(i.T,{value:"medium",children:s.exam.answerSpaceMedium}),(0,b.jsx)(i.T,{value:"large",children:s.exam.answerSpaceLarge})]})]}),Object.keys(H).length>0&&(0,b.jsx)(g.f,{type:"button",variant:"ghost",size:"sm",onClick:J,children:s.exam.resetAllQuestionAnswerSpaces})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,b.jsxs)(g.f,{variant:"outline",size:"sm",onClick:()=>{var a;if(!E.current)return;let b=E.current.cloneNode(!0);b.querySelectorAll(".figure-scale-editor-controls, .answer-space-controls, .print\\:hidden").forEach(a=>a.remove());let c=function(a,b,c="zh-CN"){return`<!doctype html>
25
+ `;function p(a){return a.replace(/[&<>"']/g,a=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[a])}var q=a.i(922115),r=a.i(321466),s=a.i(185844),t=a.i(93907),u=a.i(897555),v=a.i(572594),w=a.i(30671),x=a.i(404473);function y({question:a,displayNumber:c,scoreUnit:d,answerSpace:e,customSpaces:f,uniformPreview:g,onSaveFigureScale:h,onChangeCustomSpace:i}){let j,{t:k}=(0,l.b)();return(0,b.jsxs)("section",{className:"exam-question",children:[(0,b.jsxs)("div",{className:"exam-question-head",children:[(0,b.jsxs)("span",{children:[c,".","number"==typeof a.score&&`(${(0,w.s)(a.score)} ${d})`]}),(0,b.jsxs)("span",{className:"exam-source",children:[k.exam.sourceLabel,": ",a.sourceShortId]})]}),(0,b.jsx)(v.f,{content:a.questionText}),(0,b.jsx)(s.f,{svg:a.figureSvg,scale:a.figureScale,align:a.figureAlign,previewScaleOverride:g.scale,previewAlignOverride:g.align,onSave:(b,c)=>h(a.id,b,c)},`${a.id}-${a.figureScale??100}-${a.figureAlign??"center"}`),(j=(0,q.z)(e,a.questionText,f[a.id]),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"exam-answer-space",style:{minHeight:`${j}px`}}),(0,b.jsx)(u.f,{effectivePx:j,isCustom:"number"==typeof f[a.id],onChange:b=>i(a.id,b),onReset:()=>i(a.id,null)})]}))]})}function z({section:a}){let{t:c}=(0,l.b)(),d=null!==a.scoreTotal?c.exam.sectionSummaryScored.replace("{count}",String(a.count)).replace("{total}",String(a.scoreTotal)):c.exam.sectionSummary.replace("{count}",String(a.count));return(0,b.jsxs)("div",{className:"exam-section-head",children:[(0,b.jsx)("h2",{children:a.title}),(0,b.jsxs)("span",{className:"exam-section-summary",children:[d,null!==a.scoreTotal&&a.unscored>0&&(0,b.jsxs)("span",{children:["(",c.exam.sectionSummaryUnscored.replace("{count}",String(a.unscored)),")"]})]})]})}let A=(0,c.forwardRef)(function({paper:a,includeAnswers:c,answerSpace:d,customSpaces:e,uniformPreview:f,onSaveFigureScale:g,onChangeCustomSpace:h},i){let{t:j,language:k}=(0,l.b)(),m=a.questions.filter(a=>"ready"===a.status&&a.questionText),n=(0,w.n)(m.map(a=>a.score??null)).total,o="en"===k?"pts":"分",p=a.groupByType?(0,x.f)(m,k):null,q=(a,c)=>(0,b.jsx)(y,{question:a,displayNumber:c,scoreUnit:o,answerSpace:d,customSpaces:e,uniformPreview:f,onSaveFigureScale:g,onChangeCustomSpace:h},a.id),r=a=>a.map(a=>(0,b.jsxs)("div",{className:"exam-question",children:[(0,b.jsxs)("div",{className:"exam-question-head",children:[(0,b.jsxs)("span",{children:[a.displayNumber,"."]}),(0,b.jsxs)("span",{className:"exam-source",children:[j.exam.sourceLabel,": ",a.question.sourceShortId]})]}),a.question.answerText&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("span",{className:"exam-label",children:[j.exam.answerLabel,j.common.colon]}),(0,b.jsx)(t.f,{content:a.question.answerText})]}),a.question.analysis&&(0,b.jsxs)("div",{children:[(0,b.jsxs)("span",{className:"exam-label",children:[j.exam.analysisLabel,j.common.colon]}),(0,b.jsx)(t.f,{content:a.question.analysis})]})]},a.question.id));return(0,b.jsxs)("div",{ref:i,className:"exam-sheet",children:[(0,b.jsx)("h1",{children:a.title}),null!==n&&(0,b.jsx)("p",{className:"exam-full-score",children:j.exam.fullScore.replace("{total}",(0,w.s)(n))}),(0,b.jsxs)("div",{className:"exam-meta",children:[(0,b.jsxs)("span",{children:[j.exam.nameLine,j.common.colon,"________"]}),(0,b.jsxs)("span",{children:[j.exam.dateLine,j.common.colon,"________"]}),(0,b.jsxs)("span",{children:[j.exam.scoreLine,j.common.colon,"________"]})]}),p?p.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)(z,{section:a}),a.items.map(a=>q(a.question,a.displayNumber))]},a.title)):m.map((a,b)=>q(a,b+1)),c&&(0,b.jsxs)("section",{className:"exam-answer-key",children:[(0,b.jsx)("h2",{children:j.exam.answerKey}),p?p.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)(z,{section:a}),r(a.items)]},a.title)):r(m.map((a,b)=>({question:a,displayNumber:b+1})))]})]})}),B=[];a.s(["default",0,function(){let a=(0,d.useParams)(),{t:s,language:t}=(0,l.b)(),[u,v]=(0,c.useState)(null);(0,m.f)(s.exam.title,u?.title,s.pageTitle.examPrint);let[w,x]=(0,c.useState)(!0),[y,z]=(0,c.useState)(q.q),[C,D]=(0,c.useState)({scale:null,align:null}),E=(0,c.useRef)(null),F=u?.id,G=(0,c.useCallback)(async a=>{if(F){if(a.length>1&&a.every(a=>null===a.answerSpacePx))return void await n.k.patch(`/api/exams/${F}`,{answerSpacePx:null});await Promise.all(a.map(({id:a,answerSpacePx:b})=>n.k.patch(`/api/exams/${F}`,{questionId:a,answerSpacePx:b})))}},[F]),{customSpaces:H,setSpace:I,resetAll:J,saveFailed:K}=(0,r.f)(u?.questions??B,G);if((0,c.useEffect)(()=>{let a=null;try{a=localStorage.getItem(q.p)}catch{}(0,q.I)(a)&&z(a)},[]),(0,c.useEffect)(()=>{n.k.get(`/api/exams/${a.id}`).then(v).catch(()=>v(null))},[a.id]),!u)return(0,b.jsx)("div",{className:"p-8 text-center",children:s.common.loading});let L=u.questions.filter(a=>"ready"===a.status&&a.questionText&&!!a.figureSvg),M=u.questions.filter(a=>"ready"===a.status&&a.questionText).length,N=async(a,b,c)=>{await n.k.patch(`/api/exams/${u.id}`,{questionId:a,figureScale:b,figureAlign:c}),v(d=>d?{...d,questions:d.questions.map(d=>d.id===a?{...d,figureScale:b,figureAlign:c}:d)}:d)},O=async a=>{await n.k.patch(`/api/exams/${u.id}`,a),v(b=>b?{...b,questions:b.questions.map(b=>({...b,...a}))}:b)};return(0,b.jsxs)("main",{className:"min-h-screen bg-white",children:[(0,b.jsx)("style",{children:o}),(0,b.jsx)("div",{className:"print:hidden sticky top-0 z-10 border-b bg-background p-3 shadow-sm",children:(0,b.jsxs)("div",{className:"max-w-4xl mx-auto flex flex-wrap items-center gap-3",children:[(0,b.jsx)(j.f,{fallbackUrl:`/exams/${u.id}`}),(0,b.jsx)("span",{className:"font-semibold",children:s.exam.printTitle}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(h.f,{checked:w,onCheckedChange:a=>x(!0===a)}),s.exam.includeAnswers]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)("span",{className:"shrink-0",children:s.exam.answerSpace}),(0,b.jsxs)(i.d,{value:y,onValueChange:a=>{if((0,q.I)(a)){z(a);try{localStorage.setItem(q.p,a)}catch{}}},children:[(0,b.jsx)(i.P,{className:"h-8 w-40",children:(0,b.jsx)(i.U,{})}),(0,b.jsxs)(i.r,{children:[(0,b.jsx)(i.T,{value:"auto",children:s.exam.answerSpaceAuto}),(0,b.jsx)(i.T,{value:"none",children:s.exam.answerSpaceNone}),(0,b.jsx)(i.T,{value:"small",children:s.exam.answerSpaceSmall}),(0,b.jsx)(i.T,{value:"medium",children:s.exam.answerSpaceMedium}),(0,b.jsx)(i.T,{value:"large",children:s.exam.answerSpaceLarge})]})]}),Object.keys(H).length>0&&(0,b.jsx)(g.f,{type:"button",variant:"ghost",size:"sm",onClick:J,children:s.exam.resetAllQuestionAnswerSpaces})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,b.jsxs)(g.f,{variant:"outline",size:"sm",onClick:()=>{var a;if(!E.current)return;let b=E.current.cloneNode(!0);b.querySelectorAll(".figure-scale-editor-controls, .answer-space-controls, .print\\:hidden").forEach(a=>a.remove());let c=function(a,b,c="zh-CN"){return`<!doctype html>
26
26
  <html lang="${p(c)}">
27
27
  <head>
28
28
  <meta charset="utf-8">
@@ -35,6 +35,6 @@ module.exports=[667441,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50
35
35
  ${b}
36
36
  </body>
37
37
  </html>
38
- `}(u.title,b.outerHTML,"en"===t?"en":"zh-CN"),d=URL.createObjectURL(new Blob([c],{type:"text/html;charset=utf-8"})),e=document.createElement("a");e.href=d,a=u.title,e.download=`${a.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,e.click(),URL.revokeObjectURL(d)},children:[(0,b.jsx)(e.f,{className:"mr-2 h-4 w-4"}),s.exam.downloadHtml]}),(0,b.jsxs)(g.f,{size:"sm",onClick:()=>window.print(),children:[(0,b.jsx)(f.f,{className:"mr-2 h-4 w-4"}),s.exam.printNow]})]}),"auto"===y&&(0,b.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:s.exam.answerSpaceAutoHint}),K&&(0,b.jsx)("p",{className:"w-full text-xs text-destructive",children:s.exam.answerSpaceSaveFailed}),M<u.questions.length&&(0,b.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:s.exam.notReadyHint}),L.length>0&&(0,b.jsx)(k.f,{scales:L.map(a=>a.figureScale),aligns:L.map(a=>a.figureAlign),onPreviewChange:D,onSave:O})]})}),(0,b.jsx)(z,{ref:E,paper:u,includeAnswers:w,answerSpace:y,customSpaces:H,uniformPreview:C,onSaveFigureScale:N,onChangeCustomSpace:I})]})}],667441)}];
38
+ `}(u.title,b.outerHTML,"en"===t?"en":"zh-CN"),d=URL.createObjectURL(new Blob([c],{type:"text/html;charset=utf-8"})),e=document.createElement("a");e.href=d,a=u.title,e.download=`${a.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,e.click(),URL.revokeObjectURL(d)},children:[(0,b.jsx)(e.f,{className:"mr-2 h-4 w-4"}),s.exam.downloadHtml]}),(0,b.jsxs)(g.f,{size:"sm",onClick:()=>window.print(),children:[(0,b.jsx)(f.f,{className:"mr-2 h-4 w-4"}),s.exam.printNow]})]}),"auto"===y&&(0,b.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:s.exam.answerSpaceAutoHint}),K&&(0,b.jsx)("p",{className:"w-full text-xs text-destructive",children:s.exam.answerSpaceSaveFailed}),M<u.questions.length&&(0,b.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:s.exam.notReadyHint}),L.length>0&&(0,b.jsx)(k.f,{scales:L.map(a=>a.figureScale),aligns:L.map(a=>a.figureAlign),onPreviewChange:D,onSave:O})]})}),(0,b.jsx)(A,{ref:E,paper:u,includeAnswers:w,answerSpace:y,customSpaces:H,uniformPreview:C,onSaveFigureScale:N,onChangeCustomSpace:I})]})}],667441)}];
39
39
 
40
40
  //# sourceMappingURL=src_app_exams_%5Bid%5D_print_page_tsx_1i-xvhk8ul1l1._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[771706,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(699570),f=a.i(695001),g=a.i(589027),h=a.i(113608),i=a.i(233540),j=a.i(866718),k=a.i(550194);function l(a){if(a.tags&&a.tags.length>0)return a.tags.map(a=>a.name);try{let b=JSON.parse(a.knowledgePoints||"[]");return Array.isArray(b)?b.filter(a=>"string"==typeof a):[]}catch{return[]}}async function m(a){let b=[];for(let c=1;;c+=1){let d=await a(c);if(b.push(...d.items),0===d.items.length||c>=d.totalPages)return b}}function n({items:a,selectedIds:d,selectedCount:f,printNumbers:m,onToggle:o,onSelectionChange:p}){let{t:q}=(0,k.b)(),[r,s]=(0,c.useState)(a.length<=20),[t,u]=(0,c.useState)(""),v=(0,c.useMemo)(()=>a.filter(a=>{let b;return!(b=t.trim().toLowerCase())||[a.questionText??"",a.shortId??"",...l(a)].some(a=>a.toLowerCase().includes(b))}),[a,t]),w=t.trim().length>0,x=a=>p(function(a,b,c){let d=new Set(a);for(let e of b)"select"!==c&&("invert"!==c||a.has(e))?d.delete(e):d.add(e);return d}(d,v.map(a=>a.id),a));return(0,b.jsxs)("div",{className:"rounded-md border bg-muted/20 p-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-sm font-medium hover:text-primary","aria-expanded":r,onClick:()=>s(a=>!a),children:[r?(0,b.jsx)(h.f,{className:"h-4 w-4"}):(0,b.jsx)(g.f,{className:"h-4 w-4"}),q.printPreview.selectItems," (",f,"/",a.length,")"]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(e.f,{variant:"outline",size:"sm",onClick:()=>x("select"),children:w?q.printPreview.selectFiltered:q.printPreview.selectAll}),(0,b.jsx)(e.f,{variant:"outline",size:"sm",onClick:()=>x("clear"),children:w?q.printPreview.clearFiltered:q.printPreview.clearSelection}),(0,b.jsx)(e.f,{variant:"outline",size:"sm",onClick:()=>x("invert"),children:q.printPreview.invertSelection})]})]}),r&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(i.f,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(j.f,{type:"search",value:t,onChange:a=>u(a.target.value),placeholder:q.printPreview.searchPlaceholder,"aria-label":q.printPreview.searchPlaceholder,className:"h-8 pl-8 text-sm"})]}),(0,b.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3 max-h-[40vh] overflow-y-auto pr-1",children:[v.map(a=>{let c=m.get(a.id);return(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded border bg-background p-2 text-xs cursor-pointer hover:border-primary/50",children:[(0,b.jsx)("input",{type:"checkbox",checked:d.has(a.id),onChange:()=>o(a.id),className:"mt-0.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,b.jsxs)("span",{className:"line-clamp-2",children:[void 0!==c&&(0,b.jsxs)("span",{className:"font-semibold",children:[q.printPreview.questionNumber.replace("{num}",String(c)),q.common.colon]}),a.shortId&&(0,b.jsxs)("span",{className:"font-mono text-muted-foreground",children:[a.shortId," "]}),a.questionText]})]},a.id)}),0===v.length&&(0,b.jsx)("p",{className:"col-span-full py-2 text-center text-xs text-muted-foreground",children:q.printPreview.noSearchResult})]})]})]})}var o=a.i(922115);function p({checked:a,onChange:c,label:d}){return(0,b.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:a,onChange:a=>c(a.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),d]})}function q({options:a,onChange:c,hasCustomSpaces:d,onResetCustomSpaces:f}){let{t:g}=(0,k.b)(),h=a.answerSpace??"auto";return(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,b.jsxs)("span",{className:"whitespace-nowrap text-xs sm:text-sm",children:[g.printPreview?.imageScale||"Image Scale",": ",a.imageScale,"%"]}),(0,b.jsx)("input",{type:"range",min:"30",max:"100",value:a.imageScale,onChange:a=>c({imageScale:Number(a.target.value)}),className:"w-16 sm:w-20 accent-primary"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs sm:text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,b.jsxs)("label",{htmlFor:"print-preview-answer-space",className:"whitespace-nowrap",children:[g.exam.answerSpace,":"]}),(0,b.jsxs)("select",{id:"print-preview-answer-space",value:h,onChange:a=>{(0,o.I)(a.target.value)&&c({answerSpace:a.target.value})},className:"bg-background border rounded px-2 py-0.5 text-xs sm:text-sm",children:[(0,b.jsx)("option",{value:"auto",children:g.exam.answerSpaceAuto}),(0,b.jsx)("option",{value:"none",children:g.exam.answerSpaceNone}),(0,b.jsx)("option",{value:"small",children:g.exam.answerSpaceSmall}),(0,b.jsx)("option",{value:"medium",children:g.exam.answerSpaceMedium}),(0,b.jsx)("option",{value:"large",children:g.exam.answerSpaceLarge})]}),d&&f&&(0,b.jsx)(e.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:f,children:g.exam.resetAllQuestionAnswerSpaces})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 sm:gap-4",children:[(0,b.jsx)(p,{checked:a.showQuestionText,onChange:a=>c({showQuestionText:a}),label:g.printPreview?.showQuestionText||"Question Text"}),(0,b.jsx)(p,{checked:a.showAnswers,onChange:a=>c({showAnswers:a}),label:g.printPreview?.showAnswers||"Show Answers"}),(0,b.jsx)(p,{checked:a.showAnalysis,onChange:a=>c({showAnalysis:a}),label:g.printPreview?.showAnalysis||"Show Analysis"}),(0,b.jsx)(p,{checked:a.showTags,onChange:a=>c({showTags:a}),label:g.printPreview?.showTags||"Show Tags"})]})]})}var r=a.i(474215),s=a.i(93907),t=a.i(897555),u=a.i(418943);let v=(0,c.memo)(function({item:a,index:c,options:d,reserveAnswerSpace:e,customAnswerSpacePx:f,onCustomAnswerSpaceChange:g,paperGroupName:h,onRemove:i}){let{t:j}=(0,k.b)(),m=l(a),n=e?(0,o.z)(d.answerSpace??"auto",a.questionText||"",f):0;return(0,b.jsxs)("div",{className:`mb-4 border-b last:border-b-0 print:break-inside-avoid [content-visibility:auto] [contain-intrinsic-size:auto_480px] print:[content-visibility:visible] ${e?"pb-4":"pb-6"}`,children:[(0,b.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 leading-7",children:[(0,b.jsx)("span",{className:"text-lg font-bold",children:j.printPreview?.questionNumber?.replace("{num}",String(c+1))||`Question ${c+1}`}),a.shortId&&(0,b.jsx)("span",{className:"font-mono text-sm text-muted-foreground whitespace-nowrap",children:j.printPreview.source.replace("{id}",a.shortId)}),a.subject&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:a.subject.name}),a.gradeSemester&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:a.gradeSemester}),h&&(0,b.jsxs)("span",{className:"text-sm text-muted-foreground",children:[j.printPreview?.paperLevel||"Paper Level",": ",h]}),d.showTags&&m.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"font-semibold",children:[j.printPreview?.knowledgePoints||"Knowledge Points",":"]}),m.map((a,c)=>(0,b.jsx)("span",{className:"px-2 py-1 bg-muted rounded text-sm",children:a},`${a}-${c}`))]}),i&&(0,b.jsxs)("button",{type:"button",className:"print:hidden ml-auto flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-destructive",onClick:()=>i(a.id),children:[(0,b.jsx)(r.X,{className:"h-3.5 w-3.5"}),j.printPreview.removeFromPrint]})]}),d.showQuestionText&&a.questionText?(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsx)(s.f,{content:a.questionText}),(0,b.jsx)(u.f,{svg:a.figureSvg,scale:a.figureScale,align:a.figureAlign})]}):a.originalImageUrl&&(0,b.jsx)("div",{className:"mb-4",children:(0,b.jsx)("img",{src:a.originalImageUrl,alt:j.detail?.originalProblem||"Question Image",loading:"lazy",decoding:"async",className:"h-auto border rounded",style:{maxWidth:`${d.imageScale}%`}})}),d.showAnswers&&a.answerText&&(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("h3",{className:"font-semibold mb-2",children:[j.printPreview?.referenceAnswer||"Reference Answer",":"]}),(0,b.jsx)(s.f,{content:a.answerText})]}),d.showAnalysis&&a.analysis&&(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("h3",{className:"font-semibold mb-2",children:[j.printPreview?.analysis||"Analysis",":"]}),(0,b.jsx)(s.f,{content:a.analysis})]}),e&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"print-answer-space",style:{minHeight:`${n}px`}}),g&&(0,b.jsx)(t.f,{effectivePx:n,isCustom:"number"==typeof f,onChange:b=>g(a.id,b),onReset:()=>g(a.id,null)})]})]})});var w=a.i(291938),x=a.i(557999),y=a.i(321466),z=a.i(697902),A=a.i(630534);async function B(a,{timeoutMs:b=3e4,onProgress:c}={}){let d,e=Array.from(a.querySelectorAll("img")),f=0;c?.(f,e.length);let g=Promise.all(e.map(async a=>{a.loading="eager",await (a.complete?Promise.resolve():new Promise(b=>{a.addEventListener("load",()=>b(),{once:!0}),a.addEventListener("error",()=>b(),{once:!0})})),f+=1,c?.(f,e.length)})),h=new Promise(a=>{d=setTimeout(a,b)});await Promise.race([g,h]),clearTimeout(d)}let C="print-preview-options",D={showQuestionText:!1,showAnswers:!1,showAnalysis:!1,showTags:!1,imageScale:70,answerSpace:"auto"},E=["showQuestionText","showAnswers","showAnalysis","showTags"];var F=a.i(481132);async function G(a){for(let b of function(a,b){let c=[];for(let d=0;d<a.length;d+=b)c.push(a.slice(d,d+b));return c}(a,z.A))await w.k.put("/api/error-items/answer-space",{items:b})}function H(){var a,g,h,i,j,l;let p=(0,d.useSearchParams)(),{t:r}=(0,k.b)(),[s,t]=(0,c.useState)([]);(0,x.f)(r.printPreview.title);let[u,H]=(0,c.useState)(!0),[I,J]=(0,c.useState)(D);(0,c.useEffect)(()=>{J(function(){try{return function(a){let b,c={...D};if(!a)return c;try{b=JSON.parse(a)}catch{return c}if(!b||"object"!=typeof b)return c;let d=b;for(let a of E)"boolean"==typeof d[a]&&(c[a]=d[a]);return"number"==typeof d.imageScale&&Number.isFinite(d.imageScale)&&(c.imageScale=Math.min(100,Math.max(30,Math.round(d.imageScale)))),(0,o.I)(d.answerSpace)&&(c.answerSpace=d.answerSpace),c}(localStorage.getItem(C))}catch{return{...D}}}())},[]);let[K,L]=(0,c.useState)(new Set),{customSpaces:M,setSpace:N,resetAll:O,saveFailed:P}=(0,y.f)(s,G),Q=(0,c.useCallback)(async()=>{try{let a=await m(a=>{let b=new URLSearchParams(p.toString());return b.set("page",String(a)),b.set("pageSize",String(z.A)),b.set("view","print"),w.k.get(`/api/error-items/list?${b.toString()}`)});t(a),L(new Set(a.map(a=>a.id)))}catch(a){A.V.error("[PrintPreview]","Failed to fetch items",{error:a})}finally{H(!1)}},[p]);(0,c.useEffect)(()=>{Q()},[Q]);let R=(0,c.useRef)(null),[S,T]=(0,c.useState)(null),U=async()=>{R.current&&await B(R.current,{onProgress:(a,b)=>T({loaded:a,total:b})}),T(null),window.print()},{groups:V}=(0,F.f)(),W=(0,c.useMemo)(()=>new Map(V.map(a=>[a.id,a.name])),[V]),X=(0,c.useMemo)(()=>s.filter(a=>K.has(a.id)),[s,K]),Y=(0,c.useMemo)(()=>new Map(X.map((a,b)=>[a.id,b+1])),[X]),Z=(a=I.showAnswers,g=I.showAnalysis,!a&&!g),$=(h=s.length,(i=X.length)===h?String(h):`${i}/${h}`),_=(j=s.length,l=X.length,0===j?"noItems":0===l?"noSelection":null),aa=(0,c.useCallback)(a=>{L(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),ab=(0,c.useCallback)(a=>{L(b=>{let c=new Set(b);return c.delete(a),c})},[]);return u?(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,b.jsx)("p",{className:"text-muted-foreground",children:r.common.loading})}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"print:hidden sticky top-0 z-10 bg-background border-b p-3 sm:p-4 shadow-sm",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(f.f,{fallbackUrl:"/notebooks"}),(0,b.jsxs)("h1",{className:"text-lg sm:text-xl font-bold flex-1",children:[r.printPreview?.title||"Print Preview"," (",$," ",r.notebooks?.items||"items",")"]}),(0,b.jsx)(e.f,{onClick:U,size:"sm",className:"whitespace-nowrap",disabled:0===X.length||null!==S,children:S?r.printPreview.loadingImages.replace("{loaded}",String(S.loaded)).replace("{total}",String(S.total)):r.printPreview?.printButton||"Print / Save PDF"})]}),(0,b.jsx)(q,{options:I,onChange:a=>J(b=>{let c={...b,...a};try{localStorage.setItem(C,JSON.stringify(c))}catch{}return c}),hasCustomSpaces:Object.keys(M).length>0,onResetCustomSpaces:O}),P&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:r.exam.answerSpaceSaveFailed})]})}),(0,b.jsx)("div",{className:"print:hidden border-b p-3 sm:p-4",children:(0,b.jsx)("div",{className:"max-w-6xl mx-auto",children:(0,b.jsx)(n,{items:s,selectedIds:K,selectedCount:X.length,printNumbers:Y,onToggle:aa,onSelectionChange:L})})}),(0,b.jsxs)("div",{ref:R,className:"max-w-4xl mx-auto p-8 print:p-0",children:[X.map((a,c)=>(0,b.jsx)(v,{item:a,index:c,options:I,reserveAnswerSpace:Z,customAnswerSpacePx:M[a.id],onCustomAnswerSpaceChange:N,paperGroupName:a.paperLevel?W.get(a.paperLevel)??a.paperLevel:null,onRemove:ab},a.id)),_&&(0,b.jsx)("div",{className:"text-center py-12 text-muted-foreground",children:"noSelection"===_?r.printPreview?.noSelection||"No items selected":r.printPreview?.noItems||"No matching error items"})]})]})}a.s(["default",0,function(){let{t:a}=(0,k.b)();return(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:a.common.loading}),children:(0,b.jsx)(H,{})})}],771706)}];
1
+ module.exports=[771706,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(699570),f=a.i(695001),g=a.i(589027),h=a.i(113608),i=a.i(233540),j=a.i(866718),k=a.i(550194);function l(a){if(a.tags&&a.tags.length>0)return a.tags.map(a=>a.name);try{let b=JSON.parse(a.knowledgePoints||"[]");return Array.isArray(b)?b.filter(a=>"string"==typeof a):[]}catch{return[]}}async function m(a){let b=[];for(let c=1;;c+=1){let d=await a(c);if(b.push(...d.items),0===d.items.length||c>=d.totalPages)return b}}function n({items:a,selectedIds:d,selectedCount:f,printNumbers:m,onToggle:o,onSelectionChange:p}){let{t:q}=(0,k.b)(),[r,s]=(0,c.useState)(a.length<=20),[t,u]=(0,c.useState)(""),v=(0,c.useMemo)(()=>a.filter(a=>{let b;return!(b=t.trim().toLowerCase())||[a.questionText??"",a.shortId??"",...l(a)].some(a=>a.toLowerCase().includes(b))}),[a,t]),w=t.trim().length>0,x=a=>p(function(a,b,c){let d=new Set(a);for(let e of b)"select"!==c&&("invert"!==c||a.has(e))?d.delete(e):d.add(e);return d}(d,v.map(a=>a.id),a));return(0,b.jsxs)("div",{className:"rounded-md border bg-muted/20 p-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-sm font-medium hover:text-primary","aria-expanded":r,onClick:()=>s(a=>!a),children:[r?(0,b.jsx)(h.f,{className:"h-4 w-4"}):(0,b.jsx)(g.f,{className:"h-4 w-4"}),q.printPreview.selectItems," (",f,"/",a.length,")"]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(e.f,{variant:"outline",size:"sm",onClick:()=>x("select"),children:w?q.printPreview.selectFiltered:q.printPreview.selectAll}),(0,b.jsx)(e.f,{variant:"outline",size:"sm",onClick:()=>x("clear"),children:w?q.printPreview.clearFiltered:q.printPreview.clearSelection}),(0,b.jsx)(e.f,{variant:"outline",size:"sm",onClick:()=>x("invert"),children:q.printPreview.invertSelection})]})]}),r&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(i.f,{className:"absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(j.f,{type:"search",value:t,onChange:a=>u(a.target.value),placeholder:q.printPreview.searchPlaceholder,"aria-label":q.printPreview.searchPlaceholder,className:"h-8 pl-8 text-sm"})]}),(0,b.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3 max-h-[40vh] overflow-y-auto pr-1",children:[v.map(a=>{let c=m.get(a.id);return(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded border bg-background p-2 text-xs cursor-pointer hover:border-primary/50",children:[(0,b.jsx)("input",{type:"checkbox",checked:d.has(a.id),onChange:()=>o(a.id),className:"mt-0.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,b.jsxs)("span",{className:"line-clamp-2",children:[void 0!==c&&(0,b.jsxs)("span",{className:"font-semibold",children:[q.printPreview.questionNumber.replace("{num}",String(c)),q.common.colon]}),a.shortId&&(0,b.jsxs)("span",{className:"font-mono text-muted-foreground",children:[a.shortId," "]}),a.questionText]})]},a.id)}),0===v.length&&(0,b.jsx)("p",{className:"col-span-full py-2 text-center text-xs text-muted-foreground",children:q.printPreview.noSearchResult})]})]})]})}var o=a.i(922115);function p({checked:a,onChange:c,label:d}){return(0,b.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:a,onChange:a=>c(a.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),d]})}function q({options:a,onChange:c,hasCustomSpaces:d,onResetCustomSpaces:f}){let{t:g}=(0,k.b)(),h=a.answerSpace??"auto";return(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,b.jsxs)("span",{className:"whitespace-nowrap text-xs sm:text-sm",children:[g.printPreview?.imageScale||"Image Scale",": ",a.imageScale,"%"]}),(0,b.jsx)("input",{type:"range",min:"30",max:"100",value:a.imageScale,onChange:a=>c({imageScale:Number(a.target.value)}),className:"w-16 sm:w-20 accent-primary"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs sm:text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,b.jsxs)("label",{htmlFor:"print-preview-answer-space",className:"whitespace-nowrap",children:[g.exam.answerSpace,":"]}),(0,b.jsxs)("select",{id:"print-preview-answer-space",value:h,onChange:a=>{(0,o.I)(a.target.value)&&c({answerSpace:a.target.value})},className:"bg-background border rounded px-2 py-0.5 text-xs sm:text-sm",children:[(0,b.jsx)("option",{value:"auto",children:g.exam.answerSpaceAuto}),(0,b.jsx)("option",{value:"none",children:g.exam.answerSpaceNone}),(0,b.jsx)("option",{value:"small",children:g.exam.answerSpaceSmall}),(0,b.jsx)("option",{value:"medium",children:g.exam.answerSpaceMedium}),(0,b.jsx)("option",{value:"large",children:g.exam.answerSpaceLarge})]}),d&&f&&(0,b.jsx)(e.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:f,children:g.exam.resetAllQuestionAnswerSpaces})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 sm:gap-4",children:[(0,b.jsx)(p,{checked:a.showQuestionText,onChange:a=>c({showQuestionText:a}),label:g.printPreview?.showQuestionText||"Question Text"}),(0,b.jsx)(p,{checked:a.showAnswers,onChange:a=>c({showAnswers:a}),label:g.printPreview?.showAnswers||"Show Answers"}),(0,b.jsx)(p,{checked:a.showAnalysis,onChange:a=>c({showAnalysis:a}),label:g.printPreview?.showAnalysis||"Show Analysis"}),(0,b.jsx)(p,{checked:a.showTags,onChange:a=>c({showTags:a}),label:g.printPreview?.showTags||"Show Tags"})]})]})}var r=a.i(474215),s=a.i(93907),t=a.i(897555),u=a.i(572594),v=a.i(418943);let w=(0,c.memo)(function({item:a,index:c,options:d,reserveAnswerSpace:e,customAnswerSpacePx:f,onCustomAnswerSpaceChange:g,paperGroupName:h,onRemove:i}){let{t:j}=(0,k.b)(),m=l(a),n=e?(0,o.z)(d.answerSpace??"auto",a.questionText||"",f):0;return(0,b.jsxs)("div",{className:`mb-4 border-b last:border-b-0 print:break-inside-avoid [content-visibility:auto] [contain-intrinsic-size:auto_480px] print:[content-visibility:visible] ${e?"pb-4":"pb-6"}`,children:[(0,b.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 leading-7",children:[(0,b.jsx)("span",{className:"text-lg font-bold",children:j.printPreview?.questionNumber?.replace("{num}",String(c+1))||`Question ${c+1}`}),a.shortId&&(0,b.jsx)("span",{className:"font-mono text-sm text-muted-foreground whitespace-nowrap",children:j.printPreview.source.replace("{id}",a.shortId)}),a.subject&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:a.subject.name}),a.gradeSemester&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:a.gradeSemester}),h&&(0,b.jsxs)("span",{className:"text-sm text-muted-foreground",children:[j.printPreview?.paperLevel||"Paper Level",": ",h]}),d.showTags&&m.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"font-semibold",children:[j.printPreview?.knowledgePoints||"Knowledge Points",":"]}),m.map((a,c)=>(0,b.jsx)("span",{className:"px-2 py-1 bg-muted rounded text-sm",children:a},`${a}-${c}`))]}),i&&(0,b.jsxs)("button",{type:"button",className:"print:hidden ml-auto flex items-center gap-1 rounded px-2 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-destructive",onClick:()=>i(a.id),children:[(0,b.jsx)(r.X,{className:"h-3.5 w-3.5"}),j.printPreview.removeFromPrint]})]}),d.showQuestionText&&a.questionText?(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsx)(u.f,{content:a.questionText}),(0,b.jsx)(v.f,{svg:a.figureSvg,scale:a.figureScale,align:a.figureAlign})]}):a.originalImageUrl&&(0,b.jsx)("div",{className:"mb-4",children:(0,b.jsx)("img",{src:a.originalImageUrl,alt:j.detail?.originalProblem||"Question Image",loading:"lazy",decoding:"async",className:"h-auto border rounded",style:{maxWidth:`${d.imageScale}%`}})}),d.showAnswers&&a.answerText&&(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("h3",{className:"font-semibold mb-2",children:[j.printPreview?.referenceAnswer||"Reference Answer",":"]}),(0,b.jsx)(s.f,{content:a.answerText})]}),d.showAnalysis&&a.analysis&&(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("h3",{className:"font-semibold mb-2",children:[j.printPreview?.analysis||"Analysis",":"]}),(0,b.jsx)(s.f,{content:a.analysis})]}),e&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"print-answer-space",style:{minHeight:`${n}px`}}),g&&(0,b.jsx)(t.f,{effectivePx:n,isCustom:"number"==typeof f,onChange:b=>g(a.id,b),onReset:()=>g(a.id,null)})]})]})});var x=a.i(291938),y=a.i(557999),z=a.i(321466),A=a.i(697902),B=a.i(630534);async function C(a,{timeoutMs:b=3e4,onProgress:c}={}){let d,e=Array.from(a.querySelectorAll("img")),f=0;c?.(f,e.length);let g=Promise.all(e.map(async a=>{a.loading="eager",await (a.complete?Promise.resolve():new Promise(b=>{a.addEventListener("load",()=>b(),{once:!0}),a.addEventListener("error",()=>b(),{once:!0})})),f+=1,c?.(f,e.length)})),h=new Promise(a=>{d=setTimeout(a,b)});await Promise.race([g,h]),clearTimeout(d)}let D="print-preview-options",E={showQuestionText:!1,showAnswers:!1,showAnalysis:!1,showTags:!1,imageScale:70,answerSpace:"auto"},F=["showQuestionText","showAnswers","showAnalysis","showTags"];var G=a.i(481132);async function H(a){for(let b of function(a,b){let c=[];for(let d=0;d<a.length;d+=b)c.push(a.slice(d,d+b));return c}(a,A.A))await x.k.put("/api/error-items/answer-space",{items:b})}function I(){var a,g,h,i,j,l;let p=(0,d.useSearchParams)(),{t:r}=(0,k.b)(),[s,t]=(0,c.useState)([]);(0,y.f)(r.printPreview.title);let[u,v]=(0,c.useState)(!0),[I,J]=(0,c.useState)(E);(0,c.useEffect)(()=>{J(function(){try{return function(a){let b,c={...E};if(!a)return c;try{b=JSON.parse(a)}catch{return c}if(!b||"object"!=typeof b)return c;let d=b;for(let a of F)"boolean"==typeof d[a]&&(c[a]=d[a]);return"number"==typeof d.imageScale&&Number.isFinite(d.imageScale)&&(c.imageScale=Math.min(100,Math.max(30,Math.round(d.imageScale)))),(0,o.I)(d.answerSpace)&&(c.answerSpace=d.answerSpace),c}(localStorage.getItem(D))}catch{return{...E}}}())},[]);let[K,L]=(0,c.useState)(new Set),{customSpaces:M,setSpace:N,resetAll:O,saveFailed:P}=(0,z.f)(s,H),Q=(0,c.useCallback)(async()=>{try{let a=await m(a=>{let b=new URLSearchParams(p.toString());return b.set("page",String(a)),b.set("pageSize",String(A.A)),b.set("view","print"),x.k.get(`/api/error-items/list?${b.toString()}`)});t(a),L(new Set(a.map(a=>a.id)))}catch(a){B.V.error("[PrintPreview]","Failed to fetch items",{error:a})}finally{v(!1)}},[p]);(0,c.useEffect)(()=>{Q()},[Q]);let R=(0,c.useRef)(null),[S,T]=(0,c.useState)(null),U=async()=>{R.current&&await C(R.current,{onProgress:(a,b)=>T({loaded:a,total:b})}),T(null),window.print()},{groups:V}=(0,G.f)(),W=(0,c.useMemo)(()=>new Map(V.map(a=>[a.id,a.name])),[V]),X=(0,c.useMemo)(()=>s.filter(a=>K.has(a.id)),[s,K]),Y=(0,c.useMemo)(()=>new Map(X.map((a,b)=>[a.id,b+1])),[X]),Z=(a=I.showAnswers,g=I.showAnalysis,!a&&!g),$=(h=s.length,(i=X.length)===h?String(h):`${i}/${h}`),_=(j=s.length,l=X.length,0===j?"noItems":0===l?"noSelection":null),aa=(0,c.useCallback)(a=>{L(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),ab=(0,c.useCallback)(a=>{L(b=>{let c=new Set(b);return c.delete(a),c})},[]);return u?(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,b.jsx)("p",{className:"text-muted-foreground",children:r.common.loading})}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"print:hidden sticky top-0 z-10 bg-background border-b p-3 sm:p-4 shadow-sm",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(f.f,{fallbackUrl:"/notebooks"}),(0,b.jsxs)("h1",{className:"text-lg sm:text-xl font-bold flex-1",children:[r.printPreview?.title||"Print Preview"," (",$," ",r.notebooks?.items||"items",")"]}),(0,b.jsx)(e.f,{onClick:U,size:"sm",className:"whitespace-nowrap",disabled:0===X.length||null!==S,children:S?r.printPreview.loadingImages.replace("{loaded}",String(S.loaded)).replace("{total}",String(S.total)):r.printPreview?.printButton||"Print / Save PDF"})]}),(0,b.jsx)(q,{options:I,onChange:a=>J(b=>{let c={...b,...a};try{localStorage.setItem(D,JSON.stringify(c))}catch{}return c}),hasCustomSpaces:Object.keys(M).length>0,onResetCustomSpaces:O}),P&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:r.exam.answerSpaceSaveFailed})]})}),(0,b.jsx)("div",{className:"print:hidden border-b p-3 sm:p-4",children:(0,b.jsx)("div",{className:"max-w-6xl mx-auto",children:(0,b.jsx)(n,{items:s,selectedIds:K,selectedCount:X.length,printNumbers:Y,onToggle:aa,onSelectionChange:L})})}),(0,b.jsxs)("div",{ref:R,className:"max-w-4xl mx-auto p-8 print:p-0",children:[X.map((a,c)=>(0,b.jsx)(w,{item:a,index:c,options:I,reserveAnswerSpace:Z,customAnswerSpacePx:M[a.id],onCustomAnswerSpaceChange:N,paperGroupName:a.paperLevel?W.get(a.paperLevel)??a.paperLevel:null,onRemove:ab},a.id)),_&&(0,b.jsx)("div",{className:"text-center py-12 text-muted-foreground",children:"noSelection"===_?r.printPreview?.noSelection||"No items selected":r.printPreview?.noItems||"No matching error items"})]})]})}a.s(["default",0,function(){let{t:a}=(0,k.b)();return(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:a.common.loading}),children:(0,b.jsx)(I,{})})}],771706)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_print-preview_page_tsx_001yt-fzrj7tf._.js.map
@@ -1,6 +1,6 @@
1
- module.exports=[78287,31364,313231,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(875160),e=a.i(519783),f=a.i(879675),g=a.i(63331),h=a.i(310395),i=a.i(699570),j=a.i(550194),k=a.i(291938),l=a.i(710302),m=a.i(630534);function n({data:a,onChange:e}){let{t:f}=(0,j.b)(),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(null),s=async()=>{if(!a.questionText.trim())return void l.c.warning(f.editor.enterQuestionFirst||"Please enter question text first");if(!a.answerText.trim())return void l.c.warning(f.geogebra.answerRequired);p(!0),r(null);try{let b=await k.k.post("/api/geogebra-analyze",{questionText:a.questionText,answerText:a.answerText,analysis:a.analysis},{timeout:18e4,recoverable:!0});b.suitable&&b.commands&&b.commands.length>0?e({geogebraCommands:JSON.stringify(b.commands)}):r(b.description||f.geogebra.notSuitable)}catch(a){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:a}),r(f.geogebra.analyzeFailed)}finally{p(!1)}};return a.geogebraCommands?(0,b.jsx)(h.f,{commands:a.geogebraCommands,height:350,onRegenerate:s,onDelete:async()=>e({geogebraCommands:void 0})}):a.questionText.trim()&&a.answerText.trim()?(0,b.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(g.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:f.geogebra.title})]}),(0,b.jsx)(i.f,{variant:"outline",size:"sm",onClick:s,disabled:o,children:o?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}),f.geogebra.analyzing]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.f,{className:"mr-2 h-4 w-4"}),f.geogebra.generate]})})]}),q&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:q}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:f.geogebra.hint})]}):null}var o=a.i(131368),p=a.i(393045),q=a.i(350659),r=a.i(358236),s=a.i(870430),t=a.i(580701),u=a.i(391020);function v({data:a,paperLevel:c,onChange:d}){let{t:e}=(0,j.b)();return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:e.editor.selectNotebook||"Select Notebook"}),(0,b.jsx)(q.f,{value:a.subjectId,onChange:a=>d({subjectId:a})})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:e.questionType.label||"Question Type"}),(0,b.jsxs)(t.d,{value:a.questionType||"",onValueChange:a=>d({questionType:a===u.O?null:a}),children:[(0,b.jsx)(t.P,{children:(0,b.jsx)(t.U,{placeholder:e.questionType.notSet||"Not set"})}),(0,b.jsxs)(t.r,{children:[(0,b.jsx)(t.T,{value:u.O,children:e.questionType.clear||"Clear"}),u.V.map(a=>(0,b.jsx)(t.T,{value:a,children:e.questionType.names?.[a]||a},a))]})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{htmlFor:"correction-grade-semester",children:e.editor.gradeSemester||"Grade/Semester"}),(0,b.jsx)(p.f,{id:"correction-grade-semester",value:a.gradeSemester||"",onChange:a=>d({gradeSemester:a})})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:e.editor.paperLevel||"Paper Level"}),(0,b.jsx)(r.f,{value:c,onChange:a=>d({paperLevel:a})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:e.difficulty.label}),(0,b.jsx)("div",{children:(0,b.jsx)(o.f,{size:"md",value:a.difficultyStars,onChange:a=>d({difficultyStars:a})})})]})]})}var w=a.i(460081),x=a.i(591119);function y({data:a,onChange:c}){let{t:d}=(0,j.b)();return(0,b.jsxs)(x.N,{children:[(0,b.jsx)(x.Y,{children:(0,b.jsx)(x.v,{children:d.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,b.jsxs)(x.O,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:d.editor.mistakeStatus||"Attempt Status"}),(0,b.jsxs)(t.d,{value:a.mistakeStatus||"unknown",onValueChange:a=>c({mistakeStatus:a}),children:[(0,b.jsx)(t.P,{children:(0,b.jsx)(t.U,{})}),(0,b.jsxs)(t.r,{children:[(0,b.jsx)(t.T,{value:"not_attempted",children:d.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,b.jsx)(t.T,{value:"wrong_attempt",children:d.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,b.jsx)(t.T,{value:"unknown",children:d.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:d.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,b.jsx)(w.f,{value:a.wrongAnswerText||"",onChange:b=>c({wrongAnswerText:b,mistakeStatus:b.trim()?"wrong_attempt":a.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:d.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:d.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,b.jsx)(w.f,{value:a.mistakeAnalysis||"",onChange:a=>c({mistakeAnalysis:a}),className:"min-h-[140px] font-mono text-sm",placeholder:d.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var z=a.i(93907),A=a.i(418943);function B({title:a,children:c,className:d}){return(0,b.jsxs)(x.N,{children:[(0,b.jsx)(x.Y,{children:(0,b.jsx)(x.v,{children:a})}),(0,b.jsx)(x.O,{className:d,children:c})]})}function C({data:a,children:c}){let{t:d}=(0,j.b)(),e={wrong_attempt:d.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:d.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:d.editor.mistakeStatuses?.unknown||"Unknown"};return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)(B,{title:d.editor.preview?.question||"Question Preview",children:[(0,b.jsx)(z.f,{content:a.questionText}),(0,b.jsx)(A.f,{svg:a.figureSvg})]}),c,(0,b.jsx)(B,{title:d.editor.preview?.answer||"Answer Preview",children:(0,b.jsx)(z.f,{content:a.answerText})}),(0,b.jsx)(B,{title:d.editor.preview?.analysis||"Analysis Preview",children:(0,b.jsx)(z.f,{content:a.analysis})}),(0,b.jsxs)(B,{title:d.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,b.jsxs)("div",{className:"text-muted-foreground",children:[d.editor.mistakeStatus||"Attempt Status",d.common.colon,e[a.mistakeStatus]??e.unknown]}),a.wrongAnswerText&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"font-medium mb-1",children:d.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,b.jsx)(z.f,{content:a.wrongAnswerText})]}),a.mistakeAnalysis&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"font-medium mb-1",children:d.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,b.jsx)(z.f,{content:a.mistakeAnalysis})]})]})]})}var D=a.i(699814),E=a.i(529759),F=a.i(986705);a.i(348966);var G=a.i(694696),H=a.i(738912),I=a.i(481132),J=a.i(960927);a.s(["f",0,function({initialData:a,onSave:g,onCancel:h,imagePreview:o,initialSubjectId:p,aiTimeout:q}){let{timeZone:r}=(0,E.M)(),{t,language:u}=(0,j.b)(),z=a=>a.trim()?a:"",[A,B]=(0,c.useState)({...a,answerText:z(a.answerText),analysis:z(a.analysis),wrongAnswerText:a.wrongAnswerText||"",mistakeAnalysis:a.mistakeAnalysis||"",mistakeStatus:a.mistakeStatus||"unknown",subjectId:p,gradeSemester:a.gradeSemester||""}),K=(0,c.useRef)(!1),L=a=>{"gradeSemester"in a&&(K.current=!0),B(b=>({...b,...a}))},{groups:M}=(0,I.f)(),N=(()=>{if(A.paperLevel)return A.paperLevel;let a="number"==typeof A.difficultyStars&&A.difficultyStars>=4?"b":"a";return M.find(b=>b.key===a&&b.isActive)?.id||""})(),O=A.paperLevel??N,[P,Q]=(0,c.useState)(!1),[R,S]=(0,c.useState)(!1),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(void 0),[X,Y]=(0,c.useState)([]);(0,c.useEffect)(()=>{k.k.get("/api/notebooks").then(Y).catch(a=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:a})),k.k.get("/api/user").then(a=>{if(U(!!a?.enableGeogebra),a){let b=function(a,b=F.J){return"ai"===a.gradeRecognitionMode?null:a.fixedGradeSemester?a.fixedGradeSemester:a.educationStage&&a.enrollmentYear?function(a,b,c=new Date,d="en",e=F.J){let f=(0,F.c)(c,e),g=f.getFullYear(),h=f.getMonth()+1,i=g-b,j="2nd";h>=9?(i+=1,j="1st"):j=h<2?"1st":"2nd";let k="zh"===d,l=k?"1st"===j?"上期":"下期":"1st"===j?"1st Semester":"2nd Semester",m=(k?{primary:["一年级","二年级","三年级","四年级","五年级","六年级"],junior_high:["初一","初二","初三"],senior_high:["高一","高二","高三"],university:["大一","大二","大三","大四"]}:{primary:["Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6"],junior_high:["Junior High Grade 1","Junior High Grade 2","Junior High Grade 3"],senior_high:["Senior High Grade 1","Senior High Grade 2","Senior High Grade 3"],university:["Freshman","Sophomore","Junior","Senior"]})[a]||[],n=`${i}`;if(n=i>0&&i<=m.length?m[i-1]:i>m.length?k?"已毕业":"Graduated":k?"学前":"Pre-school",!k)return`${n}, ${l}`;{let a="1st"===j?"上":"下";return`${n}${a}`}}(a.educationStage,a.enrollmentYear,new Date,"zh",b):null}(a,r);B(a=>a.gradeSemester||K.current?a:{...a,gradeSemester:b||""}),W(a.educationStage||void 0)}}).catch(a=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:a}))},[u,r]);let Z=async()=>{if(!A.questionText.trim())return void l.c.warning(t.editor.enterQuestionFirst||"Please enter question text first");Q(!0);try{let a=function({questionText:a,language:b,subject:c,imagePreview:d,gradeSemester:e,subjectId:f}){let g={questionText:a,language:b,subject:c};return d&&(g.imageBase64=d),e&&(g.gradeSemester=e),f&&(g.subjectId=f),g}({questionText:A.questionText,language:u,subject:A.subject,imagePreview:o,gradeSemester:A.gradeSemester??void 0,subjectId:A.subjectId});m.V.info("[Reanswer]",a.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:q});let b=await k.k.post("/api/reanswer",a,{timeout:q||18e4,recoverable:!0});B(a=>({...a,answerText:b.answerText,analysis:b.analysis,knowledgePoints:b.knowledgePoints,wrongAnswerText:b.wrongAnswerText||"",mistakeAnalysis:b.mistakeAnalysis||"",mistakeStatus:(0,H.x)(b.mistakeStatus,b.wrongAnswerText),difficultyStars:b.difficultyStars??a.difficultyStars,questionType:b.questionType??a.questionType})),l.c.success(t.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(d){let a,b,c;m.V.error("[CorrectionEditor]","Reanswer failed",{error:d}),l.c.error((a=(0,J.d)(d)||"",c=(b=t.errors?.reanswer||{}).default||"Reanswer failed",a.includes("AI_AUTH_ERROR")?b.authError||t.errors?.AI_AUTH_ERROR||c:a.includes("AI_CONNECTION_FAILED")?b.connectionFailed||t.errors?.AI_CONNECTION_FAILED||c:a.includes("AI_RESPONSE_ERROR")&&(b.responseError||t.errors?.AI_RESPONSE_ERROR)||c))}finally{Q(!1)}},$=async()=>{if(!A.subjectId)return void l.c.warning(t.editor.messages?.selectNotebook||"Please select a notebook");if(!R){S(!0);try{await g({...A,paperLevel:O,mistakeStatus:(0,H.x)(A.mistakeStatus,A.wrongAnswerText)})}finally{S(!1)}}},_=t.editor.placeholder||"Supports Markdown and LaTeX...",aa=(0,G.f)(X.find(a=>a.id===A.subjectId)?.name||null)||(0,G.f)(A.subject||null)||void 0;return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("h2",{className:"text-2xl font-bold",children:t.editor.title}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(i.f,{variant:"outline",onClick:h,children:t.editor.cancel}),(0,b.jsxs)(i.f,{onClick:$,disabled:R,children:[R?(0,b.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(f.f,{className:"mr-2 h-4 w-4"}),R?t.common?.pleaseWait||"Please wait...":t.editor.save]})]})]}),(0,b.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,b.jsxs)("div",{className:"space-y-6",children:[o&&(0,b.jsx)(x.N,{children:(0,b.jsx)(x.O,{className:"p-4",children:(0,b.jsx)("img",{src:o,alt:"Original",className:"w-full rounded-md"})})}),(0,b.jsx)(v,{data:A,paperLevel:O,onChange:L}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:t.editor.question}),(0,b.jsx)(w.f,{value:A.questionText,onChange:a=>L({questionText:a}),className:"min-h-[150px] font-mono text-sm",placeholder:_}),(0,b.jsx)(i.f,{variant:"default",size:"sm",onClick:Z,disabled:P||!A.questionText.trim(),className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",children:P?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}),t.editor.reanswering||"AI solving..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(e.f,{className:"mr-2 h-4 w-4"}),t.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:t.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:t.editor.tags}),(0,b.jsx)(D.f,{value:A.knowledgePoints,onChange:a=>L({knowledgePoints:a}),placeholder:t.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:t.editor.createTagHint,subject:aa,gradeStage:V}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:t.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:t.editor.answer}),(0,b.jsx)(w.f,{value:A.answerText,onChange:a=>L({answerText:a}),className:"min-h-[100px] font-mono text-sm",placeholder:_})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:t.editor.analysis}),(0,b.jsx)(w.f,{value:A.analysis,onChange:a=>L({analysis:a}),className:"min-h-[200px] font-mono text-sm",placeholder:_})]}),(0,b.jsx)(y,{data:A,onChange:L})]}),(0,b.jsx)(C,{data:A,children:T&&(0,b.jsx)(n,{data:A,onChange:L})})]})]})}],78287);var K=a.i(390702),L=a.i(474215);a.s(["f",0,function({message:a,onDismiss:c}){let{t:d}=(0,j.b)();return a?(0,b.jsxs)("div",{role:"alert",className:"flex items-start gap-3 rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[(0,b.jsx)(K.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,b.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:a}),(0,b.jsx)("button",{type:"button",onClick:c,"aria-label":d.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,b.jsx)(L.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],31364);var M=a.i(50944);function N(a){return"object"!=typeof a||null===a||Array.isArray(a)?void 0:a}function O(a,b){if("string"!=typeof a||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(a))return;let c=b.errors[a];return"string"==typeof c?c:void 0}a.s(["f",0,function(a){let{t:b}=(0,j.b)(),d=(0,M.useRouter)(),[e,f]=(0,c.useState)(null),g=async(c,e,g=!0)=>{f(null);try{let a=await c();return l.c.success(a.duplicate?b.importFlow.duplicate:b.common.messages.saveSuccess),g&&(a.duplicate?d.push(`/error-items/${a.id}`):e&&d.push(`/notebooks/${e}`)),!0}catch(d){m.V.error(a,"Save failed",{errorMessage:(0,J.d)(d)??(0,J.Z)(d)});let c=function(a,b){let c=N(a),d=N(c?.data),e="number"==typeof c?.status?c.status:void 0,f=(0,J.d)(a),g=O(f,b)??O(d?.code,b),h={400:b.errors.QUESTION_SAVE_INVALID_INPUT,401:b.errors.QUESTION_SAVE_UNAUTHORIZED,403:b.errors.QUESTION_SAVE_FORBIDDEN,408:b.errors.QUESTION_SAVE_TIMEOUT,409:b.errors.QUESTION_SAVE_CONFLICT,413:b.errors.QUESTION_SAVE_TOO_LARGE,429:b.errors.QUESTION_SAVE_RATE_LIMITED,502:b.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:b.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:b.errors.QUESTION_SAVE_TIMEOUT},i=g??(e?h[e]:void 0)??b.errors.QUESTION_SAVE_FAILED;!e&&(a instanceof TypeError||/fetch|network|load failed/i.test((0,J.Z)(a)))&&(i=b.errors.QUESTION_SAVE_NETWORK_ERROR);let j=N(d?.details);if("QUESTION_SAVE_GRADE_FAILED"===f){let a=O(j?.reason,b);a&&(i+=`
1
+ module.exports=[78287,31364,313231,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(875160),e=a.i(519783),f=a.i(879675),g=a.i(63331),h=a.i(310395),i=a.i(699570),j=a.i(550194),k=a.i(291938),l=a.i(710302),m=a.i(630534);function n({data:a,onChange:e}){let{t:f}=(0,j.b)(),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(null),s=async()=>{if(!a.questionText.trim())return void l.c.warning(f.editor.enterQuestionFirst||"Please enter question text first");if(!a.answerText.trim())return void l.c.warning(f.geogebra.answerRequired);p(!0),r(null);try{let b=await k.k.post("/api/geogebra-analyze",{questionText:a.questionText,answerText:a.answerText,analysis:a.analysis},{timeout:18e4,recoverable:!0});b.suitable&&b.commands&&b.commands.length>0?e({geogebraCommands:JSON.stringify(b.commands)}):r(b.description||f.geogebra.notSuitable)}catch(a){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:a}),r(f.geogebra.analyzeFailed)}finally{p(!1)}};return a.geogebraCommands?(0,b.jsx)(h.f,{commands:a.geogebraCommands,height:350,onRegenerate:s,onDelete:async()=>e({geogebraCommands:void 0})}):a.questionText.trim()&&a.answerText.trim()?(0,b.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(g.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:f.geogebra.title})]}),(0,b.jsx)(i.f,{variant:"outline",size:"sm",onClick:s,disabled:o,children:o?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}),f.geogebra.analyzing]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.f,{className:"mr-2 h-4 w-4"}),f.geogebra.generate]})})]}),q&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:q}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:f.geogebra.hint})]}):null}var o=a.i(131368),p=a.i(393045),q=a.i(350659),r=a.i(358236),s=a.i(870430),t=a.i(580701),u=a.i(391020);function v({data:a,paperLevel:c,onChange:d}){let{t:e}=(0,j.b)();return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:e.editor.selectNotebook||"Select Notebook"}),(0,b.jsx)(q.f,{value:a.subjectId,onChange:a=>d({subjectId:a})})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:e.questionType.label||"Question Type"}),(0,b.jsxs)(t.d,{value:a.questionType||"",onValueChange:a=>d({questionType:a===u.O?null:a}),children:[(0,b.jsx)(t.P,{children:(0,b.jsx)(t.U,{placeholder:e.questionType.notSet||"Not set"})}),(0,b.jsxs)(t.r,{children:[(0,b.jsx)(t.T,{value:u.O,children:e.questionType.clear||"Clear"}),u.V.map(a=>(0,b.jsx)(t.T,{value:a,children:e.questionType.names?.[a]||a},a))]})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{htmlFor:"correction-grade-semester",children:e.editor.gradeSemester||"Grade/Semester"}),(0,b.jsx)(p.f,{id:"correction-grade-semester",value:a.gradeSemester||"",onChange:a=>d({gradeSemester:a})})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:e.editor.paperLevel||"Paper Level"}),(0,b.jsx)(r.f,{value:c,onChange:a=>d({paperLevel:a})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:e.difficulty.label}),(0,b.jsx)("div",{children:(0,b.jsx)(o.f,{size:"md",value:a.difficultyStars,onChange:a=>d({difficultyStars:a})})})]})]})}var w=a.i(460081),x=a.i(591119);function y({data:a,onChange:c}){let{t:d}=(0,j.b)();return(0,b.jsxs)(x.N,{children:[(0,b.jsx)(x.Y,{children:(0,b.jsx)(x.v,{children:d.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,b.jsxs)(x.O,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:d.editor.mistakeStatus||"Attempt Status"}),(0,b.jsxs)(t.d,{value:a.mistakeStatus||"unknown",onValueChange:a=>c({mistakeStatus:a}),children:[(0,b.jsx)(t.P,{children:(0,b.jsx)(t.U,{})}),(0,b.jsxs)(t.r,{children:[(0,b.jsx)(t.T,{value:"not_attempted",children:d.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,b.jsx)(t.T,{value:"wrong_attempt",children:d.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,b.jsx)(t.T,{value:"unknown",children:d.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:d.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,b.jsx)(w.f,{value:a.wrongAnswerText||"",onChange:b=>c({wrongAnswerText:b,mistakeStatus:b.trim()?"wrong_attempt":a.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:d.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:d.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,b.jsx)(w.f,{value:a.mistakeAnalysis||"",onChange:a=>c({mistakeAnalysis:a}),className:"min-h-[140px] font-mono text-sm",placeholder:d.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var z=a.i(93907),A=a.i(418943);function B({title:a,children:c,className:d}){return(0,b.jsxs)(x.N,{children:[(0,b.jsx)(x.Y,{children:(0,b.jsx)(x.v,{children:a})}),(0,b.jsx)(x.O,{className:d,children:c})]})}function C({data:a,children:c}){let{t:d}=(0,j.b)(),e={wrong_attempt:d.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:d.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:d.editor.mistakeStatuses?.unknown||"Unknown"};return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)(B,{title:d.editor.preview?.question||"Question Preview",children:[(0,b.jsx)(z.f,{content:a.questionText}),(0,b.jsx)(A.f,{svg:a.figureSvg})]}),c,(0,b.jsx)(B,{title:d.editor.preview?.answer||"Answer Preview",children:(0,b.jsx)(z.f,{content:a.answerText})}),(0,b.jsx)(B,{title:d.editor.preview?.analysis||"Analysis Preview",children:(0,b.jsx)(z.f,{content:a.analysis})}),(0,b.jsxs)(B,{title:d.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,b.jsxs)("div",{className:"text-muted-foreground",children:[d.editor.mistakeStatus||"Attempt Status",d.common.colon,e[a.mistakeStatus]??e.unknown]}),a.wrongAnswerText&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"font-medium mb-1",children:d.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,b.jsx)(z.f,{content:a.wrongAnswerText})]}),a.mistakeAnalysis&&(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"font-medium mb-1",children:d.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,b.jsx)(z.f,{content:a.mistakeAnalysis})]})]})]})}var D=a.i(699814),E=a.i(529759),F=a.i(986705);a.i(348966);var G=a.i(694696),H=a.i(738912),I=a.i(481132),J=a.i(960927);a.s(["f",0,function({initialData:a,onSave:g,onCancel:h,imagePreview:o,initialSubjectId:p,aiTimeout:q}){let{timeZone:r}=(0,E.M)(),{t,language:u}=(0,j.b)(),z=a=>a.trim()?a:"",[A,B]=(0,c.useState)({...a,answerText:z(a.answerText),analysis:z(a.analysis),wrongAnswerText:a.wrongAnswerText||"",mistakeAnalysis:a.mistakeAnalysis||"",mistakeStatus:a.mistakeStatus||"unknown",subjectId:p,gradeSemester:a.gradeSemester||""}),K=(0,c.useRef)(!1),L=a=>{"gradeSemester"in a&&(K.current=!0),B(b=>({...b,...a}))},{groups:M}=(0,I.f)(),N=(()=>{if(A.paperLevel)return A.paperLevel;let a="number"==typeof A.difficultyStars&&A.difficultyStars>=4?"b":"a";return M.find(b=>b.key===a&&b.isActive)?.id||""})(),O=A.paperLevel??N,[P,Q]=(0,c.useState)(!1),[R,S]=(0,c.useState)(!1),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(void 0),[X,Y]=(0,c.useState)([]);(0,c.useEffect)(()=>{k.k.get("/api/notebooks").then(Y).catch(a=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:a})),k.k.get("/api/user").then(a=>{if(U(!!a?.enableGeogebra),a){let b=function(a,b=F.J){return"ai"===a.gradeRecognitionMode?null:a.fixedGradeSemester?a.fixedGradeSemester:a.educationStage&&a.enrollmentYear?function(a,b,c=new Date,d="en",e=F.J){let f=(0,F.c)(c,e),g=f.getFullYear(),h=f.getMonth()+1,i=g-b,j="2nd";h>=9?(i+=1,j="1st"):j=h<2?"1st":"2nd";let k="zh"===d,l=k?"1st"===j?"上期":"下期":"1st"===j?"1st Semester":"2nd Semester",m=(k?{primary:["一年级","二年级","三年级","四年级","五年级","六年级"],junior_high:["初一","初二","初三"],senior_high:["高一","高二","高三"],university:["大一","大二","大三","大四"]}:{primary:["Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6"],junior_high:["Junior High Grade 1","Junior High Grade 2","Junior High Grade 3"],senior_high:["Senior High Grade 1","Senior High Grade 2","Senior High Grade 3"],university:["Freshman","Sophomore","Junior","Senior"]})[a]||[],n=`${i}`;if(n=i>0&&i<=m.length?m[i-1]:i>m.length?k?"已毕业":"Graduated":k?"学前":"Pre-school",!k)return`${n}, ${l}`;{let a="1st"===j?"上":"下";return`${n}${a}`}}(a.educationStage,a.enrollmentYear,new Date,"zh",b):null}(a,r);B(a=>a.gradeSemester||K.current?a:{...a,gradeSemester:b||""}),W(a.educationStage||void 0)}}).catch(a=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:a}))},[u,r]);let Z=async()=>{if(!A.questionText.trim())return void l.c.warning(t.editor.enterQuestionFirst||"Please enter question text first");Q(!0);try{let a=function({questionText:a,language:b,subject:c,imagePreview:d,gradeSemester:e,subjectId:f}){let g={questionText:a,language:b,subject:c};return d&&(g.imageBase64=d),e&&(g.gradeSemester=e),f&&(g.subjectId=f),g}({questionText:A.questionText,language:u,subject:A.subject,imagePreview:o,gradeSemester:A.gradeSemester??void 0,subjectId:A.subjectId});m.V.info("[Reanswer]",a.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:q});let b=await k.k.post("/api/reanswer",a,{timeout:q||18e4,recoverable:!0});B(a=>({...a,answerText:b.answerText,analysis:b.analysis,knowledgePoints:b.knowledgePoints,wrongAnswerText:b.wrongAnswerText||"",mistakeAnalysis:b.mistakeAnalysis||"",mistakeStatus:(0,H.x)(b.mistakeStatus,b.wrongAnswerText),difficultyStars:b.difficultyStars??a.difficultyStars,questionType:b.questionType??a.questionType})),l.c.success(t.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(d){let a,b,c;m.V.error("[CorrectionEditor]","Reanswer failed",{error:d}),l.c.error((a=(0,J.d)(d)||"",c=(b=t.errors?.reanswer||{}).default||"Reanswer failed",a.includes("AI_AUTH_ERROR")?b.authError||t.errors?.AI_AUTH_ERROR||c:a.includes("AI_CONNECTION_FAILED")?b.connectionFailed||t.errors?.AI_CONNECTION_FAILED||c:a.includes("AI_RESPONSE_ERROR")&&(b.responseError||t.errors?.AI_RESPONSE_ERROR)||c))}finally{Q(!1)}},$=async()=>{if(!A.subjectId)return void l.c.warning(t.editor.messages?.selectNotebook||"Please select a notebook");if(!R){S(!0);try{await g({...A,paperLevel:O,mistakeStatus:(0,H.x)(A.mistakeStatus,A.wrongAnswerText)})}finally{S(!1)}}},_=t.editor.placeholder||"Supports Markdown and LaTeX...",aa=(0,G.f)(X.find(a=>a.id===A.subjectId)?.name||null)||(0,G.f)(A.subject||null)||void 0;return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("h2",{className:"text-2xl font-bold",children:t.editor.title}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(i.f,{variant:"outline",onClick:h,children:t.editor.cancel}),(0,b.jsxs)(i.f,{onClick:$,disabled:R,children:[R?(0,b.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(f.f,{className:"mr-2 h-4 w-4"}),R?t.common?.pleaseWait||"Please wait...":t.editor.save]})]})]}),(0,b.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,b.jsxs)("div",{className:"space-y-6",children:[o&&(0,b.jsx)(x.N,{children:(0,b.jsx)(x.O,{className:"p-4",children:(0,b.jsx)("img",{src:o,alt:"Original",className:"w-full rounded-md"})})}),(0,b.jsx)(v,{data:A,paperLevel:O,onChange:L}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:t.editor.question}),(0,b.jsx)(w.f,{value:A.questionText,onChange:a=>L({questionText:a}),className:"min-h-[150px] font-mono text-sm",placeholder:_}),(0,b.jsx)(i.f,{variant:"default",size:"sm",onClick:Z,disabled:P||!A.questionText.trim(),className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",children:P?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}),t.editor.reanswering||"AI solving..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(e.f,{className:"mr-2 h-4 w-4"}),t.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:t.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:t.editor.tags}),(0,b.jsx)(D.f,{value:A.knowledgePoints,onChange:a=>L({knowledgePoints:a}),placeholder:t.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:t.editor.createTagHint,subject:aa,gradeStage:V}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:t.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:t.editor.answer}),(0,b.jsx)(w.f,{value:A.answerText,onChange:a=>L({answerText:a}),className:"min-h-[100px] font-mono text-sm",placeholder:_})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:t.editor.analysis}),(0,b.jsx)(w.f,{value:A.analysis,onChange:a=>L({analysis:a}),className:"min-h-[200px] font-mono text-sm",placeholder:_})]}),(0,b.jsx)(y,{data:A,onChange:L})]}),(0,b.jsx)(C,{data:A,children:T&&(0,b.jsx)(n,{data:A,onChange:L})})]})]})}],78287);var K=a.i(390702),L=a.i(474215);a.s(["f",0,function({message:a,onDismiss:c}){let{t:d}=(0,j.b)();return a?(0,b.jsxs)("div",{role:"alert",className:"flex items-start gap-3 rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[(0,b.jsx)(K.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,b.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:a}),(0,b.jsx)("button",{type:"button",onClick:c,"aria-label":d.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,b.jsx)(L.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],31364);var M=a.i(50944);function N(a){return"object"!=typeof a||null===a||Array.isArray(a)?void 0:a}function O(a,b){if("string"!=typeof a||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(a))return;let c=b.errors[a];return"string"==typeof c?c:void 0}a.s(["f",0,function(a){let{t:b}=(0,j.b)(),d=(0,M.useRouter)(),[e,f]=(0,c.useState)(null),g=async(c,e,g=!0)=>{f(null);try{let a=await c();return l.c.success(a.duplicate?b.importFlow.duplicate:b.common.messages.saveSuccess),g&&(a.duplicate?d.push(`/error-items/${a.id}`):e&&d.push(`/notebooks/${e}`)),!0}catch(e){m.V.error(a,"Save failed",{errorMessage:(0,J.d)(e)??(0,J.Z)(e)});let c=function(a,b){let c=N(a),d=N(c?.data),e="number"==typeof c?.status?c.status:void 0,f=(0,J.d)(a),g=O(f,b)??O(d?.code,b),h={400:b.errors.QUESTION_SAVE_INVALID_INPUT,401:b.errors.QUESTION_SAVE_UNAUTHORIZED,403:b.errors.QUESTION_SAVE_FORBIDDEN,408:b.errors.QUESTION_SAVE_TIMEOUT,409:b.errors.QUESTION_SAVE_CONFLICT,413:b.errors.QUESTION_SAVE_TOO_LARGE,429:b.errors.QUESTION_SAVE_RATE_LIMITED,502:b.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:b.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:b.errors.QUESTION_SAVE_TIMEOUT},i=g??(e?h[e]:void 0)??b.errors.QUESTION_SAVE_FAILED;!e&&(a instanceof TypeError||/fetch|network|load failed/i.test((0,J.Z)(a)))&&(i=b.errors.QUESTION_SAVE_NETWORK_ERROR);let j=N(d?.details);if("QUESTION_SAVE_GRADE_FAILED"===f){let a=O(j?.reason,b);a&&(i+=`
2
2
  ${a}`)}return 400===e&&(i+=(function(a,b){if(!Array.isArray(a))return[];let c={questionText:b.editor.question,answerText:b.editor.answer,analysis:b.editor.analysis,wrongAnswerText:b.editor.wrongAnswerText,mistakeAnalysis:b.editor.mistakeAnalysis,knowledgePoints:b.editor.tags,subjectId:b.editor.selectNotebook,gradeSemester:b.editor.gradeSemester,paperLevel:b.editor.paperLevel};return a.slice(0,3).flatMap(a=>{let d=N(a),e=d?.path,f=Array.isArray(e)&&"string"==typeof e[0]?c[e[0]]:void 0;if(!f)return[];let g=d?.maximum,h=b.questionSave.invalidField;return d?.code==="too_big"&&"number"==typeof g&&Number.isSafeInteger(g)&&g>=0&&(h="array"===d.origin?b.questionSave.tooMany:b.questionSave.tooLong),[h.replace("{field}",f).replace("{maximum}",String(g))]})})(d?.details,b).map(a=>`
3
3
  ${a}`).join("")),"string"==typeof j?.databaseCode&&/^P\d{4}$/.test(j.databaseCode)&&(i+=`
4
- ${b.questionSave.databaseCode.replace("{code}",j.databaseCode)}`),e&&(i+=` (HTTP ${e})`),i}(d,b);return f(c),"AI_DAILY_LIMIT_EXCEEDED"!==(0,J.d)(d)&&l.c.error(c),!1}};return{saveError:e,setSaveError:f,dismissSaveError:()=>f(null),run:g}}],313231)}];
4
+ ${b.questionSave.databaseCode.replace("{code}",j.databaseCode)}`),e&&(i+=` (HTTP ${e})`),i}(e,b);f(c);let d=(0,J.d)(e);return"AI_DAILY_LIMIT_EXCEEDED"!==d&&"AI_CONSENT_REQUIRED"!==d&&l.c.error(c),!1}};return{saveError:e,setSaveError:f,dismissSaveError:()=>f(null),run:g}}],313231)}];
5
5
 
6
6
  //# sourceMappingURL=src_components_correction-editor_tsx_1p7z02t66tndx._.js.map