wrong-notebook 2026.11.4-2 → 2026.11.4-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (850) 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 +8 -6
  17. package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
  18. package/.next/server/app/api/admin/dashboard/route.js +16 -14
  19. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  20. package/.next/server/app/api/admin/debug-logs/export/route.js +7 -6
  21. package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
  22. package/.next/server/app/api/admin/debug-logs/route.js +6 -5
  23. package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
  24. package/.next/server/app/api/admin/migrate-tags/route.js +5 -3
  25. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  26. package/.next/server/app/api/admin/system-reset/route.js +5 -5
  27. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  28. package/.next/server/app/api/admin/users/[id]/detail/route.js +16 -14
  29. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  30. package/.next/server/app/api/admin/users/[id]/route.js +7 -5
  31. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  32. package/.next/server/app/api/admin/users/route.js +8 -7
  33. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  34. package/.next/server/app/api/ai/models/route.js +15 -14
  35. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  36. package/.next/server/app/api/ai/test/route.js +16 -13
  37. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  38. package/.next/server/app/api/analytics/route.js +15 -14
  39. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  40. package/.next/server/app/api/analyze/route.js +20 -18
  41. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  42. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  43. package/.next/server/app/api/error-items/[id]/delete/route.js +5 -5
  44. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  45. package/.next/server/app/api/error-items/[id]/figure/route.js +20 -18
  46. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  47. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +18 -16
  48. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  49. package/.next/server/app/api/error-items/[id]/geogebra/route.js +20 -17
  50. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  51. package/.next/server/app/api/error-items/[id]/image/route.js +6 -5
  52. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  53. package/.next/server/app/api/error-items/[id]/notes/route.js +8 -5
  54. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  55. package/.next/server/app/api/error-items/[id]/practice-records/route.js +5 -4
  56. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  57. package/.next/server/app/api/error-items/[id]/reanswer/route.js +18 -15
  58. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  59. package/.next/server/app/api/error-items/[id]/retag/route.js +18 -16
  60. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  61. package/.next/server/app/api/error-items/[id]/route.js +13 -9
  62. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  63. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +18 -15
  64. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
  65. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +18 -15
  66. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  67. package/.next/server/app/api/error-items/answer-space/route.js +6 -6
  68. package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -1
  69. package/.next/server/app/api/error-items/batch-delete/route.js +8 -5
  70. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  71. package/.next/server/app/api/error-items/clear/route.js +5 -5
  72. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  73. package/.next/server/app/api/error-items/export-questions/route/app-paths-manifest.json +3 -0
  74. package/.next/server/app/api/error-items/export-questions/route/build-manifest.json +12 -0
  75. package/.next/server/app/api/error-items/export-questions/route/server-reference-manifest.json +4 -0
  76. package/.next/server/app/api/error-items/export-questions/route.js +17 -0
  77. package/.next/server/app/api/error-items/export-questions/route.js.map +5 -0
  78. package/.next/server/app/api/error-items/export-questions/route.js.nft.json +1 -0
  79. package/.next/server/app/api/error-items/export-questions/route_client-reference-manifest.js +3 -0
  80. package/.next/server/app/api/error-items/list/route.js +8 -7
  81. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  82. package/.next/server/app/api/error-items/route.js +22 -21
  83. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  84. package/.next/server/app/api/error-items/short/[shortId]/route.js +5 -4
  85. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  86. package/.next/server/app/api/error-items/similarity/route.js +4 -3
  87. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  88. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +20 -18
  89. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  90. package/.next/server/app/api/exams/[id]/results/route.js +19 -18
  91. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  92. package/.next/server/app/api/exams/[id]/retry/route.js +18 -17
  93. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  94. package/.next/server/app/api/exams/[id]/route.js +21 -19
  95. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  96. package/.next/server/app/api/exams/route.js +20 -19
  97. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  98. package/.next/server/app/api/export/route.js +9 -7
  99. package/.next/server/app/api/export/route.js.nft.json +1 -1
  100. package/.next/server/app/api/geogebra-analyze/route.js +18 -16
  101. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  102. package/.next/server/app/api/health/route.js.nft.json +1 -1
  103. package/.next/server/app/api/import/route.js +22 -20
  104. package/.next/server/app/api/import/route.js.nft.json +1 -1
  105. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +25 -22
  106. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
  107. package/.next/server/app/api/import-batches/[id]/fix-text/route.js +19 -18
  108. package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
  109. package/.next/server/app/api/import-batches/[id]/read/route.js +27 -24
  110. package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
  111. package/.next/server/app/api/import-batches/[id]/retry/route.js +25 -22
  112. package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
  113. package/.next/server/app/api/import-batches/[id]/route.js +27 -24
  114. package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
  115. package/.next/server/app/api/import-batches/[id]/start/route.js +27 -24
  116. package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
  117. package/.next/server/app/api/import-batches/route.js +27 -24
  118. package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
  119. package/.next/server/app/api/import-tasks/[id]/confirm/route.js +25 -22
  120. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
  121. package/.next/server/app/api/import-tasks/[id]/read/route.js +25 -22
  122. package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
  123. package/.next/server/app/api/import-tasks/[id]/retry/route.js +25 -22
  124. package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
  125. package/.next/server/app/api/import-tasks/[id]/route.js +25 -22
  126. package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
  127. package/.next/server/app/api/import-tasks/route.js +27 -24
  128. package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
  129. package/.next/server/app/api/initialize/route.js +1 -1
  130. package/.next/server/app/api/initialize/route.js.nft.json +1 -1
  131. package/.next/server/app/api/logs/frontend/route.js +6 -4
  132. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  133. package/.next/server/app/api/minimax-code/checkin/route.js +6 -5
  134. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  135. package/.next/server/app/api/minimax-code/login/route.js +6 -5
  136. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  137. package/.next/server/app/api/minimax-code/route.js +7 -6
  138. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  139. package/.next/server/app/api/notebooks/[id]/retag/route.js +18 -17
  140. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  141. package/.next/server/app/api/notebooks/[id]/route.js +8 -4
  142. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  143. package/.next/server/app/api/notebooks/route.js +8 -6
  144. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  145. package/.next/server/app/api/openclaw/batch-upload/route.js +21 -19
  146. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  147. package/.next/server/app/api/paper-groups/[id]/route.js +5 -4
  148. package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
  149. package/.next/server/app/api/paper-groups/route.js +4 -3
  150. package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
  151. package/.next/server/app/api/practice/generate/route.js +18 -16
  152. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  153. package/.next/server/app/api/practice/grade/route.js +15 -13
  154. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  155. package/.next/server/app/api/practice/record/[id]/route.js +18 -16
  156. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  157. package/.next/server/app/api/practice/record/route.js +16 -14
  158. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  159. package/.next/server/app/api/reanswer/route.js +19 -17
  160. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  161. package/.next/server/app/api/register/route.js +5 -5
  162. package/.next/server/app/api/register/route.js.nft.json +1 -1
  163. package/.next/server/app/api/register/status/route.js +5 -5
  164. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  165. package/.next/server/app/api/requests/[id]/route.js +5 -4
  166. package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
  167. package/.next/server/app/api/review/due/route.js +17 -15
  168. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  169. package/.next/server/app/api/settings/route.js +8 -7
  170. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  171. package/.next/server/app/api/setup/route.js +7 -6
  172. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  173. package/.next/server/app/api/stats/activity/route.js +7 -6
  174. package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
  175. package/.next/server/app/api/stats/practice/clear/route.js +5 -5
  176. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  177. package/.next/server/app/api/stats/practice/route.js +7 -6
  178. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  179. package/.next/server/app/api/stats/repeated-mistakes/route.js +17 -16
  180. package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
  181. package/.next/server/app/api/stats/weak-tags/route.js +17 -16
  182. package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
  183. package/.next/server/app/api/tags/route.js +7 -4
  184. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  185. package/.next/server/app/api/tags/stats/route.js +1 -1
  186. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  187. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  188. package/.next/server/app/api/tasks/route.js +5 -4
  189. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  190. package/.next/server/app/api/tts/[id]/route.js +9 -8
  191. package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
  192. package/.next/server/app/api/tts/batch/route.js +10 -9
  193. package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
  194. package/.next/server/app/api/tts/route.js +11 -10
  195. package/.next/server/app/api/tts/route.js.nft.json +1 -1
  196. package/.next/server/app/api/tts/status/route.js +11 -10
  197. package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
  198. package/.next/server/app/api/user/route.js +16 -15
  199. package/.next/server/app/api/user/route.js.nft.json +1 -1
  200. package/.next/server/app/api/version/route.js.nft.json +1 -1
  201. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  202. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  203. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  204. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  205. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  206. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  207. package/.next/server/app/exams/page.js.nft.json +1 -1
  208. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  209. package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
  210. package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
  211. package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
  212. package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
  213. package/.next/server/app/import-tasks/page.js.nft.json +1 -1
  214. package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
  215. package/.next/server/app/initialize/page.js.nft.json +1 -1
  216. package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
  217. package/.next/server/app/login/page.js.nft.json +1 -1
  218. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  219. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  220. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  221. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  222. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  223. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  224. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  225. package/.next/server/app/page.js.nft.json +1 -1
  226. package/.next/server/app/page_client-reference-manifest.js +1 -1
  227. package/.next/server/app/practice/page.js.nft.json +1 -1
  228. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  229. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  230. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  231. package/.next/server/app/register/page.js.nft.json +1 -1
  232. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  233. package/.next/server/app/review/page.js.nft.json +1 -1
  234. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  235. package/.next/server/app/setup/page.js.nft.json +1 -1
  236. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  237. package/.next/server/app/stats/page.js.nft.json +1 -1
  238. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  239. package/.next/server/app/tags/page.js.nft.json +1 -1
  240. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  241. package/.next/server/app-paths-manifest.json +1 -0
  242. package/.next/server/chunks/1oeh_server_app_api_error-items_export-questions_route_actions_02nsquej76mp1.js +3 -0
  243. package/.next/server/chunks/[externals]__1j5vgk-wr4vpe._.js +3 -0
  244. package/.next/server/chunks/[externals]_fs_0pplqgcyv2l7l._.js +3 -0
  245. package/.next/server/chunks/[root-of-the-server]__0-d_vh1kcmw7g._.js +3 -0
  246. package/.next/server/chunks/[root-of-the-server]__001wdwos9fkgg._.js +3 -0
  247. package/.next/server/chunks/[root-of-the-server]__00cl_lnn-40t3._.js +3 -0
  248. package/.next/server/chunks/{[root-of-the-server]__05tyrbfzivoeq._.js → [root-of-the-server]__00w9qhjl8kvr4._.js} +1 -1
  249. package/.next/server/chunks/{[root-of-the-server]__01-14hxale6jz._.js → [root-of-the-server]__00w_kxg7h-9_p._.js} +1 -1
  250. package/.next/server/chunks/[root-of-the-server]__00x5ad3w5zwfp._.js +3 -0
  251. package/.next/server/chunks/{[root-of-the-server]__01rm65xnqj0z-._.js → [root-of-the-server]__01jxyfokd6l4_._.js} +1 -1
  252. package/.next/server/chunks/{[root-of-the-server]__02nbzp-n9g9_o._.js → [root-of-the-server]__025dluj5es8w4._.js} +1 -1
  253. package/.next/server/chunks/{[root-of-the-server]__09pkxauucdf_0._.js → [root-of-the-server]__02fu_lp66613e._.js} +2 -2
  254. package/.next/server/chunks/[root-of-the-server]__04w57bdna9ax0._.js +3 -0
  255. package/.next/server/chunks/{[root-of-the-server]__0z0knsep33lsx._.js → [root-of-the-server]__05a4j8yu5_bg1._.js} +2 -2
  256. package/.next/server/chunks/{[root-of-the-server]__006u92h_madgn._.js → [root-of-the-server]__05pxdy586nh8a._.js} +1 -1
  257. package/.next/server/chunks/{[root-of-the-server]__0n5l60oyv1n-1._.js → [root-of-the-server]__06i2kswg2zb80._.js} +1 -1
  258. package/.next/server/chunks/[root-of-the-server]__07i32k2sv285o._.js +3 -0
  259. package/.next/server/chunks/{[root-of-the-server]__0k4cyyyh6z6_p._.js → [root-of-the-server]__0855dkhk7zs77._.js} +2 -2
  260. package/.next/server/chunks/{[root-of-the-server]__0lqv0n5j2fg24._.js → [root-of-the-server]__08iizowhy6p3l._.js} +2 -2
  261. package/.next/server/chunks/{[root-of-the-server]__1eu_g0k_nr3i-._.js → [root-of-the-server]__094ybs6y_fmt5._.js} +2 -2
  262. package/.next/server/chunks/[root-of-the-server]__09aolocrwucnt._.js +3 -0
  263. package/.next/server/chunks/[root-of-the-server]__0_le78e9b2yno._.js +3 -0
  264. package/.next/server/chunks/[root-of-the-server]__0_uup9ppknahw._.js +3 -0
  265. package/.next/server/chunks/[root-of-the-server]__0b8rxaox_x2n1._.js +3 -0
  266. package/.next/server/chunks/[root-of-the-server]__0bvf731upd2_w._.js +3 -0
  267. package/.next/server/chunks/[root-of-the-server]__0cgpuhmu87blm._.js +3 -0
  268. package/.next/server/chunks/[root-of-the-server]__0dqy62vnjwvwp._.js +3 -0
  269. package/.next/server/chunks/{[root-of-the-server]__0bmczgpuggwki._.js → [root-of-the-server]__0ef-17j7yp2n5._.js} +1 -1
  270. package/.next/server/chunks/[root-of-the-server]__0ej9lsrmus5m4._.js +3 -0
  271. package/.next/server/chunks/[root-of-the-server]__0evv12a34qcy6._.js +27 -0
  272. package/.next/server/chunks/[root-of-the-server]__0fdkyswheen4o._.js +3 -0
  273. package/.next/server/chunks/{[root-of-the-server]__0eba9rni-2_tw._.js → [root-of-the-server]__0fhi9g3nqu6k3._.js} +1 -1
  274. package/.next/server/chunks/{[root-of-the-server]__0fx0s5_6sjw-d._.js → [root-of-the-server]__0g3w0_9__ljck._.js} +1 -1
  275. package/.next/server/chunks/[root-of-the-server]__0g848ha1gy56h._.js +3 -0
  276. package/.next/server/chunks/[root-of-the-server]__0hcbw1sliw973._.js +1 -1
  277. package/.next/server/chunks/[root-of-the-server]__0ig1r6paxqzt0._.js +3 -0
  278. package/.next/server/chunks/[root-of-the-server]__0j7ua4rsijb4c._.js +3 -0
  279. package/.next/server/chunks/[root-of-the-server]__0jh610iscvrmp._.js +3 -0
  280. package/.next/server/chunks/[root-of-the-server]__0kehix4ojdnhw._.js +1 -1
  281. package/.next/server/chunks/{[root-of-the-server]__0imuc7gi1ii-e._.js → [root-of-the-server]__0l3io0vyav4if._.js} +2 -2
  282. package/.next/server/chunks/[root-of-the-server]__0l7jho_lr2z5g._.js +3 -0
  283. package/.next/server/chunks/[root-of-the-server]__0lgbdth9-z6qg._.js +3 -0
  284. package/.next/server/chunks/[root-of-the-server]__0llbkrw8l2ib9._.js +3 -0
  285. package/.next/server/chunks/[root-of-the-server]__0mfr1ne23y4yo._.js +3 -0
  286. package/.next/server/chunks/{[root-of-the-server]__0geynfn2xmdle._.js → [root-of-the-server]__0mslax132s9jp._.js} +2 -2
  287. package/.next/server/chunks/[root-of-the-server]__0nin5p-dwlpf9._.js +3 -0
  288. package/.next/server/chunks/[root-of-the-server]__0nye-53zadylr._.js +3 -0
  289. package/.next/server/chunks/[root-of-the-server]__0p8cwd_go8pid._.js +3 -0
  290. package/.next/server/chunks/[root-of-the-server]__0pojh2d6n1kp6._.js +3 -0
  291. package/.next/server/chunks/[root-of-the-server]__0rspref34j958._.js +3 -0
  292. package/.next/server/chunks/[root-of-the-server]__0si2-m5an9zl7._.js +3 -0
  293. package/.next/server/chunks/[root-of-the-server]__0svdqovwfpro2._.js +3 -0
  294. package/.next/server/chunks/[root-of-the-server]__0tsi6_qmtro9q._.js +3 -0
  295. package/.next/server/chunks/[root-of-the-server]__0tvp4sm4zx3wt._.js +3 -0
  296. package/.next/server/chunks/[root-of-the-server]__0u1fu9dvxmlxd._.js +3 -0
  297. package/.next/server/chunks/[root-of-the-server]__0ujhx0glgcxja._.js +3 -0
  298. package/.next/server/chunks/{[root-of-the-server]__029n0r2v92pcc._.js → [root-of-the-server]__0v8mfczhz1ax1._.js} +2 -2
  299. package/.next/server/chunks/[root-of-the-server]__0vf3rgatj1f3u._.js +3 -0
  300. package/.next/server/chunks/[root-of-the-server]__0vrag-4p6eznc._.js +3 -0
  301. package/.next/server/chunks/[root-of-the-server]__0vt48u-0ebzdv._.js +3 -0
  302. package/.next/server/chunks/[root-of-the-server]__0w9f5-xtpane-._.js +3 -0
  303. package/.next/server/chunks/[root-of-the-server]__0wea836zkhvlj._.js +3 -0
  304. package/.next/server/chunks/[root-of-the-server]__0wex3czgya39o._.js +3 -0
  305. package/.next/server/chunks/[root-of-the-server]__0x8ehtaj_x2pf._.js +3 -0
  306. package/.next/server/chunks/[root-of-the-server]__0xobqdj2u2s67._.js +3 -0
  307. package/.next/server/chunks/[root-of-the-server]__0y3ui5-k9baec._.js +3 -0
  308. package/.next/server/chunks/[root-of-the-server]__0yq7jm5ja3r6t._.js +3 -0
  309. package/.next/server/chunks/[root-of-the-server]__0zrg03ldx65tk._.js +3 -0
  310. package/.next/server/chunks/[root-of-the-server]__1-1ld657rjip5._.js +3 -0
  311. package/.next/server/chunks/[root-of-the-server]__1-6r_3pmgkz13._.js +3 -0
  312. package/.next/server/chunks/[root-of-the-server]__10ngcci8pf29l._.js +3 -0
  313. package/.next/server/chunks/[root-of-the-server]__11-fk0-4iuf_k._.js +3 -0
  314. package/.next/server/chunks/[root-of-the-server]__11x5u4zg5i2c6._.js +3 -0
  315. package/.next/server/chunks/[root-of-the-server]__120o1w9mcwgta._.js +3 -0
  316. package/.next/server/chunks/[root-of-the-server]__12f6t_ozjtn42._.js +3 -0
  317. package/.next/server/chunks/[root-of-the-server]__13a3izu1xb4m4._.js +3 -0
  318. package/.next/server/chunks/{[root-of-the-server]__1kiolpvl5u4e-._.js → [root-of-the-server]__14e45mqzb1vjt._.js} +2 -2
  319. package/.next/server/chunks/[root-of-the-server]__14jf33wwjqbw1._.js +3 -0
  320. package/.next/server/chunks/[root-of-the-server]__14n0eki4tdk02._.js +3 -0
  321. package/.next/server/chunks/[root-of-the-server]__15a3t94ps7jx2._.js +3 -0
  322. package/.next/server/chunks/[root-of-the-server]__15dipxocczlvx._.js +3 -0
  323. package/.next/server/chunks/[root-of-the-server]__15r55xy6cyrg3._.js +3 -0
  324. package/.next/server/chunks/[root-of-the-server]__176zyagwjex4i._.js +3 -0
  325. package/.next/server/chunks/[root-of-the-server]__17ed9rw-rhun-._.js +3 -0
  326. package/.next/server/chunks/[root-of-the-server]__19kic_glbz32b._.js +3 -0
  327. package/.next/server/chunks/[root-of-the-server]__1ae5zzeo8_c2s._.js +3 -0
  328. package/.next/server/chunks/[root-of-the-server]__1b-acwmm5hhg0._.js +3 -0
  329. package/.next/server/chunks/[root-of-the-server]__1d6ftxzea6h0a._.js +3 -0
  330. package/.next/server/chunks/[root-of-the-server]__1dovdb1wrr_0e._.js +3 -0
  331. package/.next/server/chunks/[root-of-the-server]__1e7_e83zxstdw._.js +3 -0
  332. package/.next/server/chunks/[root-of-the-server]__1e81i8l09skcp._.js +3 -0
  333. package/.next/server/chunks/[root-of-the-server]__1e8_j43j1t1m3._.js +27 -0
  334. package/.next/server/chunks/[root-of-the-server]__1f-ve8idsq57l._.js +3 -0
  335. package/.next/server/chunks/[root-of-the-server]__1f0zocrmsd5p8._.js +3 -0
  336. package/.next/server/chunks/[root-of-the-server]__1f5_yaclxhuvj._.js +3 -0
  337. package/.next/server/chunks/[root-of-the-server]__1gf_vv57qtjh0._.js +3 -0
  338. package/.next/server/chunks/[root-of-the-server]__1h0tye6lfskvl._.js +3 -0
  339. package/.next/server/chunks/[root-of-the-server]__1hn69stngi4kc._.js +3 -0
  340. package/.next/server/chunks/[root-of-the-server]__1hnyj47zdzrxo._.js +3 -0
  341. package/.next/server/chunks/[root-of-the-server]__1k0fuhrt1iiad._.js +3 -0
  342. package/.next/server/chunks/[root-of-the-server]__1kxecl8v-_px5._.js +3 -0
  343. package/.next/server/chunks/[root-of-the-server]__1l6v9x8xm11pl._.js +3 -0
  344. package/.next/server/chunks/[root-of-the-server]__1m8m5io-tr21e._.js +3 -0
  345. package/.next/server/chunks/[root-of-the-server]__1pfhgjwnx_--j._.js +3 -0
  346. package/.next/server/chunks/[root-of-the-server]__1r5lj-ffov9r0._.js +3 -0
  347. package/.next/server/chunks/[root-of-the-server]__1rxi33p9h8zrj._.js +3 -0
  348. package/.next/server/chunks/[root-of-the-server]__1uqnotrppylmw._.js +3 -0
  349. package/.next/server/chunks/[root-of-the-server]__1utvl-1o6mb8y._.js +3 -0
  350. package/.next/server/chunks/[root-of-the-server]__1vc89u7_xxhyf._.js +3 -0
  351. package/.next/server/chunks/[root-of-the-server]__1x_kq-6h3utmo._.js +3 -0
  352. package/.next/server/chunks/[root-of-the-server]__1xqcu4ft3d7id._.js +3 -0
  353. package/.next/server/chunks/[root-of-the-server]__1xuw793xxu29t._.js +3 -0
  354. package/.next/server/chunks/[root-of-the-server]__1yaf9vp_o6cro._.js +3 -0
  355. package/.next/server/chunks/[root-of-the-server]__1ybmwcbaqk63j._.js +3 -0
  356. package/.next/server/chunks/[root-of-the-server]__1yyezurgy7e3k._.js +3 -0
  357. package/.next/server/chunks/[root-of-the-server]__1z4-5hlzq34fw._.js +3 -0
  358. package/.next/server/chunks/[root-of-the-server]__1z9hl9qdokxpu._.js +3 -0
  359. package/.next/server/chunks/_0-ne-bwuvd_6w._.js +1 -1
  360. package/.next/server/chunks/_011-ll5i30j2e._.js +1 -1
  361. package/.next/server/chunks/_01bayc6kg7upi._.js +1 -1
  362. package/.next/server/chunks/_029zt0rilrwvt._.js +1 -1
  363. package/.next/server/chunks/_03ovgh1-4xf3f._.js +1 -1
  364. package/.next/server/chunks/_0431fxnqiloso._.js +1 -1
  365. package/.next/server/chunks/_04vbgvl2gl5bc._.js +3 -0
  366. package/.next/server/chunks/_055vhdh_7iydn._.js +3 -0
  367. package/.next/server/chunks/_05ans30vcd4s-._.js +1 -1
  368. package/.next/server/chunks/{_04rjm4ctjqrba._.js → _06pseal2zu-71._.js} +2 -2
  369. package/.next/server/chunks/_076-jjzrfdsdk._.js +1 -1
  370. package/.next/server/chunks/_07amw8ha9rney._.js +1 -1
  371. package/.next/server/chunks/{_1fki7pamd4s-7._.js → _087uva8dkvxwz._.js} +2 -2
  372. package/.next/server/chunks/_08i9pskmlafnp._.js +1 -1
  373. package/.next/server/chunks/_09o9zamz75n5d._.js +1 -1
  374. package/.next/server/chunks/_0_3_65z6ak-5i._.js +1 -1
  375. package/.next/server/chunks/_0_5s2mrhxb3-u._.js +3 -0
  376. package/.next/server/chunks/_0_e736ff6uhew._.js +1 -1
  377. package/.next/server/chunks/_0anbzuivml30d._.js +1 -1
  378. package/.next/server/chunks/{_0edfmbz_jbxsu._.js → _0b9gke5b17vzh._.js} +2 -2
  379. package/.next/server/chunks/_0d66myj_8567o._.js +1 -1
  380. package/.next/server/chunks/_0gxi3zrkhyvx_._.js +1 -1
  381. package/.next/server/chunks/_0h1rbua_hqkox._.js +1 -1
  382. package/.next/server/chunks/_0hk9z9rqga4x-._.js +1 -1
  383. package/.next/server/chunks/_0i58-g30ox5-8._.js +3 -0
  384. package/.next/server/chunks/_0kjatc7pcrkvz._.js +1 -1
  385. package/.next/server/chunks/_0kreo-8xn80hb._.js +1 -1
  386. package/.next/server/chunks/_0l2j3br2g32zp._.js +1 -1
  387. package/.next/server/chunks/_0lepv-j_r8kfv._.js +3 -0
  388. package/.next/server/chunks/_0lmh33cdt_1fr._.js +1 -1
  389. package/.next/server/chunks/_0lob14xk0ko5z._.js +1 -1
  390. package/.next/server/chunks/_0mt2ctbvzfero._.js +1 -1
  391. package/.next/server/chunks/_0numcpxd_n25x._.js +3 -0
  392. package/.next/server/chunks/_0p-sas2zxy3iv._.js +1 -1
  393. package/.next/server/chunks/_0po48rvqz03dg._.js +1 -1
  394. package/.next/server/chunks/_0pzdohc1mz5ts._.js +1 -1
  395. package/.next/server/chunks/_0qaoat396e0_3._.js +1 -1
  396. package/.next/server/chunks/_0r8u30vd4lix4._.js +3 -0
  397. package/.next/server/chunks/_0r9ejvgz0l0-0._.js +1 -1
  398. package/.next/server/chunks/_0s8v0xiwcw6od._.js +3 -0
  399. package/.next/server/chunks/_0suqhfy3e5sv6._.js +1 -1
  400. package/.next/server/chunks/_0ta62b-tktnk8._.js +3 -0
  401. package/.next/server/chunks/{_03dn7v_h3d-v8._.js → _0tkov27xr068i._.js} +11 -7
  402. package/.next/server/chunks/_0tl0cy5j96d7h._.js +1 -1
  403. package/.next/server/chunks/_0tz5wpjdgntj3._.js +1 -1
  404. package/.next/server/chunks/_0wegi_sv1s4wx._.js +1 -1
  405. package/.next/server/chunks/_0xv7-7d6dyo9-._.js +1 -1
  406. package/.next/server/chunks/_0xx4y9tk1qclc._.js +1 -1
  407. package/.next/server/chunks/_0zs7jfzzshbfq._.js +1 -1
  408. package/.next/server/chunks/_11w6ynlxuzl55._.js +1 -1
  409. package/.next/server/chunks/_12fz_vwm9jemi._.js +3 -0
  410. package/.next/server/chunks/_12i51zlq-xxrl._.js +1 -1
  411. package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
  412. package/.next/server/chunks/_12xi_xqvtrn3k._.js +3 -0
  413. package/.next/server/chunks/_13ffmxv8qrwi0._.js +1 -1
  414. package/.next/server/chunks/_14w9nrdlajz24._.js +1 -1
  415. package/.next/server/chunks/_15fpgekhvv214._.js +1 -1
  416. package/.next/server/chunks/{_043-r529chcri._.js → _1638xaazsmf2m._.js} +11 -7
  417. package/.next/server/chunks/_1647rfjflw_iq._.js +1 -1
  418. package/.next/server/chunks/_16jdov0rxh99d._.js +1 -1
  419. package/.next/server/chunks/_17zw8m241gfs3._.js +1 -1
  420. package/.next/server/chunks/_18amra5328v90._.js +1 -1
  421. package/.next/server/chunks/_18hm5aaxkr500._.js +1 -1
  422. package/.next/server/chunks/_1_273cgnpyl9j._.js +1 -1
  423. package/.next/server/chunks/_1a1aqmie1d3u_._.js +1 -1
  424. package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
  425. package/.next/server/chunks/_1ab7h8-how0le._.js +3 -0
  426. package/.next/server/chunks/_1ahi8466v1b3l._.js +1 -1
  427. package/.next/server/chunks/_1almac7c09mp4._.js +3 -0
  428. package/.next/server/chunks/_1b-7g4thtxfnp._.js +3 -0
  429. package/.next/server/chunks/_1b0269xt-c8f7._.js +1 -1
  430. package/.next/server/chunks/_1b7qjlv0nxovi._.js +1 -1
  431. package/.next/server/chunks/_1be-y660a8z-q._.js +1 -1
  432. package/.next/server/chunks/_1cydcmia78z15._.js +1 -1
  433. package/.next/server/chunks/_1e8w9uuebtrcb._.js +1 -1
  434. package/.next/server/chunks/_1ev3hw7jrpp8r._.js +3 -0
  435. package/.next/server/chunks/_1gdet1v2zk2gy._.js +1 -1
  436. package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
  437. package/.next/server/chunks/_1hp9mnz19v199._.js +1 -1
  438. package/.next/server/chunks/_1j10upti9l6da._.js +1 -1
  439. package/.next/server/chunks/_1j8kqz21_i728._.js +1 -1
  440. package/.next/server/chunks/_1lesklvhr_pfq._.js +3 -0
  441. package/.next/server/chunks/_1muwmr6j76v3m._.js +1 -1
  442. package/.next/server/chunks/_1pvqo-qnv-nqm._.js +1 -1
  443. package/.next/server/chunks/_1q65ai1_dwgjp._.js +1 -1
  444. package/.next/server/chunks/_1qcv4muwnx82-._.js +3 -0
  445. package/.next/server/chunks/_1s5-ldt8xhtpp._.js +1 -1
  446. package/.next/server/chunks/_1s55l1bx-1cxp._.js +1 -1
  447. package/.next/server/chunks/_1sp0xk1c5jx5r._.js +1 -1
  448. package/.next/server/chunks/_1srq5kxah38r6._.js +1 -1
  449. package/.next/server/chunks/_1t632kndbc0tj._.js +3 -0
  450. package/.next/server/chunks/_1tahh9ric8la3._.js +1 -1
  451. package/.next/server/chunks/_1tvl0cm629nyc._.js +1 -1
  452. package/.next/server/chunks/_1u6r2cuueltfn._.js +3 -0
  453. package/.next/server/chunks/{_1-6i59jd1zhly._.js → _1vddun9dxzaqo._.js} +11 -7
  454. package/.next/server/chunks/_1xpj9uk-9zhl8._.js +1 -1
  455. package/.next/server/chunks/_1xx5l4x084brt._.js +3 -0
  456. package/.next/server/chunks/_1z_ujac_e_65s._.js +1 -1
  457. package/.next/server/chunks/_1zbkha-v5mkk0._.js +3 -0
  458. package/.next/server/chunks/_1zvf_gki7-g0n._.js +1 -1
  459. package/.next/server/chunks/{_0r0hnbjdq-k9-._.js → _20snsd6f1xc63._.js} +2 -2
  460. package/.next/server/chunks/_20tjujotvor53._.js +1 -1
  461. package/.next/server/chunks/node_modules_zod_v4_classic_external_0qoqh-q5drsgn.js +4 -4
  462. package/.next/server/chunks/node_modules_zod_v4_classic_external_14kwlambv9opd.js +3 -0
  463. package/.next/server/chunks/node_modules_zod_v4_classic_external_17gmk506tz413.js +3 -0
  464. package/.next/server/chunks/node_modules_zod_v4_classic_external_1b_q1zc0x8d76.js +3 -0
  465. package/.next/server/chunks/node_modules_zod_v4_classic_external_1exeae-p81c94.js +3 -0
  466. package/.next/server/chunks/node_modules_zod_v4_classic_external_1giv406od1whf.js +3 -0
  467. package/.next/server/chunks/node_modules_zod_v4_classic_external_1wq100x5o7-hi.js +3 -0
  468. package/.next/server/chunks/node_modules_zod_v4_classic_external_1x8fhte3frhrw.js +3 -0
  469. package/.next/server/chunks/src_lib_0dxltm34zaclb._.js +3 -0
  470. package/.next/server/chunks/src_lib_0g4wu08m-gibu._.js +3 -0
  471. package/.next/server/chunks/src_lib_0l0j89xrerf8m._.js +3 -0
  472. package/.next/server/chunks/src_lib_0osgsup3n2ypg._.js +3 -0
  473. package/.next/server/chunks/src_lib_0so-2topfosjo._.js +3 -0
  474. package/.next/server/chunks/src_lib_0whd_w99i5vmm._.js +3 -0
  475. package/.next/server/chunks/src_lib_0z4je8wchtdws._.js +3 -0
  476. package/.next/server/chunks/src_lib_0zeksho3data7._.js +3 -0
  477. package/.next/server/chunks/src_lib_15op6xa369-51._.js +3 -0
  478. package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +143 -131
  479. package/.next/server/chunks/src_lib_1d0nldjpxxl8t._.js +3 -0
  480. package/.next/server/chunks/src_lib_1d99xj4d-pofa._.js +3 -0
  481. package/.next/server/chunks/src_lib_1v7rk87xys5cb._.js +3 -0
  482. package/.next/server/chunks/src_lib_1w0niu4i8hnaq._.js +3 -0
  483. package/.next/server/chunks/src_lib_ai_index_ts_0m0hlq4d9zy9i._.js +1 -1
  484. package/.next/server/chunks/src_lib_exam_1vzmn90_kh7eg._.js +3 -0
  485. package/.next/server/chunks/src_lib_exam_exam_ts_18c3t7bnr1z5k._.js +3 -0
  486. package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +5 -0
  487. package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +3 -0
  488. package/.next/server/chunks/src_lib_mastery-status_ts_0e9jnp-14tby5._.js +3 -0
  489. package/.next/server/chunks/src_lib_minimax-code_checkin_ts_1j1mpuxc1vgoz._.js +1 -1
  490. package/.next/server/chunks/src_lib_notebook-scope_ts_06eipvr6xztlf._.js +3 -0
  491. package/.next/server/chunks/src_lib_question_0uw17e6at-i_h._.js +3 -0
  492. package/.next/server/chunks/src_lib_question_question-analysis_ts_1-3x2cfxlr3fs._.js +3 -0
  493. package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +3 -0
  494. package/.next/server/chunks/src_lib_recoverable-response_ts_00y54idhlj_0e._.js +3 -0
  495. package/.next/server/chunks/src_lib_schemas_error-items_ts_0vdof4417rd3y._.js +3 -0
  496. package/.next/server/chunks/src_lib_short-id_0adg7-htn2dq_._.js +3 -0
  497. package/.next/server/chunks/src_lib_svg-animation_ts_0-noskwg6sysg._.js +3 -0
  498. package/.next/server/chunks/src_lib_tags_retag_ts_09s5xwrzcy144._.js +3 -0
  499. package/.next/server/chunks/src_lib_tags_seed_1_ej3w-2450a0._.js +3 -0
  500. package/.next/server/chunks/src_lib_tts_19zri-v8-l_4u._.js +1 -1
  501. package/.next/server/chunks/ssr/[root-of-the-server]__032-uso7x2eqk._.js +3 -0
  502. package/.next/server/chunks/ssr/[root-of-the-server]__0ks-9bza_y-tn._.js +3 -0
  503. package/.next/server/chunks/ssr/[root-of-the-server]__0te5kr0_7nmrv._.js +3 -0
  504. package/.next/server/chunks/ssr/[root-of-the-server]__0uezowk-9l0x4._.js +3 -0
  505. package/.next/server/chunks/ssr/[root-of-the-server]__0x4us8rfvt68s._.js +3 -0
  506. package/.next/server/chunks/ssr/{[root-of-the-server]__0mqo18mv_ooyq._.js → [root-of-the-server]__0xjcdrflb40xr._.js} +2 -2
  507. package/.next/server/chunks/ssr/{[root-of-the-server]__0x_ihemma9171._.js → [root-of-the-server]__0z7upqzuqtse6._.js} +2 -2
  508. package/.next/server/chunks/ssr/[root-of-the-server]__10y8dor72926b._.js +3 -0
  509. package/.next/server/chunks/ssr/[root-of-the-server]__12jk2bmesr4gc._.js +3 -0
  510. package/.next/server/chunks/ssr/[root-of-the-server]__1rrcp_77jpv98._.js +3 -0
  511. package/.next/server/chunks/ssr/_05k02824g2tpo._.js +3 -0
  512. package/.next/server/chunks/ssr/_0cmd1ubdlo_by._.js +1 -1
  513. package/.next/server/chunks/ssr/_0fp_p60hb9ex8._.js +3 -0
  514. package/.next/server/chunks/ssr/_0gsk7ce3mjc-h._.js +3 -0
  515. package/.next/server/chunks/ssr/_0haie2cnycj6w._.js +32 -0
  516. package/.next/server/chunks/ssr/{_01qu892bisrf0._.js → _0j-r3zhz2ucmg._.js} +2 -2
  517. package/.next/server/chunks/ssr/_0m1jjbrzk71io._.js +3 -0
  518. package/.next/server/chunks/ssr/_0mvuvawj5-r--._.js +1 -1
  519. package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
  520. package/.next/server/chunks/ssr/_0xlbgtld9_r3o._.js +3 -0
  521. package/.next/server/chunks/ssr/{_186fwf-hcr_ua._.js → _101w__e2w9gr0._.js} +2 -2
  522. package/.next/server/chunks/ssr/_126p5i1ynlykc._.js +3 -0
  523. package/.next/server/chunks/ssr/_127aw5h992s9d._.js +4 -0
  524. package/.next/server/chunks/ssr/_19hxsrrruepym._.js +1 -1
  525. package/.next/server/chunks/ssr/_1bhvzfiuz3s7j._.js +3 -0
  526. package/.next/server/chunks/ssr/_1d3pxsso6zv_w._.js +3 -0
  527. package/.next/server/chunks/ssr/_1hp3fw-gk2r-3._.js +3 -0
  528. package/.next/server/chunks/ssr/_1k45xb7mu-emd._.js +3 -0
  529. package/.next/server/chunks/ssr/_1lltqgoq4vqfe._.js +3 -0
  530. package/.next/server/chunks/ssr/_1ore70w45768b._.js +3 -0
  531. package/.next/server/chunks/ssr/{_1xv0q8o3g3r5d._.js → _1s3gqrczubor-._.js} +2 -2
  532. package/.next/server/chunks/ssr/_1t-o815u40ng2._.js +3 -0
  533. package/.next/server/chunks/ssr/{_1pdnzaad7hk0d._.js → _1x_zn17exkc4t._.js} +2 -2
  534. package/.next/server/chunks/ssr/_1yclgq1umgl4p._.js +4 -0
  535. package/.next/server/chunks/ssr/node_modules_08vtqzu_wfcb5._.js +3 -0
  536. package/.next/server/chunks/ssr/node_modules_0y-9u3ez_29oz._.js +3 -0
  537. package/.next/server/chunks/ssr/node_modules_109z-y1z_gtxg._.js +3 -0
  538. package/.next/server/chunks/ssr/node_modules_docx_dist_index_mjs_07znba89yz2vi._.js +3 -0
  539. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_0byqh-lbfcigr.js → node_modules_heic-to_dist_csp_heic-to_1_jdv4y0yz52i.js} +1 -1
  540. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_19_dv9gdzg_e7.js → node_modules_heic-to_dist_csp_heic-to_1zqrtb3kykd7q.js} +1 -1
  541. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_printer_mjs_0jbt269gi19_7._.js +3 -0
  542. package/.next/server/chunks/ssr/node_modules_pdfjs-dist_build_pdf_mjs_0z37jkkqfce7_._.js +47 -0
  543. package/.next/server/chunks/ssr/node_modules_read-excel-file_universal_index_0ayslfrutmja5.js +3 -0
  544. package/.next/server/chunks/ssr/node_modules_write-excel-file_browser_index_0l2-di6rcng1b.js +3 -0
  545. package/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_0veaboc415l0m.js +3 -3
  546. package/.next/server/chunks/ssr/src_0_qzoo_03n_v-._.js +3 -0
  547. package/.next/server/chunks/ssr/src_130ww76krpws_._.js +1 -1
  548. package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
  549. package/.next/server/chunks/ssr/src_1nbi4yrww3r1m._.js +3 -0
  550. package/.next/server/chunks/ssr/{src_1jhctayt9gxoc._.js → src_1o5f_wr8vv-x0._.js} +2 -2
  551. package/.next/server/chunks/ssr/src_1rmus42s388dk._.js +3 -0
  552. package/.next/server/chunks/ssr/src_1seqsa8jiwu83._.js +3 -0
  553. package/.next/server/chunks/ssr/src_1xvnkkhvub372._.js +1 -1
  554. package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
  555. package/.next/server/chunks/ssr/src_app_exams_[id]_page_tsx_0xcjflkgkwzgd._.js +1 -1
  556. package/.next/server/chunks/ssr/src_app_exams_[id]_print_page_tsx_1i-xvhk8ul1l1._.js +11 -6
  557. package/.next/server/chunks/ssr/src_app_exams_page_tsx_17_d4_gy2i1ds._.js +1 -1
  558. package/.next/server/chunks/ssr/src_app_import-batches_[id]_page_tsx_0mhg_vriwmkkw._.js +1 -1
  559. package/.next/server/chunks/ssr/src_app_import-tasks_[id]_page_tsx_0_grj11-jdqqc._.js +1 -1
  560. package/.next/server/chunks/ssr/src_app_import-tasks_page_tsx_01983hytm-x08._.js +1 -1
  561. package/.next/server/chunks/ssr/src_app_notebooks_[id]_add_page_tsx_179tow1ql6vc_._.js +1 -1
  562. package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
  563. package/.next/server/chunks/ssr/src_app_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
  564. package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +6 -1
  565. package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
  566. package/.next/server/chunks/ssr/src_components_correction-editor_tsx_1p7z02t66tndx._.js +3 -3
  567. package/.next/server/chunks/ssr/src_components_error-list_error-item-card_tsx_1zsiqsrj-jjd7._.js +1 -1
  568. package/.next/server/chunks/ssr/src_components_exam_exam-figure-scale-bar_tsx_1dxk6lzvp_d28._.js +1 -1
  569. package/.next/server/chunks/ssr/src_components_import-tasks_import-task-card_tsx_01r47qh8ryspb._.js +1 -1
  570. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +15 -10
  571. package/.next/server/chunks/ssr/src_components_ui_switch_tsx_054tyo61pehla._.js +3 -0
  572. package/.next/server/chunks/ssr/src_lib_0773v8b5gb93o._.js +9 -0
  573. package/.next/server/chunks/ssr/src_lib_1qhs590-z9xnh._.js +9 -0
  574. package/.next/server/chunks/ssr/src_lib_1z8akixo3j8ti._.js +9 -0
  575. package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
  576. package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +3 -0
  577. package/.next/server/chunks/ssr/src_lib_short-id_short-id-client_ts_03nnd3s0tat3l._.js +3 -0
  578. package/.next/server/middleware-build-manifest.js +3 -3
  579. package/.next/server/pages/500.html +1 -1
  580. package/.next/static/chunks/01zokrwums-fz.js +55 -0
  581. package/.next/static/chunks/{1pdlii0oox0-7.js → 037g92rz3qjm_.js} +1 -1
  582. package/.next/static/chunks/040et8v6_v-s6.js +1 -0
  583. package/.next/static/chunks/{2cfz0fumc6ghe.js → 045cs_rolnmjd.js} +1 -1
  584. package/.next/static/chunks/079f88y9j6sf-.js +45 -0
  585. package/.next/static/chunks/0g1lk2opoyqly.js +1 -0
  586. package/.next/static/chunks/0ge9zqd21b4xd.js +15 -0
  587. package/.next/static/chunks/0gu34v572tj7o.js +1 -0
  588. package/.next/static/chunks/0mnb66hvp3czv.js +2 -0
  589. package/.next/static/chunks/0mun2h4uaj4eh.js +1 -0
  590. package/.next/static/chunks/{02wft51kf3t9f.js → 0ovv_fq59i4y4.js} +1 -1
  591. package/.next/static/chunks/0sl4wa-ghh5g7.js +2 -0
  592. package/.next/static/chunks/0xbohpfp7x9jn.js +1 -0
  593. package/.next/static/chunks/{31-r0kqqw-wfd.js → 0xwz3h9d_e7kb.js} +1 -1
  594. package/.next/static/chunks/{0_xcjg47jv3ur.js → 1-qu_z3i5b8ul.js} +1 -1
  595. package/.next/static/chunks/10hk15u8jc7o1.js +38 -0
  596. package/.next/static/chunks/113lhm-f9le_y.js +2 -0
  597. package/.next/static/chunks/{42rupczfyygo1.js → 15zro21ycjjle.js} +1 -1
  598. package/.next/static/chunks/{3difxy8vzqlxn.js → 1fmrzsulv-ddd.js} +1 -1
  599. package/.next/static/chunks/{3fh32b9da9l_5.js → 1k2m_f0nu22fb.js} +1 -1
  600. package/.next/static/chunks/1uso50ewx5j8v.js +1 -0
  601. package/.next/static/chunks/1vtq_er8xir3c.css +3 -0
  602. package/.next/static/chunks/1y0cjudvnz4la.js +6 -0
  603. package/.next/static/chunks/20f7m1txoey_w.js +1 -0
  604. package/.next/static/chunks/21ghhv1twe4or.js +12 -0
  605. package/.next/static/chunks/23h8i_poncr7i.js +1 -0
  606. package/.next/static/chunks/28bc-wd48lcls.js +1 -0
  607. package/.next/static/chunks/2acga0__tn9yl.js +1 -0
  608. package/.next/static/chunks/2j3bisradcgfv.js +1 -0
  609. package/.next/static/chunks/2lhxk-8dpncxq.js +1 -0
  610. package/.next/static/chunks/2xww3vrggzkc3.js +15 -0
  611. package/.next/static/chunks/3-5otbeiq86n5.js +1 -0
  612. package/.next/static/chunks/31uxxyexyu66p.js +198 -0
  613. package/.next/static/chunks/33z7oz1790x50.js +1 -0
  614. package/.next/static/chunks/37309r9ttt-oa.js +1 -0
  615. package/.next/static/chunks/3_w-p8241f5rv.js +1 -0
  616. package/.next/static/chunks/{1uaqnxl-xshw6.js → 3f9t8cne6yfyl.js} +1 -1
  617. package/.next/static/chunks/{3wch6vphcivq5.js → 3j92h-4k4_o_f.js} +1 -1
  618. package/.next/static/chunks/3jkntcd5fwsid.js +1 -0
  619. package/.next/static/chunks/3ldaxwwj8i1r_.js +9 -0
  620. package/.next/static/chunks/3nq-bgq8lumv9.js +1 -0
  621. package/.next/static/chunks/{4441xuc3i-yb7.js → 3rnbnqcge4lza.js} +1 -1
  622. package/.next/static/chunks/3t9tbm4atwmw8.js +1 -0
  623. package/.next/static/chunks/3u-qpv02dkpmu.js +1 -0
  624. package/.next/static/chunks/438pvifm_o4g_.js +1 -0
  625. package/.next/static/media/pdf.worker.min.0zcq5mj7t-qsr.mjs +28 -0
  626. package/dist-scripts/scripts/rebuild-system-tags.js +11 -107
  627. package/dist-scripts/scripts/seed-chinese-primary.js +1 -1
  628. package/dist-scripts/src/lib/logger.js +1 -0
  629. package/dist-scripts/src/lib/tags/seed/rebuild.js +103 -0
  630. package/dist-scripts/src/lib/{seed-chinese-tags.js → tags/seed/seed-chinese-tags.js} +2 -1
  631. package/package.json +1 -1
  632. package/prisma/migrations/20261104033404_add_question_type/migration.sql +2 -0
  633. package/prisma/migrations/20261104040208_exam_question_score/migration.sql +2 -0
  634. package/prisma/migrations/20261104044246_exam_group_by_question_type/migration.sql +29 -0
  635. package/prisma/schema.prisma +7 -0
  636. package/prisma/seed.db +0 -0
  637. package/.next/server/chunks/[root-of-the-server]__012pau7crikop._.js +0 -3
  638. package/.next/server/chunks/[root-of-the-server]__01jc87mm42cex._.js +0 -3
  639. package/.next/server/chunks/[root-of-the-server]__01newhoirvvb2._.js +0 -3
  640. package/.next/server/chunks/[root-of-the-server]__02oqd6w58wymi._.js +0 -3
  641. package/.next/server/chunks/[root-of-the-server]__057qz9ucs7lib._.js +0 -3
  642. package/.next/server/chunks/[root-of-the-server]__06_pvs6rg70ri._.js +0 -3
  643. package/.next/server/chunks/[root-of-the-server]__06jad9cnzeci-._.js +0 -3
  644. package/.next/server/chunks/[root-of-the-server]__0_uvtfu0yr-na._.js +0 -27
  645. package/.next/server/chunks/[root-of-the-server]__0_vinl1oembls._.js +0 -3
  646. package/.next/server/chunks/[root-of-the-server]__0ahni9caaouya._.js +0 -3
  647. package/.next/server/chunks/[root-of-the-server]__0aq01totjzgkp._.js +0 -3
  648. package/.next/server/chunks/[root-of-the-server]__0b5mh_vi6e246._.js +0 -3
  649. package/.next/server/chunks/[root-of-the-server]__0b5qyqwq6mk5v._.js +0 -3
  650. package/.next/server/chunks/[root-of-the-server]__0b79cd6lae7ep._.js +0 -3
  651. package/.next/server/chunks/[root-of-the-server]__0b_zf20owrv7l._.js +0 -3
  652. package/.next/server/chunks/[root-of-the-server]__0cel4yig3zcho._.js +0 -3
  653. package/.next/server/chunks/[root-of-the-server]__0cu5jz9b3f0i1._.js +0 -3
  654. package/.next/server/chunks/[root-of-the-server]__0d818ux928r5h._.js +0 -3
  655. package/.next/server/chunks/[root-of-the-server]__0dclcdg0hwxxj._.js +0 -3
  656. package/.next/server/chunks/[root-of-the-server]__0e13o3ny66zb3._.js +0 -3
  657. package/.next/server/chunks/[root-of-the-server]__0fg20m1i6x4y9._.js +0 -3
  658. package/.next/server/chunks/[root-of-the-server]__0fhy87hr0_glw._.js +0 -3
  659. package/.next/server/chunks/[root-of-the-server]__0fnte1x8xdn5o._.js +0 -3
  660. package/.next/server/chunks/[root-of-the-server]__0glupa52ge074._.js +0 -3
  661. package/.next/server/chunks/[root-of-the-server]__0gphporvvjc0d._.js +0 -3
  662. package/.next/server/chunks/[root-of-the-server]__0gs7-3gi0pdws._.js +0 -3
  663. package/.next/server/chunks/[root-of-the-server]__0i2mt6zjxbq--._.js +0 -3
  664. package/.next/server/chunks/[root-of-the-server]__0ijq_d0gr5zo8._.js +0 -3
  665. package/.next/server/chunks/[root-of-the-server]__0iqp1f0-yvbhw._.js +0 -3
  666. package/.next/server/chunks/[root-of-the-server]__0jk-9m6ra-_um._.js +0 -3
  667. package/.next/server/chunks/[root-of-the-server]__0jvusk64khb-a._.js +0 -3
  668. package/.next/server/chunks/[root-of-the-server]__0k0c90ih7n0te._.js +0 -3
  669. package/.next/server/chunks/[root-of-the-server]__0maxg52nxqrzi._.js +0 -3
  670. package/.next/server/chunks/[root-of-the-server]__0ml-m3il4unb6._.js +0 -3
  671. package/.next/server/chunks/[root-of-the-server]__0nkrql6or-tf_._.js +0 -3
  672. package/.next/server/chunks/[root-of-the-server]__0nujsu6qbn-8o._.js +0 -27
  673. package/.next/server/chunks/[root-of-the-server]__0ovdiut1h8kkt._.js +0 -3
  674. package/.next/server/chunks/[root-of-the-server]__0p5_lv_pjxr5f._.js +0 -3
  675. package/.next/server/chunks/[root-of-the-server]__0p8wlug4uvmvi._.js +0 -3
  676. package/.next/server/chunks/[root-of-the-server]__0ptn9j1rleieh._.js +0 -3
  677. package/.next/server/chunks/[root-of-the-server]__0r7f34_38kmvk._.js +0 -3
  678. package/.next/server/chunks/[root-of-the-server]__0u3m78xhq8b3l._.js +0 -3
  679. package/.next/server/chunks/[root-of-the-server]__0ualui9b50ufh._.js +0 -3
  680. package/.next/server/chunks/[root-of-the-server]__0ujfft7untkmq._.js +0 -3
  681. package/.next/server/chunks/[root-of-the-server]__0vw7u-y__gk7p._.js +0 -3
  682. package/.next/server/chunks/[root-of-the-server]__0w53aflmo1keg._.js +0 -3
  683. package/.next/server/chunks/[root-of-the-server]__0wdjzoxwwh6bn._.js +0 -3
  684. package/.next/server/chunks/[root-of-the-server]__0wx65sza19ou-._.js +0 -3
  685. package/.next/server/chunks/[root-of-the-server]__0xj_313186tqc._.js +0 -3
  686. package/.next/server/chunks/[root-of-the-server]__0yv_kznxz5qzn._.js +0 -3
  687. package/.next/server/chunks/[root-of-the-server]__0zldj8zxo-hvc._.js +0 -3
  688. package/.next/server/chunks/[root-of-the-server]__1-djdd7tnb-n7._.js +0 -3
  689. package/.next/server/chunks/[root-of-the-server]__109pj952qxtan._.js +0 -3
  690. package/.next/server/chunks/[root-of-the-server]__10gp75p89v9a2._.js +0 -3
  691. package/.next/server/chunks/[root-of-the-server]__111jxitdjhuoj._.js +0 -3
  692. package/.next/server/chunks/[root-of-the-server]__112w8xm57okk5._.js +0 -3
  693. package/.next/server/chunks/[root-of-the-server]__12h4ckd6f76pb._.js +0 -3
  694. package/.next/server/chunks/[root-of-the-server]__12ig6-5hpb7s-._.js +0 -3
  695. package/.next/server/chunks/[root-of-the-server]__13_k7w8nrx7ie._.js +0 -3
  696. package/.next/server/chunks/[root-of-the-server]__14c50fhuh_abo._.js +0 -3
  697. package/.next/server/chunks/[root-of-the-server]__14jpfgwnpc9gl._.js +0 -3
  698. package/.next/server/chunks/[root-of-the-server]__14m8fewwq1xs6._.js +0 -3
  699. package/.next/server/chunks/[root-of-the-server]__15qkqztuygnfg._.js +0 -3
  700. package/.next/server/chunks/[root-of-the-server]__166997w1su5wq._.js +0 -3
  701. package/.next/server/chunks/[root-of-the-server]__16xl11-irmhu3._.js +0 -3
  702. package/.next/server/chunks/[root-of-the-server]__19i64i9v32y8o._.js +0 -3
  703. package/.next/server/chunks/[root-of-the-server]__19jqc7tzna13p._.js +0 -3
  704. package/.next/server/chunks/[root-of-the-server]__1asgy7sah0mo6._.js +0 -3
  705. package/.next/server/chunks/[root-of-the-server]__1av1l48rnghpa._.js +0 -3
  706. package/.next/server/chunks/[root-of-the-server]__1azaa45m60iqm._.js +0 -3
  707. package/.next/server/chunks/[root-of-the-server]__1d159cxbdta68._.js +0 -3
  708. package/.next/server/chunks/[root-of-the-server]__1dmp3ynxbcyjz._.js +0 -3
  709. package/.next/server/chunks/[root-of-the-server]__1dom1le7wqh7d._.js +0 -3
  710. package/.next/server/chunks/[root-of-the-server]__1e5tjfwab0exu._.js +0 -3
  711. package/.next/server/chunks/[root-of-the-server]__1f-7-l2abs15s._.js +0 -3
  712. package/.next/server/chunks/[root-of-the-server]__1fe2v2mv5-rgo._.js +0 -3
  713. package/.next/server/chunks/[root-of-the-server]__1fepss7g57apj._.js +0 -3
  714. package/.next/server/chunks/[root-of-the-server]__1ff3h7ockrpdf._.js +0 -3
  715. package/.next/server/chunks/[root-of-the-server]__1g11271g0z55n._.js +0 -3
  716. package/.next/server/chunks/[root-of-the-server]__1g6jrwm72xr8a._.js +0 -3
  717. package/.next/server/chunks/[root-of-the-server]__1he8kk4382-0h._.js +0 -3
  718. package/.next/server/chunks/[root-of-the-server]__1hk5kgctlp2wn._.js +0 -3
  719. package/.next/server/chunks/[root-of-the-server]__1j44_t992y-1-._.js +0 -3
  720. package/.next/server/chunks/[root-of-the-server]__1k4f33-z95_7c._.js +0 -3
  721. package/.next/server/chunks/[root-of-the-server]__1k4pnhbw4rgzs._.js +0 -3
  722. package/.next/server/chunks/[root-of-the-server]__1kx3a0dm7l2wl._.js +0 -3
  723. package/.next/server/chunks/[root-of-the-server]__1lea5m7hl1n7f._.js +0 -3
  724. package/.next/server/chunks/[root-of-the-server]__1m7pja8jp27eh._.js +0 -3
  725. package/.next/server/chunks/[root-of-the-server]__1m_y4afrn94oy._.js +0 -3
  726. package/.next/server/chunks/[root-of-the-server]__1ruzcenko2gi1._.js +0 -3
  727. package/.next/server/chunks/[root-of-the-server]__1sf2oa2wkqf_0._.js +0 -3
  728. package/.next/server/chunks/[root-of-the-server]__1t6aypqxgjkg_._.js +0 -3
  729. package/.next/server/chunks/[root-of-the-server]__1tffqae521gxo._.js +0 -3
  730. package/.next/server/chunks/[root-of-the-server]__1to25zgnk7xk-._.js +0 -3
  731. package/.next/server/chunks/[root-of-the-server]__1u5c7agj_phnb._.js +0 -3
  732. package/.next/server/chunks/[root-of-the-server]__1vbof6uu4he_-._.js +0 -3
  733. package/.next/server/chunks/[root-of-the-server]__1wfhdwfdvc6j3._.js +0 -3
  734. package/.next/server/chunks/[root-of-the-server]__1y0n2tg-0l636._.js +0 -3
  735. package/.next/server/chunks/[root-of-the-server]__1zc0bmdyn1lg4._.js +0 -3
  736. package/.next/server/chunks/[root-of-the-server]__1zqfz2rc4i280._.js +0 -3
  737. package/.next/server/chunks/[root-of-the-server]__207c97dbcdb0z._.js +0 -3
  738. package/.next/server/chunks/[root-of-the-server]__20cdqectwle3j._.js +0 -3
  739. package/.next/server/chunks/[root-of-the-server]__20dy4zclqbnw8._.js +0 -3
  740. package/.next/server/chunks/[root-of-the-server]__212aaltyh6kc2._.js +0 -3
  741. package/.next/server/chunks/_01y7-j4vx6cu5._.js +0 -3
  742. package/.next/server/chunks/_0_rhee7wb6tcg._.js +0 -3
  743. package/.next/server/chunks/_0at03z7sgwdv3._.js +0 -3
  744. package/.next/server/chunks/_0ge95_bkwrkmc._.js +0 -3
  745. package/.next/server/chunks/_0lj59y-ytysr5._.js +0 -3
  746. package/.next/server/chunks/_0v762_h-sp94d._.js +0 -3
  747. package/.next/server/chunks/_0vshwghrjetxu._.js +0 -3
  748. package/.next/server/chunks/_0z0zrluul2idw._.js +0 -3
  749. package/.next/server/chunks/_1a1oatugfke1p._.js +0 -3
  750. package/.next/server/chunks/_1ex6ovo_j2jzv._.js +0 -3
  751. package/.next/server/chunks/_1fgb9ve_nfat4._.js +0 -3
  752. package/.next/server/chunks/_1fsfy4c3rj36b._.js +0 -3
  753. package/.next/server/chunks/_1hc_es1a3cl6a._.js +0 -3
  754. package/.next/server/chunks/_1m-yyz-pl9-03._.js +0 -3
  755. package/.next/server/chunks/_1ns6y6y2tq8sh._.js +0 -3
  756. package/.next/server/chunks/_1yujnc0thk8ab._.js +0 -3
  757. package/.next/server/chunks/_211va-dk9519v._.js +0 -3
  758. package/.next/server/chunks/src_lib_0_g_0q-n01g-x._.js +0 -3
  759. package/.next/server/chunks/src_lib_0au5a9-5rxkab._.js +0 -3
  760. package/.next/server/chunks/src_lib_0d7kmnt7v2np8._.js +0 -3
  761. package/.next/server/chunks/src_lib_0fedb0fkc3km1._.js +0 -3
  762. package/.next/server/chunks/src_lib_0okewfjk6p2ci._.js +0 -3
  763. package/.next/server/chunks/src_lib_0ptvn4_15zxu0._.js +0 -3
  764. package/.next/server/chunks/src_lib_0rb6u4i7kn30r._.js +0 -3
  765. package/.next/server/chunks/src_lib_0svj7bkzyw9oc._.js +0 -3
  766. package/.next/server/chunks/src_lib_10is5pyogge95._.js +0 -3
  767. package/.next/server/chunks/src_lib_12j7n__96zd0q._.js +0 -3
  768. package/.next/server/chunks/src_lib_13hd5uoi-53hn._.js +0 -3
  769. package/.next/server/chunks/src_lib_1chbt4n9_vpoj._.js +0 -3
  770. package/.next/server/chunks/src_lib_1geq39r7va9gy._.js +0 -3
  771. package/.next/server/chunks/src_lib_1h4xeb9lyx31r._.js +0 -3
  772. package/.next/server/chunks/src_lib_1mno8g5cqmaet._.js +0 -3
  773. package/.next/server/chunks/src_lib_1qvj-3jt4jbq7._.js +0 -3
  774. package/.next/server/chunks/src_lib_1smlosz37xitx._.js +0 -3
  775. package/.next/server/chunks/src_lib_1squodf4swo_a._.js +0 -3
  776. package/.next/server/chunks/src_lib_1uei_xjjj3g7_._.js +0 -3
  777. package/.next/server/chunks/src_lib_1vt5vsj108u_q._.js +0 -3
  778. package/.next/server/chunks/src_lib_api-errors_ts_1gfd4ojz7efro._.js +0 -3
  779. package/.next/server/chunks/src_lib_exam_ts_0d3a4q4r41hcf._.js +0 -3
  780. package/.next/server/chunks/src_lib_figure-scale_ts_215n0ebzz7mr7._.js +0 -3
  781. package/.next/server/chunks/src_lib_import-batches_ts_0aekmggdwo_9-._.js +0 -3
  782. package/.next/server/chunks/src_lib_import-tasks_ts_1f4ejsy00-v1t._.js +0 -3
  783. package/.next/server/chunks/src_lib_question-analysis_ts_15_8r_pxmtd06._.js +0 -3
  784. package/.next/server/chunks/src_lib_question-deduplication_ts_1p1bik-vwl9ue._.js +0 -3
  785. package/.next/server/chunks/src_lib_retag_ts_0eu8ld_86kt3a._.js +0 -3
  786. package/.next/server/chunks/ssr/[root-of-the-server]__00_c9kpvx5075._.js +0 -3
  787. package/.next/server/chunks/ssr/[root-of-the-server]__03208_liub81h._.js +0 -3
  788. package/.next/server/chunks/ssr/[root-of-the-server]__08j-3_6cl3898._.js +0 -3
  789. package/.next/server/chunks/ssr/[root-of-the-server]__0ht0nkzazbnl9._.js +0 -3
  790. package/.next/server/chunks/ssr/[root-of-the-server]__0r18qmblwuijm._.js +0 -3
  791. package/.next/server/chunks/ssr/[root-of-the-server]__0sb3jhytba2xr._.js +0 -3
  792. package/.next/server/chunks/ssr/[root-of-the-server]__1o5pa8m50qyqa._.js +0 -3
  793. package/.next/server/chunks/ssr/_01rfvhncgnpvl._.js +0 -3
  794. package/.next/server/chunks/ssr/_0qgs--x99c558._.js +0 -3
  795. package/.next/server/chunks/ssr/_0w83jztp72o20._.js +0 -3
  796. package/.next/server/chunks/ssr/_0zacgi5-qgqwr._.js +0 -3
  797. package/.next/server/chunks/ssr/_11820i-k62560._.js +0 -3
  798. package/.next/server/chunks/ssr/_1a4u3f5sc05kb._.js +0 -3
  799. package/.next/server/chunks/ssr/_1j3yr2arbxd6a._.js +0 -3
  800. package/.next/server/chunks/ssr/_1qgg_ll5hkjaf._.js +0 -3
  801. package/.next/server/chunks/ssr/_1ujx-n3muyaxs._.js +0 -32
  802. package/.next/server/chunks/ssr/_1ux6eqqkupo6v._.js +0 -3
  803. package/.next/server/chunks/ssr/node_modules_02k42jp0_uoqr._.js +0 -3
  804. package/.next/server/chunks/ssr/node_modules_17lx40fyvpom3._.js +0 -3
  805. package/.next/server/chunks/ssr/node_modules_react-image-crop_dist_index_0khmp4mv3j9zr.js +0 -3
  806. package/.next/server/chunks/ssr/src_0z149pjrheeb7._.js +0 -3
  807. package/.next/server/chunks/ssr/src_1vhiktxz2_jj3._.js +0 -3
  808. package/.next/server/chunks/ssr/src_components_exam_exam-status-badge_tsx_0rozdbhlqsq71._.js +0 -3
  809. package/.next/server/chunks/ssr/src_components_print-preview_answer-space-control_tsx_02kuswyxklzp_._.js +0 -3
  810. package/.next/server/chunks/ssr/src_lib_0-wirad5ziskp._.js +0 -6
  811. package/.next/server/chunks/ssr/src_lib_1vv0-aje_e-zh._.js +0 -6
  812. package/.next/server/chunks/ssr/src_lib_short-id-client_ts_1v7n6pg50kguj._.js +0 -3
  813. package/.next/static/chunks/0-hqh6zs3hidn.js +0 -12
  814. package/.next/static/chunks/02xikk3wlibg1.js +0 -1
  815. package/.next/static/chunks/0e6ximjg-pqgt.js +0 -1
  816. package/.next/static/chunks/0wcwopwk4us6h.js +0 -9
  817. package/.next/static/chunks/0x9-b30mhne-_.js +0 -1
  818. package/.next/static/chunks/0y5zywo-ll2w3.js +0 -1
  819. package/.next/static/chunks/17-num1x7o1m2.js +0 -1
  820. package/.next/static/chunks/1746y345zti-9.js +0 -33
  821. package/.next/static/chunks/17dk_oppf9-hv.js +0 -12
  822. package/.next/static/chunks/1egd1e1483_lj.js +0 -1
  823. package/.next/static/chunks/1o_q928xcfjs3.js +0 -1
  824. package/.next/static/chunks/25flylmb_qz91.js +0 -1
  825. package/.next/static/chunks/2924d0kl-68z7.js +0 -193
  826. package/.next/static/chunks/2cpsg6e2vg7fx.css +0 -3
  827. package/.next/static/chunks/2ebh36q8lvor_.js +0 -1
  828. package/.next/static/chunks/2j0linvpqza7u.js +0 -55
  829. package/.next/static/chunks/2qqyq-iqkv_oa.js +0 -9
  830. package/.next/static/chunks/2r5aeenvfl93p.js +0 -1
  831. package/.next/static/chunks/38vt_4ntvy02e.js +0 -1
  832. package/.next/static/chunks/3c3cp7uzfhnyr.js +0 -1
  833. package/.next/static/chunks/3gy-_kb72v5lr.js +0 -1
  834. package/.next/static/chunks/3oz37kz8n7y3b.js +0 -1
  835. package/.next/static/chunks/3s_fq__cff-ps.js +0 -2
  836. package/.next/static/chunks/3tv07cyoo_hat.js +0 -1
  837. /package/.next/static/{E10D9dv115hLNvX7vE6qA → bFQJMw9c1NJ6NSOY8pN2N}/_buildManifest.js +0 -0
  838. /package/.next/static/{E10D9dv115hLNvX7vE6qA → bFQJMw9c1NJ6NSOY8pN2N}/_clientMiddlewareManifest.js +0 -0
  839. /package/.next/static/{E10D9dv115hLNvX7vE6qA → bFQJMw9c1NJ6NSOY8pN2N}/_ssgManifest.js +0 -0
  840. /package/dist-scripts/src/lib/{tag-data → tags/data}/biology.js +0 -0
  841. /package/dist-scripts/src/lib/{tag-data → tags/data}/chemistry.js +0 -0
  842. /package/dist-scripts/src/lib/{tag-data → tags/data}/chinese.js +0 -0
  843. /package/dist-scripts/src/lib/{tag-data → tags/data}/english.js +0 -0
  844. /package/dist-scripts/src/lib/{tag-data → tags/data}/geography.js +0 -0
  845. /package/dist-scripts/src/lib/{tag-data → tags/data}/history.js +0 -0
  846. /package/dist-scripts/src/lib/{tag-data → tags/data}/index.js +0 -0
  847. /package/dist-scripts/src/lib/{tag-data → tags/data}/math-gaosi.js +0 -0
  848. /package/dist-scripts/src/lib/{tag-data → tags/data}/math.js +0 -0
  849. /package/dist-scripts/src/lib/{tag-data → tags/data}/physics.js +0 -0
  850. /package/dist-scripts/src/lib/{tag-data → tags/data}/politics.js +0 -0
@@ -1,9 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,314381,3198,e=>{var t=e.i(456420);let r={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],314381);var a=e.i(843476),i=e.i(271645),n=e.i(632781);let l={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};l.node;let o=(0,t.f)(l),d={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};d.node;let c=(0,t.f)(d);var u=e.i(395925),m=e.i(741120),f=e.i(759659),x=e.i(519455),g=e.i(111110),h=e.i(294114),p=e.i(201276),v=e.i(113381);let y=null;function j(e,t,r){let s=e?.firstElementChild;s&&(s.style.width="100%",s.style.height=`${r}px`,t?.setSize(e?.offsetWidth||s.offsetWidth||800,r))}function w(e,t){let r=(0,v.L)(e,t);for(let e of r)p.V.warn("[GGB]","命令执行失败",{...e});return r.map(e=>e.command+":"+e.message).join("\n")||void 0}e.s(["f",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:s=!1,showMenuBar:l=!1,className:d="",onRegenerate:b,onDelete:k}){let{t:N}=(0,g.b)(),S=(0,i.useRef)(null),A=(0,i.useRef)(null),T=(0,i.useRef)(void 0),E=(0,i.useId)(),I=(0,i.useRef)(`ggb-${E.replace(/[^a-zA-Z0-9_-]/g,"")}`),[C,_]=(0,i.useState)(!0),[R,V]=(0,i.useState)(null),[$,M]=(0,i.useState)(!0),[O,z]=(0,i.useState)(!1),[L,G]=(0,i.useState)(!1),P=(0,i.useMemo)(()=>(0,v.i)(e),[e]);(0,i.useEffect)(()=>{if(0===P.length)return;let e=!1,a=I.current,i=S.current;return(y||(y=new Promise((e,t)=>{if(window.GGBApplet)return void e();let r=document.createElement("script");r.src="https://www.geogebra.org/apps/deployggb.js",r.async=!0,r.onload=()=>e(),r.onerror=()=>{y=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let n=window.GGBApplet;if(!n){V(N.geogebra.notLoaded),_(!1);return}if(i){i.innerHTML=`<div id="${a}" style="width:100%;height:${t}px"></div>`;try{new n({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:s,showMenuBar:l,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(A.current=r,j(i,r,t),T.current=w(r,P),_(!1))}},!0).inject(a)}catch(t){p.V.error("[GGB]","Init failed",{error:t}),e||(V(N.geogebra.initFailed),_(!1))}}}).catch(t=>{p.V.error("[GGB]","Script load failed",{error:t}),e||(V(N.geogebra.scriptFailed),_(!1))}),()=>{e=!0;try{let e=A.current;e?.remove&&e.remove()}catch(e){p.V.warn("[GGB]","Cleanup failed",{error:e})}A.current=null,i&&(i.innerHTML="")}},[P,r,s,l]),(0,i.useEffect)(()=>{j(S.current,A.current,$?700:t)},[$,t]);let U=(0,i.useCallback)(()=>{let e=A.current;if(e)try{e.resetConstruction(),setTimeout(()=>{A.current&&(T.current=w(A.current,P))},300)}catch(e){p.V.warn("[GGB]","Reset failed",{error:e})}},[P]),F=(0,i.useCallback)(async()=>{if(b&&!O){z(!0);try{await b(T.current)}finally{z(!1)}}},[b,O]),D=(0,i.useCallback)(async()=>{if(k&&!L&&await (0,h.u)(N.geogebra.confirmDelete,{destructive:!0})){G(!0);try{await k()}catch{h.c.error(N.geogebra.deleteFailed)}finally{G(!1)}}},[k,L,N]);return 0===P.length?null:(0,a.jsxs)("div",{className:`relative rounded-lg border bg-card ${d}`,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:N.geogebra.title}),C&&(0,a.jsx)(n.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[b&&(0,a.jsxs)(x.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:F,title:N.geogebra.regenerate,disabled:O||C,children:[O?(0,a.jsx)(n.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:N.geogebra.regenerate})]}),k&&(0,a.jsxs)(x.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:D,title:N.geogebra.delete,disabled:L||O,children:[L?(0,a.jsx)(n.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(f.f,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:N.geogebra.delete})]}),(0,a.jsx)(x.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:U,title:N.geogebra.reset,disabled:C,children:(0,a.jsx)(u.f,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(x.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>M(e=>!e),title:$?N.geogebra.shrink:N.geogebra.enlarge,children:$?(0,a.jsx)(c,{className:"h-3.5 w-3.5"}):(0,a.jsx)(o,{className:"h-3.5 w-3.5"})})]})]}),(0,a.jsx)("div",{ref:S,style:{width:"100%"}}),C&&(0,a.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,a.jsx)(n.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:N.geogebra.loading})]})}),R&&(0,a.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:R})]})}],3198)},399847,e=>{var t=e.i(456420);let r={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],399847)},615568,168148,e=>{var t=e.i(456420);let r={name:"pencil-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],615568);var a=e.i(843476),i=e.i(271645),n=e.i(30030),l=e.i(248425),o=Object.defineProperty,d=(e,t)=>o(e,"name",{value:t,configurable:!0}),c="Progress",[u,m]=(0,n.f)(c),[f,x]=u(c),g=i.forwardRef(d(function(e,t){let{__scopeProgress:r,value:s=null,max:i,getValueLabel:n=p,...o}=e;(i||0===i)&&!j(i)&&console.error(b(`${i}`,"Progress"));let d=j(i)?i:100;null===s||w(s,d)||console.error(k(`${s}`,"Progress"));let c=w(s,d)?s:null,u=y(c)?n(c,d):void 0;return(0,a.jsx)(f,{scope:r,value:c,max:d,children:(0,a.jsx)(l.V.div,{"aria-valuemax":d,"aria-valuemin":0,"aria-valuenow":y(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":v(c,d),"data-value":c??void 0,"data-max":d,...o,ref:t})})},"Progress")),h=i.forwardRef(d(function(e,t){let{__scopeProgress:r,...s}=e,i=x("ProgressIndicator",r);return(0,a.jsx)(l.V.div,{"data-state":v(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...s,ref:t})},"ProgressIndicator"));function p(e,t){return`${Math.round(e/t*100)}%`}function v(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function y(e){return"number"==typeof e}function j(e){return y(e)&&!isNaN(e)&&e>0}function w(e,t){return y(e)&&!isNaN(e)&&e<=t&&e>=0}function b(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`}function k(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
2
- - a positive number
3
- - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)
4
- - \`null\` or \`undefined\` if the progress is indeterminate.
5
-
6
- Defaulting to \`null\`.`}d(p,"defaultGetValueLabel"),d(v,"getProgressState"),d(y,"isNumber"),d(j,"isValidMaxNumber"),d(w,"isValidValueNumber"),d(b,"getInvalidMaxError"),d(k,"getInvalidValueError");var N=e.i(975157);let S=i.forwardRef(({className:e,value:t,...r},s)=>(0,a.jsx)(g,{ref:s,value:t,className:(0,N.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,a.jsx)(h,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=g.displayName,e.s(["f",0,S],168148)},856522,e=>{var t=e.i(456420);let r={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],856522)},786563,e=>{var t=e.i(456420);let r={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],786563)},866531,497346,752012,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(632781),a=e.i(741120),i=e.i(856522),n=e.i(314381),l=e.i(3198),o=e.i(519455),d=e.i(111110),c=e.i(41931),u=e.i(294114),m=e.i(201276);function f({data:e,onChange:a}){let{t:i}=(0,d.b)(),[x,g]=(0,r.useState)(!1),[h,p]=(0,r.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(i.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(i.geogebra.answerRequired);g(!0),p(null);try{let t=await c.k.post("/api/geogebra-analyze",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis},{timeout:18e4,recoverable:!0});t.suitable&&t.commands&&t.commands.length>0?a({geogebraCommands:JSON.stringify(t.commands)}):p(t.description||i.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),p(i.geogebra.analyzeFailed)}finally{g(!1)}};return e.geogebraCommands?(0,t.jsx)(l.f,{commands:e.geogebraCommands,height:350,onRegenerate:v,onDelete:async()=>a({geogebraCommands:void 0})}):e.questionText.trim()&&e.answerText.trim()?(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:v,disabled:x,children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),i.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),i.geogebra.generate]})})]}),h&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:h}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var x=e.i(469937),g=e.i(28342),h=e.i(438465),p=e.i(674166),v=e.i(110204);function y({data:e,paperLevel:r,onChange:s}){let{t:a}=(0,d.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(h.f,{value:e.subjectId,onChange:e=>s({subjectId:e})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(g.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>s({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(p.f,{value:r,onChange:e=>s({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(x.f,{size:"md",value:e.difficultyStars,onChange:e=>s({difficultyStars:e})})})]})]})}var j=e.i(141176),w=e.i(515288),b=e.i(967489);function k({data:e,onChange:r}){let{t:s}=(0,d.b)();return(0,t.jsxs)(w.N,{children:[(0,t.jsx)(w.Y,{children:(0,t.jsx)(w.v,{children:s.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(w.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(b.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>r({mistakeStatus:e}),children:[(0,t.jsx)(b.P,{children:(0,t.jsx)(b.U,{})}),(0,t.jsxs)(b.r,{children:[(0,t.jsx)(b.T,{value:"not_attempted",children:s.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(b.T,{value:"wrong_attempt",children:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(b.T,{value:"unknown",children:s.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(j.f,{value:e.wrongAnswerText||"",onChange:t=>r({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:s.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(j.f,{value:e.mistakeAnalysis||"",onChange:e=>r({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:s.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var N=e.i(511445),S=e.i(149704);function A({title:e,children:r,className:s}){return(0,t.jsxs)(w.N,{children:[(0,t.jsx)(w.Y,{children:(0,t.jsx)(w.v,{children:e})}),(0,t.jsx)(w.O,{className:s,children:r})]})}function T({data:e,children:r}){let{t:s}=(0,d.b)(),a={wrong_attempt:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:s.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:s.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(A,{title:s.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(N.f,{content:e.questionText}),(0,t.jsx)(S.f,{svg:e.figureSvg})]}),r,(0,t.jsx)(A,{title:s.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(N.f,{content:e.answerText})}),(0,t.jsx)(A,{title:s.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(N.f,{content:e.analysis})}),(0,t.jsxs)(A,{title:s.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[s.editor.mistakeStatus||"Attempt Status",s.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(N.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(N.f,{content:e.mistakeAnalysis})]})]})]})}var E=e.i(574041),I=e.i(215519),C=e.i(306831);e.i(676167);var _=e.i(952122),R=e.i(62825),V=e.i(664030),$=e.i(303163);e.s(["f",0,function({initialData:e,onSave:n,onCancel:l,imagePreview:x,initialSubjectId:g,aiTimeout:h}){let{timeZone:p}=(0,I.M)(),{t:b,language:N}=(0,d.b)(),[S,A]=(0,r.useState)({...e,wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:g,gradeSemester:e.gradeSemester||""}),M=(0,r.useRef)(!1),O=e=>{"gradeSemester"in e&&(M.current=!0),A(t=>({...t,...e}))},{groups:z}=(0,V.f)(),L=(()=>{if(S.paperLevel)return S.paperLevel;let e="number"==typeof S.difficultyStars&&S.difficultyStars>=4?"b":"a";return z.find(t=>t.key===e&&t.isActive)?.id||""})(),G=S.paperLevel??L,[P,U]=(0,r.useState)(!1),[F,D]=(0,r.useState)(!1),[q,H]=(0,r.useState)(!1),[Q,B]=(0,r.useState)(void 0),[W,Z]=(0,r.useState)([]);(0,r.useEffect)(()=>{c.k.get("/api/notebooks").then(Z).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),c.k.get("/api/user").then(e=>{if(H(!!e?.enableGeogebra),e){let t=function(e,t=C.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,r=new Date,s="en",a=C.J){let i=(0,C.c)(r,a),n=i.getFullYear(),l=i.getMonth()+1,o=n-t,d="2nd";l>=9?(o+=1,d="1st"):d=l<2?"1st":"2nd";let c="zh"===s,u=c?"1st"===d?"上期":"下期":"1st"===d?"1st Semester":"2nd Semester",m=(c?{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"]})[e]||[],f=`${o}`;if(f=o>0&&o<=m.length?m[o-1]:o>m.length?c?"已毕业":"Graduated":c?"学前":"Pre-school",!c)return`${f}, ${u}`;{let e="1st"===d?"上":"下";return`${f}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,p);A(e=>e.gradeSemester||M.current?e:{...e,gradeSemester:t||""}),B(e.educationStage||void 0)}}).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[N,p]);let J=async()=>{if(!S.questionText.trim())return void u.c.warning(b.editor.enterQuestionFirst||"Please enter question text first");U(!0);try{let e=function({questionText:e,language:t,subject:r,imagePreview:s,gradeSemester:a,subjectId:i}){let n={questionText:e,language:t,subject:r};return s&&(n.imageBase64=s),a&&(n.gradeSemester=a),i&&(n.subjectId=i),n}({questionText:S.questionText,language:N,subject:S.subject,imagePreview:x,gradeSemester:S.gradeSemester??void 0,subjectId:S.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:h});let t=await c.k.post("/api/reanswer",e,{timeout:h||18e4,recoverable:!0});A(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,R.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars})),u.c.success(b.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(s){let e,t,r;m.V.error("[CorrectionEditor]","Reanswer failed",{error:s}),u.c.error((e=(0,$.d)(s)||"",r=(t=b.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||b.errors?.AI_AUTH_ERROR||r:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||b.errors?.AI_CONNECTION_FAILED||r:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||b.errors?.AI_RESPONSE_ERROR)||r))}finally{U(!1)}},Y=async()=>{if(!S.subjectId)return void u.c.warning(b.editor.messages?.selectNotebook||"Please select a notebook");if(!F){D(!0);try{await n({...S,paperLevel:G,mistakeStatus:(0,R.x)(S.mistakeStatus,S.wrongAnswerText)})}finally{D(!1)}}},X=b.editor.placeholder||"Supports Markdown and LaTeX...",K=(0,_.f)(W.find(e=>e.id===S.subjectId)?.name||null)||(0,_.f)(S.subject||null)||void 0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:b.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:b.editor.cancel}),(0,t.jsxs)(o.f,{onClick:Y,disabled:F,children:[F?(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),F?b.common?.pleaseWait||"Please wait...":b.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[x&&(0,t.jsx)(w.N,{children:(0,t.jsx)(w.O,{className:"p-4",children:(0,t.jsx)("img",{src:x,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(y,{data:S,paperLevel:G,onChange:O}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.question}),(0,t.jsx)(j.f,{value:S.questionText,onChange:e=>O({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:X}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:J,disabled:P||!S.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,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),b.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),b.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.tags}),(0,t.jsx)(E.f,{value:S.knowledgePoints,onChange:e=>O({knowledgePoints:e}),placeholder:b.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:b.editor.createTagHint,subject:K,gradeStage:Q}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.answer}),(0,t.jsx)(j.f,{value:S.answerText,onChange:e=>O({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:X})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(v.f,{children:b.editor.analysis}),(0,t.jsx)(j.f,{value:S.analysis,onChange:e=>O({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:X})]}),(0,t.jsx)(k,{data:S,onChange:O})]}),(0,t.jsx)(T,{data:S,children:q&&(0,t.jsx)(f,{data:S,onChange:O})})]})]})}],866531);var M=e.i(853138),O=e.i(263676);e.s(["f",0,function({message:e,onDismiss:r}){let{t:s}=(0,d.b)();return e?(0,t.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,t.jsx)(M.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:e}),(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":s.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(O.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var z=e.i(618566);function L(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function G(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let r=t.errors[e];return"string"==typeof r?r:void 0}e.s(["f",0,function(e){let{t}=(0,d.b)(),s=(0,z.useRouter)(),[a,i]=(0,r.useState)(null),n=async(r,a,n=!0)=>{i(null);try{let e=await r();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),n&&(e.duplicate?s.push(`/error-items/${e.id}`):a&&s.push(`/notebooks/${a}`)),!0}catch(s){m.V.error(e,"Save failed",{errorMessage:(0,$.d)(s)??(0,$.Z)(s)});let r=function(e,t){let r=L(e),s=L(r?.data),a="number"==typeof r?.status?r.status:void 0,i=(0,$.d)(e),n=G(i,t)??G(s?.code,t),l={400:t.errors.QUESTION_SAVE_INVALID_INPUT,401:t.errors.QUESTION_SAVE_UNAUTHORIZED,403:t.errors.QUESTION_SAVE_FORBIDDEN,408:t.errors.QUESTION_SAVE_TIMEOUT,409:t.errors.QUESTION_SAVE_CONFLICT,413:t.errors.QUESTION_SAVE_TOO_LARGE,429:t.errors.QUESTION_SAVE_RATE_LIMITED,502:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:t.errors.QUESTION_SAVE_TIMEOUT},o=n??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,$.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let d=L(s?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=G(d?.reason,t);e&&(o+=`
7
- ${e}`)}return 400===a&&(o+=(function(e,t){if(!Array.isArray(e))return[];let r={questionText:t.editor.question,answerText:t.editor.answer,analysis:t.editor.analysis,wrongAnswerText:t.editor.wrongAnswerText,mistakeAnalysis:t.editor.mistakeAnalysis,knowledgePoints:t.editor.tags,subjectId:t.editor.selectNotebook,gradeSemester:t.editor.gradeSemester,paperLevel:t.editor.paperLevel};return e.slice(0,3).flatMap(e=>{let s=L(e),a=s?.path,i=Array.isArray(a)&&"string"==typeof a[0]?r[a[0]]:void 0;if(!i)return[];let n=s?.maximum,l=t.questionSave.invalidField;return s?.code==="too_big"&&"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&(l="array"===s.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",i).replace("{maximum}",String(n))]})})(s?.details,t).map(e=>`
8
- ${e}`).join("")),"string"==typeof d?.databaseCode&&/^P\d{4}$/.test(d.databaseCode)&&(o+=`
9
- ${t.questionSave.databaseCode.replace("{code}",d.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(s,t);return i(r),"AI_DAILY_LIMIT_EXCEEDED"!==(0,$.d)(s)&&u.c.error(r),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],752012)},469937,e=>{var t=e.i(843476),r=e.i(786563),s=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:d=!0,className:c}){let{t:u}=(0,s.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",x=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",c),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(r.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",c),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${x}`,title:x,children:i.map(e=>(0,t.jsx)(r.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",c),children:u.difficulty.unrated}):null}])},731335,579321,927904,e=>{var t=e.i(843476),r=e.i(399847),s=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),d=e.i(487486),c=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),x=e.i(306831);let g=["read","convert","crop","compress","upload"],h=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let r=Math.round(t);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var v=e.i(975157);let y={analyzing:50,saving:90},j={analyzing:l.f,saving:l.f,review:o.f,saved:s.f,failed:r.f};e.s(["f",0,function({task:e,now:r,onReview:s,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:w}=(0,f.M)(),b=j[e.status],k="analyzing"===e.status||"saving"===e.status,N=o.errors,S=e.error?"string"==typeof N[e.error]?N[e.error]:e.error:null,A=function(e){let t=[];for(let r of g){let s=e?.client?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}for(let r of h){let s=e?.server?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}return t}(e.timings),T=k&&r?r-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(b,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",k&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(d.f,{children:o.importTasks.unread})]}),k&&(0,t.jsx)(u.f,{value:y[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(y[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,x.r)(e.createdAt,"MM-dd HH:mm",w))]}),null!==T&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(T))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),A.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:A.map(({stage:e,ms:r})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(r)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(c.f,{size:"sm",onClick:s,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(c.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(c.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(c.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var w=e.i(618566),b=e.i(61425),k=e.i(294114),N=e.i(201276),S=e.i(116331);e.s(["f",0,function(e){let{t}=(0,m.b)(),r=(0,w.useRouter)(),s=e=>{e.unread&&(0,S.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),r.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),r.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async r=>{try{await (0,S.R)(r.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,b.f)(e,t))}e?.()},discard:async r=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,S.x)(r.id),k.c.success(t.importTasks.discarded),s=!0}catch(e){k.c.error((0,b.f)(e,t))}return e?.(),s}}}],579321);var A=e.i(271645);e.s(["f",0,function(e,t=1e3){let[r,s]=(0,A.useState)(()=>Date.now());return(0,A.useEffect)(()=>{if(!e)return;let r=setInterval(()=>s(Date.now()),t);return()=>clearInterval(r)},[e,t]),r}],927904)},141176,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(456420);let a={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};a.node;let i=(0,s.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),d=e.i(111110),c=e.i(975157);e.s(["f",0,function({value:e,onChange:s,className:a,...u}){let{t:m}=(0,d.b)(),[f,x]=(0,r.useState)("source"),g=(0,r.useId)(),h=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:h.map(({mode:e,label:r,icon:s})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":g,onClick:()=>x(e),className:(0,c.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:g,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>s(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>x("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,674166,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:d}){let[c,u]=(0,r.useState)([]),{t:m}=(0,l.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(s.d,{value:e,onValueChange:o,children:[(0,t.jsx)(s.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(s.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(s.r,{children:0===c.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):c.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}],438465);var o=e.i(664030);e.s(["f",0,function({value:e,onChange:r,disabled:a}){let{groups:i,loading:n}=(0,o.f)(),l=i.filter(e=>e.isActive);return(0,t.jsxs)(s.d,{value:e,onValueChange:r,disabled:a||n,children:[(0,t.jsx)(s.P,{children:(0,t.jsx)(s.U,{placeholder:"选择卷别"})}),(0,t.jsx)(s.r,{children:l.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),r=e.i(111110),s=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:d}){let{t:c}=(0,r.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",d),children:(0,t.jsx)("img",{src:(0,s.f)(e),alt:c.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(263676),a=e.i(487486),i=e.i(793479),n=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:o,placeholder:d="Enter tags...",className:c="",enterHint:u,subject:m,gradeStage:f}){let[x,g]=(0,r.useState)(""),[h,p]=(0,r.useState)([]),[v,y]=(0,r.useState)(!1),[j,w]=(0,r.useState)(0),b=(0,r.useRef)(null),k=(0,r.useRef)(null),N=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});m&&r.append("subject",m),f&&r.append("stage",f);let s=((await n.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));p(s.slice(0,20)),y(s.length>0),w(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,f,e]);(0,r.useEffect)(()=>{x.trim()&&N(x)},[x,N]);let S=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),p([]),y(!1),w(0))},A=t=>{o(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||b.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${c}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>A(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(i.f,{ref:b,type:"text",value:x,onChange:e=>{g(e.target.value),e.target.value.trim()||(p([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),j>=0&&h[j]?S(h[j]):x.trim()&&S(x)):"ArrowDown"===t.key?(t.preventDefault(),w(e=>Math.min(e+1,h.length-1))):"ArrowUp"===t.key?(t.preventDefault(),w(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),w(0)):"Backspace"===t.key&&!x&&e.length>0&&A(e[e.length-1])},onFocus:()=>{h.length>0&&y(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),v&&h.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:h.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===j?"bg-accent":""}`,onClick:()=>S(e),onMouseEnter:()=>w(r),children:e},e))}),x&&!v&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${x}"`:`Press Enter to create "${x}"`})]})}])},61425,e=>{var t=e.i(303163);e.s(["f",0,function(e,r){let s=r.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=r.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return r.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${s} (${t})`}return s}])},184110,e=>{let t=["left","center","right"],r="center";function s(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,r,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,s,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:r},"V",0,function(e){return s(e)?e:100}])},398019,e=>{e.s(["f",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},952122,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])},62825,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,r="zh"){return("en"===r?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,r){return(r||"").trim()?"wrong_attempt":t(e)}])}])})();
@@ -1 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,367784,699375,e=>{var s=e.i(456420);let i={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};i.node;let t=(0,s.f)(i);e.s(["f",0,t],367784);var n=e.i(843476),a=e.i(271645),r=e.i(981140),l=e.i(820783),o=e.i(30030),c=e.i(369340),d=e.i(635804),m=e.i(248425),p=Object.defineProperty,u=(e,s)=>p(e,"name",{value:s,configurable:!0}),h="Switch",[x,f]=(0,o.f)(h),[g,v]=x(h);function j(e){let{__scopeSwitch:s,checked:i,children:t,defaultChecked:r,disabled:l,form:o,name:d,onCheckedChange:m,required:p,value:u="on",internal_do_not_use_render:x}=e,[f,v]=(0,c.f)({prop:i,defaultProp:r??!1,onChange:m,caller:h}),[j,y]=a.useState(null),[b,N]=a.useState(null),[k,C]=a.useState(null),S=!j||!!o||!!j.closest("form"),U={checked:f,setChecked:v,disabled:l,control:j,setControl:y,name:d,form:o,value:u,userClick:k,onUserClick:C,required:p,defaultChecked:r,isFormControl:S,bubbleInput:b,setBubbleInput:N};return(0,n.jsx)(g,{scope:s,...U,children:w(x)?x(U):t})}u(j,"SwitchProvider");var y=a.forwardRef(u(function({__scopeSwitch:e,onClick:s,...i},t){let{control:o,form:c,value:d,disabled:p,checked:h,required:x,setControl:f,setChecked:g,onUserClick:j,isFormControl:y,bubbleInput:b}=v("SwitchTrigger",e),N=(0,l.f)(t,f),k=a.useRef(h);return a.useEffect(()=>{let e=c?o?.ownerDocument.getElementById(c):o?.form;if(e instanceof HTMLFormElement){let s=u(()=>g(k.current),"reset");return e.addEventListener("reset",s),()=>e.removeEventListener("reset",s)}},[o,c,g]),(0,n.jsx)(m.V.button,{type:"button",role:"switch","aria-checked":h,"aria-required":x,"data-state":C(h),"data-disabled":p?"":void 0,disabled:p,value:d,...i,ref:N,onClick:(0,r.f)(s,e=>{let s=e.isPropagationStopped();j({requestedChecked:!h,hasConsumerStoppedPropagation:s}),g(e=>!e),b&&y&&!s&&e.stopPropagation()})})},"SwitchTrigger")),b=a.forwardRef(u(function(e,s){let{__scopeSwitch:i,name:t,checked:a,defaultChecked:r,required:l,disabled:o,value:c,onCheckedChange:d,form:m,...p}=e;return(0,n.jsx)(j,{__scopeSwitch:i,checked:a,defaultChecked:r,disabled:o,required:l,onCheckedChange:d,name:t,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(y,{...p,ref:s,__scopeSwitch:i}),e&&(0,n.jsx)(k,{__scopeSwitch:i})]})})},"Switch")),N=a.forwardRef(u(function(e,s){let{__scopeSwitch:i,...t}=e,a=v("SwitchThumb",i);return(0,n.jsx)(m.V.span,{"data-state":C(a.checked),"data-disabled":a.disabled?"":void 0,...t,ref:s})},"SwitchThumb")),k=a.forwardRef(u(function({__scopeSwitch:e,onClick:s,...i},t){let{control:o,userClick:c,checked:p,defaultChecked:u,required:h,disabled:x,name:f,value:g,form:j,bubbleInput:y,setBubbleInput:b}=v("SwitchBubbleInput",e),N=(0,l.f)(t,b),k=(0,d.f)(o),w=a.useRef(!1),C=a.useRef(p),S=a.useRef(c),U=a.useRef(null);a.useEffect(()=>{if(!y)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let s=C.current!==p;C.current=p;let i=null!==c&&c!==S.current;if(S.current=c,i)U.current=s?null:c,s&&e.call(y,p),y.dispatchEvent(new Event("click",{bubbles:!c.hasConsumerStoppedPropagation}));else if(s){let s=U.current;U.current=null;let i=s?.requestedChecked===p;w.current=!0,e.call(y,p),y.dispatchEvent(new Event("click",{bubbles:!(i&&s.hasConsumerStoppedPropagation)})),w.current=!1}},[y,p,c]);let K=a.useRef(p);return(0,n.jsx)(m.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??K.current,required:h,disabled:x,name:f,value:g,form:j,...i,tabIndex:-1,ref:N,onClick:(0,r.f)(s,e=>{w.current&&e.stopPropagation()}),style:{...i.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function w(e){return"function"==typeof e}function C(e){return e?"checked":"unchecked"}u(w,"isFunction"),u(C,"getState");var S=e.i(975157);let U=a.forwardRef(({className:e,...s},i)=>(0,n.jsx)(b,{className:(0,S.f)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...s,ref:i,children:(0,n.jsx)(N,{className:(0,S.f)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));U.displayName=b.displayName,e.s(["f",0,U],699375)},713452,753817,128093,e=>{var s=e.i(843476),i=e.i(271645),t=e.i(551757),n=e.i(632781),a=e.i(583967),r=e.i(456420);let l={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};l.node;let o=(0,r.f)(l);var c=e.i(519455),d=e.i(111110);function m({detail:e}){let{t:i}=(0,d.b)();return e?(0,s.jsxs)("p",{className:"mt-1 rounded bg-background/60 px-2 py-1 font-mono text-[11px] leading-relaxed text-red-700 dark:text-red-300 break-all select-text",children:[(0,s.jsx)("span",{className:"font-sans text-muted-foreground",children:i.settings.ai.providerErrorDetail}),e]}):null}e.s(["f",0,m],753817);let p={minimax:{name:"MiniMax",nameEn:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn",docs:{cn:"https://platform.minimax.cn/docs/api-reference/api-overview",intl:"https://platform.minimax.io/docs/api-reference/api-overview",apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",models:"https://platform.minimax.cn/docs/guides/models-intro"}},glm:{name:"智谱 GLM",nameEn:"Zhipu GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn",docs:{cn:"https://docs.bigmodel.cn/cn/guide/start/quick-start",intl:"https://docs.z.ai/guides/overview/quick-start",apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",models:"https://docs.bigmodel.cn/cn/guide/start/model-overview"}},deepseek:{name:"DeepSeek",nameEn:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-v4-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com",docs:{cn:"https://api-docs.deepseek.com/zh-cn/",apiKey:"https://api-docs.deepseek.com/zh-cn/",models:"https://api-docs.deepseek.com/zh-cn/quick_start/pricing"}},kimi:{name:"Kimi",nameEn:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3.1-pro",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com",docs:{cn:"https://platform.moonshot.cn/docs/introduction",intl:"https://platform.moonshot.ai/docs/introduction",apiKey:"https://platform.moonshot.cn/docs/introduction",models:"https://platform.moonshot.cn/docs/pricing/chat"}},qwen:{name:"千问 Qwen",nameEn:"Qwen",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",model:"qwen3.8-max",envPrefix:"QWEN",consoleUrl:"https://bailian.console.aliyun.com",docs:{cn:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",intl:"https://www.alibabacloud.com/help/en/model-studio/token-plan-personal-quick-start",apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",models:"https://help.aliyun.com/zh/model-studio/models"}},stepfun:{name:"阶跃星辰 StepFun",nameEn:"StepFun",baseUrl:"https://api.stepfun.com/step_plan/v1",model:"step-5-preview",envPrefix:"STEPFUN",consoleUrl:"https://platform.stepfun.com",docs:{cn:"https://platform.stepfun.com/docs/zh/guides/developer/openai",intl:"https://platform.stepfun.ai/docs/en/guides/developer/openai",apiKey:"https://platform.stepfun.com/docs/zh/guides/developer/openai",models:"https://platform.stepfun.com/docs/zh/guides/models/list"}},volcengine:{name:"火山引擎 豆包",nameEn:"Volcengine Doubao",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1330626",intl:"https://docs.byteplus.com/en/docs/ModelArk/1330626",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}},"volcengine-agent":{name:"火山引擎 Agent Plan",nameEn:"Volcengine Agent Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/plan/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_AGENT",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",models:"https://www.volcengine.com/docs/82379/2366394"}},"volcengine-coding":{name:"火山引擎 Coding Plan",nameEn:"Volcengine Coding Plan",baseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_CODING",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1928261",apiKey:"https://www.volcengine.com/docs/82379/1928261",models:"https://www.volcengine.com/docs/82379/1928261"}},"volcengine-free":{name:"火山引擎(免费试用)",nameEn:"Volcengine (free trial)",baseUrl:"https://ark.cn-beijing.volces.com/api/v3",model:"doubao-seed-evolving",envPrefix:"VOLCENGINE_FREE",consoleUrl:"https://console.volcengine.com/ark",docs:{cn:"https://www.volcengine.com/docs/82379/1399514",apiKey:"https://www.volcengine.com/docs/82379/1541594",models:"https://www.volcengine.com/docs/82379/1330310"}}},u=Object.keys(p);function h(e){return"string"==typeof e&&Object.prototype.hasOwnProperty.call(p,e)}e.s(["$",0,p,"U",0,u,"z",0,function(e,s){let i=p[e];return"zh"===s?i.name:i.nameEn},"j",0,h,"k",0,function(e,s){let i=p[e];return{apiKey:s?.apiKey||"",baseUrl:s?.baseUrl||i.baseUrl,model:s?.model||i.model}}],128093);var x=e.i(41931),f=e.i(303163),g=e.i(201276);e.s(["f",0,function({config:e,saving:r,saveButton:l}){let{t:p,language:u}=(0,d.b)(),[v,j]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null),N=e=>p.settings?.ai?.errors?.[e]||e.replace("UNKNOWN:",""),k=async()=>{let s=function(e,s){let i=e.aiProvider;if("openai"===i){let t=e.openai?.instances?.find(s=>s.id===e.openai?.activeInstanceId);return t?.apiKey?{ok:!0,body:{provider:i,apiKey:t.apiKey,baseUrl:t.baseUrl,model:t.model,language:s}}:{ok:!1,error:"API_KEY_REQUIRED"}}if("azure"===i){let t=e.azure;return t?.apiKey&&t.endpoint&&t.deploymentName?{ok:!0,body:{provider:i,apiKey:t.apiKey,endpoint:t.endpoint,deploymentName:t.deploymentName,apiVersion:t.apiVersion,model:t.model,language:s}}:{ok:!1,error:"AZURE_CONFIG_INCOMPLETE"}}if("minimax-code"===i)return{ok:!0,body:{provider:i,model:e.minimaxCode?.model,language:s}};if("gemini"===i||"anthropic"===i||h(i)){let t=e[i];return t?.apiKey?{ok:!0,body:{provider:i,apiKey:t.apiKey,baseUrl:t.baseUrl,model:t.model,language:s}}:{ok:!1,error:"API_KEY_REQUIRED"}}return{ok:!1,error:"UNSUPPORTED_PROVIDER"}}(e,u);if(!s.ok){if("UNSUPPORTED_PROVIDER"===s.error)return;b({success:!1,textSupport:!1,visionSupport:!1,textError:"AZURE_CONFIG_INCOMPLETE"===s.error?p.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete":p.settings?.ai?.validationApiKeyRequired||"API Key is required"});return}j(!0),b(null);try{b(await x.k.post("/api/ai/test",s.body))}catch(e){g.V.error("[AiConnectionTest]","AI connection test failed",{error:e}),b({success:!1,textSupport:!1,visionSupport:!1,textError:(0,f.Z)(e)})}finally{j(!1)}};return(0,s.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(c.f,{type:"button",variant:"outline",onClick:k,disabled:v||r,className:"flex-1",children:[v?(0,s.jsx)(n.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(o,{className:"mr-2 h-4 w-4"}),v?p.settings?.ai?.testing||"Testing...":p.settings?.ai?.testConnection||"Test Connection"]}),l]}),y&&(0,s.jsxs)("div",{className:`p-3 rounded-md text-sm ${y.success?"bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-900":"bg-red-50 dark:bg-red-950/40 border border-red-200 dark:border-red-900"}`,children:[(0,s.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:y.success?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.f,{className:"h-4 w-4 text-green-600"}),(0,s.jsx)("span",{className:"text-green-700 dark:text-green-300",children:p.settings?.ai?.testSuccess||"Connection Successful"}),y.modelInfo&&(0,s.jsxs)("span",{className:"text-green-600 text-xs",children:["(",y.modelInfo,")"]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.f,{className:"h-4 w-4 text-red-600"}),(0,s.jsx)("span",{className:"text-red-700 dark:text-red-300",children:p.settings?.ai?.testFailed||"Connection Failed"})]})}),y.success&&(0,s.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:[p.settings?.ai?.textSupport||"Text Generation",":"]}),(0,s.jsxs)("span",{className:"text-green-600",children:["✓ ",p.settings?.ai?.supported||"Supported"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:[p.settings?.ai?.visionSupport||"Vision/Multimodal",":"]}),y.visionSupport?(0,s.jsxs)("span",{className:"text-green-600",children:["✓ ",p.settings?.ai?.supported||"Supported"]}):(0,s.jsxs)("span",{className:"text-amber-600",children:["✗ ",y.visionError?N(y.visionError):p.settings?.ai?.notSupported||"Not Supported"]})]}),!y.visionSupport&&(0,s.jsx)(m,{detail:y.visionErrorDetail}),(0,s.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:p.settings?.ai?.testNetworkNote})]}),!y.success&&y.textError&&(0,s.jsx)("p",{className:"text-red-600 text-xs mt-1",children:N(y.textError)}),!y.success&&(0,s.jsx)(m,{detail:y.textErrorDetail})]})]})}],713452)},10038,835467,e=>{var s=e.i(843476),i=e.i(632781),t=e.i(519455),n=e.i(110204),a=e.i(967489),r=e.i(713452),l=e.i(459649),o=e.i(118585),c=e.i(75977),d=e.i(482022),m=e.i(97923),p=e.i(367784),u=e.i(741120),h=e.i(487486),x=e.i(793479),f=e.i(975153),g=e.i(699375),v=e.i(111110),j=e.i(215519),y=e.i(306831);function b({checkin:e,autoCheckin:a,onAutoCheckinChange:r,busy:l,onCheckin:o}){let c,{t:d}=(0,v.b)(),{timeZone:m}=(0,j.M)(),p=d.settings?.ai?.minimaxCode,{today:u,last:x}=e,N=x&&"failed"!==x.status?x:null,k=!!(u?.checkedToday||N),w=String(N?.points??(u?u.points+u.bonusPoints:0)),C=String(N?.streakDays??u?.streakDays??0);return c=N?.trigger==="auto"&&"checked-in"===N.status?(p?.checkinAuto||"Checked in automatically today at {time} (+{points} credits, day {days} in a row)").replace("{time}",(0,y.r)(N.at,"HH:mm",m)).replace("{points}",w).replace("{days}",C):k?(p?.checkinDone||"Checked in today (+{points} credits, day {days} in a row)").replace("{points}",w).replace("{days}",C):x?.status==="failed"?(p?.checkinFailed||"Check-in failed: {error}").replace("{error}",x.error||""):e.autoCheckin?p?.checkinWillAuto||"Not checked in yet today. The app will check in automatically within the hour.":p?.checkinNotYet||"Not checked in yet today",(0,s.jsxs)("div",{className:"space-y-3 border-t pt-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:p?.checkinToday||"Today's check-in"}),(0,s.jsxs)(h.f,{variant:k?"default":x?.status==="failed"?"destructive":"secondary",children:[(0,s.jsx)(f.f,{className:"mr-1 h-3 w-3"}),k?p?.checkinSuccess||"Checked in":p?.checkinNotYet||"Not yet"]})]}),!k&&(0,s.jsxs)(t.f,{size:"sm",variant:"outline",onClick:o,disabled:l,children:[l&&(0,s.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}),p?.checkinNow||"Check in now"]})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:c}),(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(n.f,{htmlFor:"minimax-code-auto-checkin",children:p?.autoCheckin||"Daily auto check-in"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:p?.autoCheckinHint})]}),(0,s.jsx)(g.f,{id:"minimax-code-auto-checkin",checked:a,onCheckedChange:r})]})]})}let N=["MiniMax-M3.1-Flash","MiniMax-M3","MiniMax-M2.7-highspeed","MiniMax-M2.7"];var k=e.i(271645),w=e.i(41931),C=e.i(303163),S=e.i(294114),U=e.i(201276);function K({value:e,onChange:a}){let{t:r}=(0,v.b)(),l=r.settings?.ai?.minimaxCode,{status:o,loading:c,pending:f,busy:g,refresh:j,login:y,logout:P,checkin:E}=function(){let{t:e}=(0,v.b)(),s=e.settings?.ai?.minimaxCode,[i,t]=(0,k.useState)(null),[n,a]=(0,k.useState)(!0),[r,l]=(0,k.useState)(null),[o,c]=(0,k.useState)(!1),d=(0,k.useRef)(null),m=(0,k.useCallback)(async()=>{a(!0);try{let e=await w.k.get("/api/minimax-code");t(e),e.pendingLogin&&l(e.pendingLogin)}catch(e){U.V.error("[MiniMaxCode]","Failed to load status",{error:e})}finally{a(!1)}},[]);(0,k.useEffect)(()=>{m()},[m]),(0,k.useEffect)(()=>{if(!r)return;let e=!1,i=async()=>{try{let t=await w.k.get("/api/minimax-code/login");if(e)return;if("pending"===t.status){d.current=setTimeout(i,r.intervalMs);return}l(null),"ok"===t.status?S.c.success(s?.loginSuccess||"Signed in"):"expired"===t.status?S.c.error(s?.loginExpired||"Authorization timed out"):"denied"===t.status&&S.c.error(s?.loginDenied||"Authorization declined"),m()}catch(i){if(e)return;l(null),S.c.error(`${s?.loginFailed||"Sign-in failed"}: ${(0,C.Z)(i)}`)}};return d.current=setTimeout(i,r.intervalMs),()=>{e=!0,d.current&&clearTimeout(d.current)}},[r,m,s]);let p=async()=>{c(!0);try{await w.k.delete("/api/minimax-code"),l(null),await m()}catch(e){S.c.error((0,C.Z)(e))}finally{c(!1)}},u=async()=>{c(!0);try{let e=await w.k.post("/api/minimax-code/checkin",{});"failed"===e.status?S.c.error((s?.checkinFailed||"Check-in failed: {error}").replace("{error}",e.error||"")):S.c.success(s?.checkinSuccess||"Checked in"),await m()}catch(e){S.c.error((0,C.Z)(e))}finally{c(!1)}};return{status:i,loading:n,pending:r,busy:o,refresh:m,login:async()=>{c(!0);try{let e=await w.k.post("/api/minimax-code/login",{});l(e),window.open(e.url,"_blank","noopener,noreferrer")}catch(e){S.c.error(`${s?.loginFailed||"Sign-in failed"}: ${(0,C.Z)(e)}`)}finally{c(!1)}},logout:p,checkin:u}}(),M=o?.login??"none",I=o?.account,z=o?.credits,A={none:l?.statusNone||"Not signed in",active:l?.statusActive||"Signed in",expired:l?.statusExpired||"Login expired"}[M];return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.intro}),(0,s.jsxs)("section",{className:"space-y-3 rounded-md border bg-background p-3","aria-label":l?.title||"MiniMax Code account",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("h4",{className:"text-sm font-medium",children:l?.title||"MiniMax Code account"}),(0,s.jsx)(t.f,{variant:"ghost",size:"sm",onClick:()=>void j(),disabled:c,"aria-label":l?.refresh||"Refresh",children:(0,s.jsx)(u.f,{className:`h-4 w-4 ${c?"animate-spin":""}`})})]}),(0,s.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:l?.loginStatus||"Login status"}),(0,s.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,s.jsx)(h.f,{variant:"active"===M?"default":"expired"===M?"destructive":"secondary",children:A}),I&&(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:I.name||I.email||I.userId})]}),"active"===M&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:l?.credits||"Remaining credits"}),(0,s.jsx)("dd",{children:z?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"font-medium tabular-nums",children:z.total}),(0,s.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:(l?.creditsDetail||"Free {free} · Purchased {purchased}").replace("{free}",String(z.free)).replace("{purchased}",String(z.purchased))})]}):(0,s.jsx)("span",{className:"text-muted-foreground",children:l?.creditsUnavailable||"Unavailable"})})]})]}),"active"===M&&o&&(0,s.jsx)(b,{checkin:o.checkin,autoCheckin:e?.autoCheckin!==!1,onAutoCheckinChange:s=>a({...e,autoCheckin:s}),busy:g,onCheckin:()=>void E()}),f?(0,s.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-sm",children:[(0,s.jsxs)("p",{className:"flex items-center gap-2",children:[(0,s.jsx)(i.f,{className:"h-4 w-4 animate-spin"}),l?.waiting]}),f.userCode&&(0,s.jsxs)("p",{children:[l?.userCode||"Verification code",": ",(0,s.jsx)("span",{className:"font-mono font-medium",children:f.userCode})]}),(0,s.jsxs)("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[l?.openLink||"Open the authorization page"," ",(0,s.jsx)(d.f,{className:"h-3 w-3"})]})]}):(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)(t.f,{size:"sm",onClick:()=>void y(),disabled:g,children:[g?(0,s.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(m.f,{className:"mr-2 h-4 w-4"}),"none"===M?l?.login||"Sign in with browser":l?.relogin||"Sign in again"]}),"none"!==M&&(0,s.jsxs)(t.f,{size:"sm",variant:"outline",onClick:()=>void P(),disabled:g,children:[(0,s.jsx)(p.f,{className:"mr-2 h-4 w-4"}),l?.logout||"Sign out"]})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{htmlFor:"minimax-code-model",children:l?.model||"Model"}),(0,s.jsx)(x.f,{id:"minimax-code-model",list:"minimax-code-models",value:e?.model||"",onChange:s=>a({...e,model:s.target.value}),placeholder:"MiniMax-M3.1-Flash"}),(0,s.jsx)("datalist",{id:"minimax-code-models",children:N.map(e=>(0,s.jsx)("option",{value:e},e))}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.modelHint})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.risk})]})}var P=e.i(77071),E=e.i(759659),M=e.i(464034),I=e.i(434901),z=e.i(37038),A=e.i(62189);function R({value:e,onChange:i}){let{t:r}=(0,v.b)(),l=(0,A.f)("openai"),o=e?.instances||[],c=e?.activeInstanceId,d=o.find(e=>e.id===c),m=(s,t)=>{i({...e,instances:o.map(e=>e.id===c?{...e,[s]:t}:e)})},p=async()=>{if(!c||!await (0,S.u)(r.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0}))return;let e=o.filter(e=>e.id!==c);i({instances:e,activeInstanceId:e[0]?.id})};return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(n.f,{children:r.settings?.ai?.instances||"Instance"}),(0,s.jsxs)(t.f,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(o.length>=10)return;let e={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let s=16*Math.random()|0;return("x"===e?s:3&s|8).toString(16)}),name:`Instance ${o.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};i({instances:[...o,e],activeInstanceId:e.id})},disabled:o.length>=10,className:"h-7 px-2 text-xs",children:[(0,s.jsx)(P.f,{className:"h-3 w-3 mr-1"}),r.settings?.ai?.addInstance||"Add"]})]}),o.length>0?(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(a.d,{value:c||"",onValueChange:s=>i({...e,activeInstanceId:s}),children:[(0,s.jsx)(a.P,{className:"flex-1",children:(0,s.jsx)(a.U,{placeholder:r.settings?.ai?.selectInstance||"Select Instance"})}),(0,s.jsx)(a.r,{children:o.map(e=>(0,s.jsx)(a.T,{value:e.id,children:e.name},e.id))})]}),o.length>1&&(0,s.jsx)(t.f,{type:"button",variant:"outline",size:"icon",onClick:p,className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,s.jsx)(E.f,{className:"h-4 w-4"})})]}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:r.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),o.length>=10&&(0,s.jsx)("p",{className:"text-xs text-amber-600",children:r.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),d&&(0,s.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(n.f,{children:[r.settings?.ai?.instanceName||"Instance Name"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(x.f,{value:d.name||"",onChange:e=>m("name",e.target.value),placeholder:"e.g. GLM-4V",className:d.name?.trim()?"":"border-destructive"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(I.f,{label:(0,s.jsxs)(s.Fragment,{children:["API Key ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(z.f,{value:d.apiKey||"",onChange:e=>m("apiKey",e.target.value),placeholder:"sk-...",className:d.apiKey?.trim()?"":"border-destructive"})]}),(0,s.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,s.jsxs)(n.f,{children:["Base URL ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(x.f,{value:d.baseUrl||"",onChange:e=>m("baseUrl",e.target.value),placeholder:"https://api.openai.com/v1",className:d.baseUrl?.trim()?"":"border-destructive"})]}),(0,s.jsx)(M.f,{provider:"openai",apiKey:d.apiKey,baseUrl:d.baseUrl,currentModel:d.model,onModelChange:e=>m("model",e),docsHref:l?.models})]})]})}function T({provider:e}){let{t:i}=(0,v.b)(),t=i.settings.ai.providerDocs,n=(0,A.f)(e);if(!n)return null;let a=[n.cn&&{href:n.cn,label:n.intl?t.cn:t.official},n.intl&&{href:n.intl,label:n.cn?t.intl:t.official}].filter(e=>!!e);return(0,s.jsxs)("p",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{children:t.title}),a.map(e=>(0,s.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[e.label,(0,s.jsx)(d.f,{className:"h-3 w-3"})]},e.href))]})}var F=e.i(128093);function L({provider:e,value:i,onChange:t}){let{t:a}=(0,v.b)(),r=F.$[e],l=(e,s)=>t({...i,[e]:s}),o={qwen:a.settings?.ai?.qwenBaseUrlHint,stepfun:a.settings?.ai?.stepfunBaseUrlHint,volcengine:a.settings?.ai?.volcengineBaseUrlHint,"volcengine-agent":a.settings?.ai?.volcengineAgentBaseUrlHint,"volcengine-coding":a.settings?.ai?.volcengineCodingBaseUrlHint};return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:["volcengine-free"===e&&(0,s.jsxs)("div",{className:"rounded-md border border-green-200 bg-green-50 p-3 text-xs text-green-800 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",children:[(0,s.jsx)("p",{className:"font-medium",children:a.settings.ai.volcengineFree.title}),(0,s.jsx)("p",{className:"mt-1",children:a.settings.ai.volcengineFree.body})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(I.f,{label:"API Key",href:r.docs.apiKey,linkText:a.settings.ai.docLinks.apiKey}),(0,s.jsx)(z.f,{value:i?.apiKey||"",onChange:e=>l("apiKey",e.target.value),placeholder:"sk-..."}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,s.jsx)("a",{href:r.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:r.consoleUrl})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:"Base URL (Optional)"}),(0,s.jsx)(x.f,{value:i?.baseUrl||"",onChange:e=>l("baseUrl",e.target.value),placeholder:r.baseUrl}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:o[e]??a.settings?.ai?.vendorBaseUrlHint})]}),(0,s.jsx)(M.f,{provider:e,apiKey:i?.apiKey,baseUrl:i?.baseUrl,currentModel:i?.model||r.model,onModelChange:e=>l("model",e),docsHref:r.docs.models})]})}e.s(["f",0,function({config:e,setConfig:d,loading:m,saving:p,onSave:u}){let{t:h,language:x}=(0,v.b)();return m?(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsx)(i.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,s.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:h.settings?.tabs?.ai||"AI Provider"}),(0,s.jsxs)(a.d,{value:e.aiProvider,onValueChange:e=>d(s=>({...s,aiProvider:e})),children:[(0,s.jsx)(a.P,{children:(0,s.jsx)(a.U,{})}),(0,s.jsxs)(a.r,{children:[(0,s.jsx)(a.T,{value:"minimax",children:(0,F.z)("minimax",x)}),(0,s.jsx)(a.T,{value:"minimax-code",children:"MiniMax Code OAuth"}),F.U.filter(e=>"minimax"!==e).map(e=>(0,s.jsx)(a.T,{value:e,children:(0,F.z)(e,x)},e)),(0,s.jsx)(a.T,{value:"anthropic",children:"Anthropic / Compatible"}),(0,s.jsx)(a.T,{value:"azure",children:"Azure OpenAI"}),(0,s.jsx)(a.T,{value:"openai",children:"OpenAI / Compatible"}),(0,s.jsx)(a.T,{value:"gemini",children:"Google Gemini"})]})]}),(0,s.jsx)(T,{provider:e.aiProvider})]}),"openai"===e.aiProvider&&(0,s.jsx)(R,{value:e.openai,onChange:e=>d(s=>({...s,openai:e}))}),"gemini"===e.aiProvider&&(0,s.jsx)(c.f,{value:e.gemini,onChange:e=>d(s=>({...s,gemini:e}))}),"minimax-code"===e.aiProvider&&(0,s.jsx)(K,{value:e.minimaxCode,onChange:e=>d(s=>({...s,minimaxCode:e}))}),"anthropic"===e.aiProvider&&(0,s.jsx)(l.f,{value:e.anthropic,onChange:e=>d(s=>({...s,anthropic:e}))}),(0,F.j)(e.aiProvider)&&(0,s.jsx)(L,{provider:e.aiProvider,value:e[e.aiProvider],onChange:e=>d(s=>({...s,[s.aiProvider]:e}))},e.aiProvider),"azure"===e.aiProvider&&(0,s.jsx)(o.f,{value:e.azure,onChange:e=>d(s=>({...s,azure:e}))}),(0,s.jsx)(r.f,{config:e,saving:p,saveButton:(0,s.jsxs)(t.f,{onClick:u,disabled:p,className:"flex-1",children:[p&&(0,s.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}),h.settings?.ai?.save||"Save AI Settings"]})})]})}],10038),e.s(["f",0,function(e,s){if(!(0,y.L)(e.timeZone??y.J))return s.settings.general.invalidTimeZone;if("openai"===e.aiProvider)for(let i of e.openai?.instances||[]){if(!i.name?.trim())return s.settings?.ai?.validationNameRequired||"Instance name is required";if(!i.apiKey?.trim())return s.settings?.ai?.validationApiKeyRequired||"API Key is required";if(!i.baseUrl?.trim())return s.settings?.ai?.validationBaseUrlRequired||"Base URL is required";if(!i.model?.trim())return s.settings?.ai?.validationModelRequired||"Model name is required"}if("azure"===e.aiProvider){if(!e.azure?.endpoint?.trim())return s.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(!e.azure?.deploymentName?.trim())return s.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required";if(!e.azure?.apiKey?.trim())return s.settings?.ai?.validationApiKeyRequired||"API Key is required"}return null}],835467)},459649,464034,434901,62189,118585,75977,97923,e=>{var s=e.i(843476),i=e.i(793479),t=e.i(37038),n=e.i(110204),a=e.i(271645),r=e.i(519455),l=e.i(967489),o=e.i(482022),c=e.i(741120),d=e.i(632781),m=e.i(41931),p=e.i(111110),u=e.i(128093),h=e.i(201276);function x({provider:e,apiKey:t,baseUrl:f,currentModel:g,onModelChange:v,docsHref:j}){let{t:y}=(0,p.b)(),[b,N]=(0,a.useState)([]),[k,w]=(0,a.useState)(!1),[C,S]=(0,a.useState)(null),[U,K]=(0,a.useState)(g||""),[P,E]=(0,a.useState)(!1),[M,I]=(0,a.useState)(g);g!==M&&(I(g),K(g||""));let z=async()=>{if(!t)return void S(y.modelSelector?.enterApiKeyFirst||"Please enter API Key first");w(!0),S(null);try{let s=await m.k.post("/api/ai/models",{provider:e,apiKey:t,...f&&{baseUrl:f}});if("error"in s&&"string"==typeof s.error){S(s.error),E(!0),N([]);return}N(s.models),0===s.models.length&&(S(y.modelSelector?.noVisionModel||"No vision model found, please enter manually"),E(!0))}catch(s){h.V.error("[ModelSelector]","Failed to fetch models",{error:s});let e=s instanceof Error&&s.message||y.modelSelector?.fetchFailed||"Failed to fetch models";S(e+(y.modelSelector?.enterManually||", please enter manually")),E(!0)}finally{w(!1)}};return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.f,{className:"flex-1",children:y.modelSelector?.modelName||"Model Name"}),j&&(0,s.jsxs)("a",{href:j,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[y.settings.ai.docLinks.models,(0,s.jsx)(o.f,{className:"h-3 w-3"})]}),(0,s.jsx)(r.f,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:k||!t,children:k?(0,s.jsx)(d.f,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(c.f,{className:"h-3 w-3"})})]}),C&&(0,s.jsx)("p",{className:"text-xs text-yellow-600",children:C}),P||0===b.length?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(i.f,{value:U,onChange:e=>{var s;K(s=e.target.value),v(s)},placeholder:(0,u.j)(e)?u.$[e].model:"openai"===e?"gpt-6.1-sol":"gemini-1.5-flash"}),b.length>0&&(0,s.jsx)(r.f,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>E(!1),children:y.modelSelector?.selectFromList||"Select from List"})]}):(0,s.jsx)("div",{className:"space-y-2",children:(0,s.jsxs)(l.d,{value:g,onValueChange:e=>{"_custom"===e?E(!0):(E(!1),K(e),v(e))},children:[(0,s.jsx)(l.P,{children:(0,s.jsx)(l.U,{placeholder:y.modelSelector?.selectModel||"Select Model"})}),(0,s.jsxs)(l.r,{children:[b.map(e=>(0,s.jsxs)(l.T,{value:e.id,children:[e.name,e.owned_by&&` (${e.owned_by})`]},e.id)),(0,s.jsx)(l.T,{value:"_custom",children:y.modelSelector?.customInput||"Custom Input..."})]})]})})]})}function f({label:e,href:i,linkText:t}){return i?(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)(n.f,{children:e}),(0,s.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[t,(0,s.jsx)(o.f,{className:"h-3 w-3"})]})]}):(0,s.jsx)(n.f,{children:e})}e.s(["f",0,x],464034),e.s(["f",0,f],434901);let g={openai:{intl:"https://platform.openai.com/docs/api-reference",apiKey:"https://platform.openai.com/docs/quickstart",models:"https://platform.openai.com/docs/models"},anthropic:{intl:"https://docs.anthropic.com/en/api/overview",apiKey:"https://docs.anthropic.com/en/api/getting-started",models:"https://docs.anthropic.com/en/docs/about-claude/models/overview"},azure:{intl:"https://learn.microsoft.com/azure/ai-foundry/openai/reference",apiKey:"https://learn.microsoft.com/azure/ai-foundry/openai/how-to/create-resource",models:"https://learn.microsoft.com/azure/ai-foundry/openai/concepts/models"},gemini:{intl:"https://ai.google.dev/gemini-api/docs",apiKey:"https://ai.google.dev/gemini-api/docs/api-key",models:"https://ai.google.dev/gemini-api/docs/models"}};function v(e){return(0,u.j)(e)?u.$[e].docs:g[e]??null}e.s(["f",0,v],62189),e.s(["f",0,function({value:e,onChange:a}){let{t:r}=(0,p.b)(),l=v("anthropic"),o=(s,i)=>a({...e,[s]:i});return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:"API Key",href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(t.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"sk-ant-..."})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:"Base URL (Optional)"}),(0,s.jsx)(i.f,{value:e?.baseUrl||"",onChange:e=>o("baseUrl",e.target.value),placeholder:"https://api.anthropic.com"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r.settings?.ai?.anthropicBaseUrlHint})]}),(0,s.jsx)(x,{provider:"anthropic",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>o("model",e),docsHref:l?.models})]})}],459649),e.s(["f",0,function({value:e,onChange:a}){let{t:r}=(0,p.b)(),l=v("azure"),o=(s,i)=>a({...e,[s]:i}),c=e=>e?.trim()?"":"border-destructive";return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(n.f,{children:[r.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(i.f,{value:e?.endpoint||"",onChange:e=>o("endpoint",e.target.value),placeholder:r.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:c(e?.endpoint)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:(0,s.jsxs)(s.Fragment,{children:[r.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.models,linkText:r.settings.ai.docLinks.models}),(0,s.jsx)(i.f,{value:e?.deploymentName||"",onChange:e=>o("deploymentName",e.target.value),placeholder:r.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:c(e?.deploymentName)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:(0,s.jsxs)(s.Fragment,{children:["API Key ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(t.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:c(e?.apiKey)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:r.settings?.ai?.azureApiVersion||"API Version"}),(0,s.jsx)(i.f,{value:e?.apiVersion||"",onChange:e=>o("apiVersion",e.target.value),placeholder:r.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:r.settings?.ai?.azureModel||"Model Display Name"}),(0,s.jsx)(i.f,{value:e?.model||"",onChange:e=>o("model",e.target.value),placeholder:"gpt-4o"})]})]})}],118585),e.s(["f",0,function({value:e,onChange:a}){let{t:r}=(0,p.b)(),l=v("gemini"),o=(s,i)=>a({...e,[s]:i});return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(f,{label:"API Key",href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,s.jsx)(t.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"AIza..."})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(n.f,{children:"Base URL (Optional)"}),(0,s.jsx)(i.f,{value:e?.baseUrl||"",onChange:e=>o("baseUrl",e.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,s.jsx)(x,{provider:"gemini",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>o("model",e),docsHref:l?.models})]})}],75977);var j=e.i(456420);let y={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};y.node;let b=(0,j.f)(y);e.s(["f",0,b],97923)},37038,e=>{var s=e.i(843476),i=e.i(271645),t=e.i(772382),n=e.i(580860),a=e.i(519455),r=e.i(793479),l=e.i(111110),o=e.i(975157);e.s(["f",0,function({className:e,...c}){let{t:d}=(0,l.b)(),[m,p]=(0,i.useState)(!1);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(r.f,{type:m?"text":"password",className:(0,o.f)("pr-10",e),...c}),(0,s.jsx)(a.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>p(!m),"aria-label":m?d.common.hidePassword:d.common.showPassword,tabIndex:-1,children:m?(0,s.jsx)(n.f,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(t.f,{className:"h-4 w-4 text-muted-foreground"})})]})}])}])})();
@@ -1 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,518515,e=>{var t=e.i(456420);let a={name:"camera",size:24,node:[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]};a.node;let r=(0,t.f)(a);e.s(["f",0,r],518515)},325597,7891,e=>{var t=e.i(456420);let a={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};a.node;let r=(0,t.f)(a);e.s(["f",0,r],7891),e.s(["f",0,r],325597)},747819,430634,576019,847483,e=>{var t=e.i(843476),a=e.i(271645),r=e.i(522016),s=e.i(548161),i=e.i(632781),n=e.i(395925),l=e.i(583967),o=e.i(519455),c=e.i(515288),d=e.i(111110),u=e.i(201276),p=e.i(116331);let m=e=>new Promise(t=>setTimeout(t,e));async function f(e,t){for(;;){if("hidden"!==document.visibilityState){let a=await (0,p.h)(e);if(t(a),"analyzing"!==a.status&&"saving"!==a.status)return a}await m(2500)}}async function g(e,t,a){let r=[...e],s=async()=>{for(;r.length>0;)await a(r.shift())};await Promise.all(Array.from({length:Math.min(t,r.length)},s))}function h({item:e}){let{t:a}=(0,d.b)(),r=a.batchImport.status[e.status];return"success"===e.status?(0,t.jsxs)("span",{className:"flex items-start gap-1 text-green-700 dark:text-green-300",children:[(0,t.jsx)(s.f,{className:"h-4 w-4 shrink-0 mt-0.5"}),e.imported?.duplicate?a.importFlow.duplicate:r]}):"failed"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-destructive",children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),r]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:["pending"!==e.status&&(0,t.jsx)(i.f,{className:"h-4 w-4 animate-spin"}),r]})}e.s(["f",0,function({images:e,subjectId:s,onClose:i}){let{t:l,language:m}=(0,d.b)(),[x,y]=(0,a.useState)(()=>e.map(()=>({status:"pending"}))),v=(0,a.useRef)(!1),b=(0,a.useRef)([]),w=(0,a.useCallback)((e,t)=>{y(a=>a.map((a,r)=>r===e?{...a,...t}:a))},[]),j=(0,a.useCallback)((e,t)=>{let a=t?.data,r=a?.message||(t instanceof Error?t.message:String(t)),s=l.errors[r];w(e,{status:"failed",error:"string"==typeof s?s:r}),u.V.error("[BatchImport]","Question import failed",{index:e,error:r})},[l.errors,w]),k=(0,a.useCallback)(async t=>{w(t,{status:"uploading",error:void 0});try{let a=b.current[t];if(a)await (0,p.R)(a);else{let a=e[t],r=await (0,p.S)({imageBase64:a.dataUrl,language:m,subjectId:s,targetSubjectId:s,mode:"auto",clientTimings:a.timings,imageInfo:a.info});b.current[t]=r.id,w(t,{taskId:r.id})}return w(t,{status:"analyzing"}),!0}catch(e){return j(t,e),!1}},[e,m,s,w,j]),N=(0,a.useCallback)(async e=>{let t=b.current[e];if(t)try{let a=await f(t,t=>w(e,{status:"saving"===t.status?"saving":"analyzing"}));if("saved"!==a.status||!a.errorItemId)throw{data:{message:a.error||"QUESTION_SAVE_FAILED"}};(0,p.N)(t).catch(()=>void 0),w(e,{status:"success",imported:{id:a.errorItemId,shortId:a.errorItemShortId,subjectId:s??null,notebookName:a.notebookName,duplicate:a.duplicate}})}catch(t){j(e,t)}},[s,w,j]),D=(0,a.useCallback)(async e=>{let t=[];await g(e,2,async e=>{await k(e)&&t.push(e)}),await Promise.all(t.map(N))},[k,N]),S=(0,a.useCallback)(async e=>{await k(e)&&await N(e)},[k,N]);(0,a.useEffect)(()=>{v.current||(v.current=!0,D(e.map((e,t)=>t)))},[e,D]);let E=x.filter(e=>"success"===e.status).length,C=x.flatMap((e,t)=>"failed"===e.status?[t]:[]),I=x.some(e=>"pending"===e.status||"uploading"===e.status||"analyzing"===e.status||"saving"===e.status),A=x.some(e=>"pending"===e.status||"uploading"===e.status),T=x.filter(e=>e.taskId&&"uploading"!==e.status).length;return(0,t.jsxs)(c.N,{children:[(0,t.jsxs)(c.Y,{className:"flex flex-row items-center justify-between gap-2 space-y-0",children:[(0,t.jsx)(c.v,{className:"text-base",children:l.batchImport.title}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:l.batchImport.summary.replace("{done}",String(E)).replace("{total}",String(x.length)).replace("{failed}",String(C.length))})]}),(0,t.jsxs)(c.O,{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"batch-upload-progress",children:A?l.batchImport.uploaded.replace("{done}",String(T)).replace("{total}",String(x.length)):I?l.importTasks.uploadedHint:null}),(0,t.jsx)("ul",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:x.map((a,s)=>(0,t.jsxs)("li",{className:"flex gap-3 rounded-lg border p-3",children:[(0,t.jsx)("img",{src:e[s].dataUrl,alt:"",className:"h-20 w-20 shrink-0 rounded object-contain bg-muted"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1 text-sm",children:[(0,t.jsx)("div",{className:"font-medium",children:l.batchImport.question.replace("{index}",String(s+1))}),(0,t.jsx)(h,{item:a}),"success"===a.status&&a.imported&&(0,t.jsxs)(r.default,{href:`/error-items/${a.imported.id}`,className:"block truncate text-xs text-primary hover:underline",children:[a.imported.notebookName," · ",a.imported.shortId]}),"failed"===a.status&&(0,t.jsxs)(t.Fragment,{children:[a.error&&(0,t.jsx)("p",{className:"line-clamp-2 text-xs text-destructive",children:a.error}),(0,t.jsxs)(o.f,{size:"sm",variant:"outline",className:"h-7",onClick:()=>S(s),children:[(0,t.jsx)(n.f,{className:"mr-1 h-3 w-3"}),l.batchImport.retry]})]})]})]},s))}),(0,t.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end gap-2",children:[C.length>1&&!I&&(0,t.jsxs)(o.f,{variant:"outline",onClick:()=>D(C),children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),l.batchImport.retryFailed]}),(0,t.jsx)(o.f,{onClick:i,disabled:A,children:l.batchImport.finish})]})]})]})}],747819);var x=e.i(263676);e.s(["f",0,function({imported:e,onDismiss:a}){let{t:i}=(0,d.b)(),n=(e.duplicate?i.importFlow.duplicate:i.importFlow.imported).replace("{notebook}",e.notebookName||"-").replace("{id}",e.shortId||"-");return(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 rounded-lg border border-green-300 dark:border-green-800 bg-green-50 dark:bg-green-950/40 p-3 text-sm text-green-800 dark:text-green-200",role:"status",children:[(0,t.jsxs)("span",{className:"flex items-start gap-2 flex-1",children:[(0,t.jsx)(s.f,{className:"h-4 w-4 mt-0.5 shrink-0"}),n]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,t.jsx)(r.default,{href:`/error-items/${e.id}`,children:(0,t.jsx)(o.f,{size:"sm",variant:"outline",className:"bg-background",children:i.importFlow.viewItem})}),(0,t.jsx)(o.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:a,"aria-label":i.detail.close,children:(0,t.jsx)(x.X,{className:"h-4 w-4"})})]})]})}],430634);var y=e.i(731335),v=e.i(579321),b=e.i(927904);e.s(["f",0,function({task:e,onRefresh:a,onDismiss:s}){let{t:i}=(0,d.b)(),n=(0,v.f)(a),l=(0,b.f)("analyzing"===e.status||"saving"===e.status);return(0,t.jsxs)("div",{className:"space-y-2 rounded-xl border bg-card p-3",role:"status","data-testid":"pending-import-task",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("p",{className:"flex-1 text-sm text-muted-foreground",children:i.importTasks.uploadedHint}),(0,t.jsx)(o.f,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:s,"aria-label":i.common.close,children:(0,t.jsx)(x.X,{className:"h-4 w-4"})})]}),(0,t.jsx)(y.f,{task:e,now:l,onReview:()=>n.openReview(e),onViewItem:()=>n.viewItem(e),onRetry:()=>n.retry(e),onDiscard:async()=>{await n.discard(e)&&s()}}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[i.importTasks.stageEstimate," ·"," ",(0,t.jsx)(r.default,{href:"/import-tasks",className:"text-primary hover:underline",children:i.importTasks.viewTasks})]})]})}],576019);var w=e.i(13285);e.s(["f",0,function({parts:e,busy:a,onFinish:r,onDiscard:s}){let{t:n}=(0,d.b)();return(0,t.jsxs)("section",{className:"space-y-3 rounded-2xl border border-primary/40 bg-primary/5 p-4","data-testid":"question-parts",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,t.jsx)(w.f,{className:"h-4 w-4 text-primary"}),n.upload.parts.title.replace("{count}",String(e.length))]}),(0,t.jsx)("ol",{className:"flex gap-2 overflow-x-auto pb-1",children:e.map((e,a)=>(0,t.jsxs)("li",{className:"shrink-0 text-center text-xs text-muted-foreground",children:[(0,t.jsx)("img",{src:e,alt:n.upload.parts.part.replace("{n}",String(a+1)),className:"h-20 max-w-[8rem] rounded border bg-white object-contain"}),n.upload.parts.part.replace("{n}",String(a+1))]},a))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.upload.parts.hint}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,t.jsxs)(o.f,{onClick:r,disabled:a,className:"sm:flex-1",children:[a?(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(w.f,{className:"mr-2 h-4 w-4"}),n.upload.parts.finish.replace("{count}",String(e.length))]}),(0,t.jsxs)(o.f,{variant:"ghost",onClick:s,disabled:a,children:[(0,t.jsx)(x.X,{className:"mr-1 h-4 w-4"}),n.upload.parts.discard]})]})]})}],847483)},717448,798469,956738,185592,267275,e=>{var t=e.i(843476),a=e.i(271645),r=e.i(13285),s=e.i(632781),i=e.i(325597),n=e.i(328623),l=e.i(519455),o=e.i(515288),c=e.i(110204),d=e.i(624687),u=e.i(111110),p=e.i(825624);e.s(["f",0,function({onSubmit:e,isAnalyzing:m,defaultNotebookName:f,onCreateBatch:g,creatingBatch:h=!1}){let{t:x}=(0,u.b)(),[y,v]=(0,a.useState)(""),b=(0,a.useDeferredValue)(y),w=(0,a.useMemo)(()=>g&&b.trim()?(0,p.J)(b):null,[b,g]),j=w?.detected?w.candidateCount:0,k=w?.ambiguous?w.candidateCount:0,N=y.length>p.i,D=m||h,S=y.trim(),E=async()=>{S&&await e(S)},C=async(e,t=!1)=>{S&&g&&!N&&await g(y,e,t)},I=e=>g&&S?(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)(l.f,{variant:"link",size:"sm",onClick:()=>C("ai"),disabled:D||N,className:"h-auto whitespace-normal",children:[h?(0,t.jsx)(s.f,{className:"mr-1 h-3 w-3 animate-spin"}):(0,t.jsx)(r.f,{className:"mr-1 h-3 w-3"}),h?x.app.creatingBatch:e]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x.app.aiSplitHint})]}):null;return(0,t.jsx)(o.N,{className:"rounded-2xl",children:(0,t.jsxs)(o.O,{className:"space-y-4 p-6",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(i.f,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:x.app?.textInputHint||"Enter question text"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(c.f,{htmlFor:"question-text",children:x.editor?.question||"Question Text"}),(0,t.jsx)(d.f,{id:"question-text",value:y,onChange:e=>v(e.target.value),onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),S&&!D&&(j>1&&!N?C("local"):E()))},placeholder:x.app?.textInputPlaceholder||"Paste or type question text here...",className:"min-h-[200px] resize-y font-mono text-sm",disabled:D})]}),f&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[x.notebooks?.title||"My Notebooks",": ",f]}),g&&N&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:x.app.textTooLong}),j>1?(0,t.jsxs)("div",{className:"space-y-2","data-testid":"multi-detected",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[(0,t.jsx)(r.f,{className:"h-4 w-4"}),x.app.multiDetected.replace("{count}",String(j))]}),(w?.overflow??0)>0&&(0,t.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:x.app.overflowHint.replace("{count}",String(w?.overflow))}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,t.jsxs)(l.f,{onClick:()=>C("local"),disabled:D||N,size:"lg",className:"flex-1 bg-gradient-to-r from-indigo-600 to-violet-500 font-medium text-white hover:from-indigo-700 hover:to-violet-600",children:[h?(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(r.f,{className:"mr-2 h-4 w-4"}),h?x.app.creatingBatch:x.app.splitPreview.replace("{count}",String(Math.min(j,60)))]}),(0,t.jsxs)(l.f,{onClick:E,disabled:D,size:"lg",variant:"outline",children:[m?(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),m?x.editor?.reanswering||"AI solving...":x.app.solveAsOne]})]}),I(x.app.aiSplitMulti)]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.f,{onClick:E,disabled:!S||D,className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 font-medium text-white hover:from-indigo-700 hover:to-violet-600",size:"lg",children:m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),x.editor?.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),x.app?.aiSolve||"AI Solve"]})}),k>1&&(0,t.jsxs)("div",{className:"space-y-1 rounded-lg bg-muted/60 p-3 text-center","data-testid":"sub-questions-hint",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x.app.subQuestionsHint.replace("{count}",String(k))}),(0,t.jsxs)(l.f,{variant:"outline",size:"sm",onClick:()=>C("local",!0),disabled:D||N,children:[(0,t.jsx)(r.f,{className:"mr-1 h-3 w-3"}),x.app.splitAnyway.replace("{count}",String(k))]})]}),I(x.app.aiSplit)]}),(0,t.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:x.app?.textInputTip||"After entering the question, AI will automatically solve and generate analysis"})]})})}],717448);let m=new Map([["avif","image/avif"],["bmp","image/bmp"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["gif","image/gif"],["gz","application/gzip"],["htm","text/html"],["html","text/html"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","application/javascript"],["json","application/json"],["md","text/markdown"],["mjs","application/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["ogg","audio/ogg"],["pdf","application/pdf"],["png","image/png"],["ppt","application/powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["svg","image/svg+xml"],["tif","image/tiff"],["tiff","image/tiff"],["txt","text/plain"],["wasm","application/wasm"],["wav","audio/x-wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["zip","application/zip"]]);var f=class extends Error{constructor(e){super("DataTransferItem is not a file"),this.item=e,this.name="UnexpectedObjectError"}};function g(e,t,a){let{webkitRelativePath:r}=e,s="string"==typeof t?t:"string"==typeof r&&r.length>0?r:`./${e.name}`;return"string"!=typeof e.path&&h(e,"path",s),void 0!==a&&Object.defineProperty(e,"handle",{value:a,writable:!1,configurable:!1,enumerable:!0}),h(e,"relativePath",s),e}function h(e,t,a){Object.defineProperty(e,t,{value:a,writable:!1,configurable:!1,enumerable:!0})}let x=[".DS_Store","Thumbs.db"];async function y(e,{mimeTypes:t=m}={}){return(await v(e)).map(e=>"path"in e?function(e,t=m){let{name:a}=e;if(a&&-1!==a.lastIndexOf(".")&&!e.type){let r=a.split(".").pop().toLowerCase(),s=t.get(r);s&&Object.defineProperty(e,"type",{value:s,writable:!1,configurable:!1,enumerable:!0})}return e}(e,t):e)}async function v(e){var t,a,r;if(b(e)&&b(e.dataTransfer))return j(e.dataTransfer,e.type);if(b(t=e)&&b(t.clipboardData)){let t;return k(((t=N((a=e.clipboardData).items).filter(e=>"file"===e.kind).map(e=>e.getAsFile()).filter(e=>null!==e)).length>0?t:N(a.files)).map(e=>g(e)))}if(b(r=e)&&b(r.target))return N(e.target.files).map(e=>g(e));return Array.isArray(e)&&e.every(e=>"getFile"in e&&"function"==typeof e.getFile)?w(e):[]}function b(e){return"object"==typeof e&&null!==e}async function w(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>g(e))}async function j(e,t){let a=N(e.items).filter(e=>"file"===e.kind);return"drop"!==t?a:k(function e(t){let a=[];for(let r of t)Array.isArray(r)?a.push(...e(r)):a.push(r);return a}(await Promise.all(a.map(D))))}function k(e){return e.filter(e=>-1===x.indexOf(e.name))}function N(e){return null===e?[]:Array.from(e)}async function D(e){if("function"!=typeof e.webkitGetAsEntry)return S(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let a=await E(e);return a?.kind==="directory"?C(a,`/${a.name}`):A(t)}return S(e,t)}async function S(e,t){let a=e.getAsFile(),r=await E(e);if(null!=r){let e=a??await r.getFile();return e.handle=r,g(e)}if(!a)throw new f(e);return g(a,t?.fullPath??void 0)}async function E(e){if(globalThis.isSecureContext&&"function"==typeof e.getAsFileSystemHandle)return e.getAsFileSystemHandle()}async function C(e,t){let a=[];for await(let r of e.values()){let e=`${t}/${r.name}`;if("directory"===r.kind)a.push(...await C(r,e));else{let t=await r.getFile();a.push(g(t,e,r))}}return a}async function I(e){return e.isDirectory?A(e):T(e)}function A(e){let t=e.createReader();return new Promise((e,a)=>{let r=[];!function s(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(I));r.push(e),s()}else try{e(await Promise.all(r))}catch(e){a(e)}},e=>{a(e)})}()})}async function T(e){return new Promise((t,a)=>{e.file(a=>{t(g(a,e.fullPath))},e=>{a(e)})})}let F=function(e,t){if(e&&t){let a=(Array.isArray(t)?t:t.split(",")).filter(e=>""!==e.trim());if(0===a.length)return!0;let r=e.name||"",s=(e.type||"").toLowerCase(),i=s.replace(/\/.*$/,"");return a.some(e=>{let t=e.trim().toLowerCase();return"."===t.charAt(0)?r.toLowerCase().endsWith(t):t.endsWith("/*")?i===t.replace(/\/.*$/,""):s===t})}return!0},P=["KB","MB","GB","TB","PB"];function z(e){if(e<1024)return`${e} ${1===e?"byte":"bytes"}`;let t=e/1024,a=0;for(;t>=1024&&a<P.length-1;)t/=1024,a++;return`${Number(t.toFixed(2))} ${P[a]}`}function R(e){return{code:"file-too-large",message:`File is larger than ${z(e)}`}}function M(e){return{code:"file-too-small",message:`File is smaller than ${z(e)}`}}let U={code:"too-many-files",message:"Too many files"};function O(e,t){let a="application/x-moz-file"===e.type||F(e,t??"")||""===e.type&&"function"==typeof e.getAsFile;return[a,a?null:function(e=""){let t=e.split(","),a=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:"file-invalid-type",message:`File type must be ${a}`}}(t)]}function $(e,t,a){if(B(e.size)){if(B(t)&&B(a)){if(e.size>a)return[!1,R(a)];if(e.size<t)return[!1,M(t)]}else if(B(t)&&e.size<t)return[!1,M(t)];else if(B(a)&&e.size>a)return[!1,R(a)]}return[!0,null]}function B(e){return null!=e}function V(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function L(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>"Files"===e||"application/x-moz-file"===e)||Array.prototype.some.call(t.items??[],H):!!e.target&&!!e.target.files}function H(e){return"object"==typeof e&&null!==e&&"file"===e.kind}function q(e){e.preventDefault()}function W(...e){return(t,...a)=>e.some(e=>(!V(t)&&e&&e(t,...a),V(t)))}function G(e){return Array.isArray(e)?e:"string"==typeof e?[e]:[]}function Z(e){if(B(e))return Array.isArray(e)?e.filter(e=>B(e)&&B(e.accept)):[{accept:e}]}function _(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(B(e))return Object.entries(e).reduce((e,[a,r])=>{let s=G(r);return t&&a.endsWith("/*")&&s.some(X)?e.push(...s):e.push(a,...s),e},[]).filter(e=>K(e)||X(e)).join(",")}function K(e){return"audio/*"===e||"video/*"===e||"image/*"===e||"text/*"===e||"application/*"===e||/\w+\/[-+.\w]+/g.test(e)}function X(e){return/^.*\.[\w]+$/.test(e)}(0,a.forwardRef)(({children:e,...r},s)=>{let{open:i,...n}=Y(r);return(0,a.useImperativeHandle)(s,()=>({open:i}),[i]),(0,t.jsx)(t.Fragment,{children:e?.({...n,open:i})})}).displayName="Dropzone";let Q={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function Y(e={}){let{accept:t,disabled:r=!1,getFilesFromEvent:s=y,maxSize:i=1/0,minSize:n=0,multiple:l=!0,maxFiles:o=0,onDragEnter:c,onDragLeave:d,onDragOver:u,onDrop:p,onDropAccepted:m,onDropRejected:f,onFileDialogCancel:g,onFileDialogOpen:h,useFsAccessApi:x=!1,autoFocus:v=!1,preventDropOnDocument:b=!0,noClick:w=!1,noKeyboard:j=!1,noDrag:k=!1,noDragEventsBubbling:N=!1,noPaste:D=!1,onError:S,validator:E,getErrorMessage:C}=e,I=(0,a.useMemo)(()=>(function(e){let t=Z(e);if(!B(t))return;let a={};for(let e of t)for(let[t,r]of Object.entries(e.accept)){let e=a[t]??(a[t]=[]);for(let t of G(r))e.includes(t)||e.push(t)}return a})(t),[t]),A=(0,a.useMemo)(()=>_(I),[I]),T=(0,a.useMemo)(()=>_(I,{omitWildcardMimeTypesWithExtensions:!0}),[I]),F=(0,a.useMemo)(()=>(function(e){let t=Z(e);if(!B(t))return;let a=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let a=!0;return K(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),a=!1),(Array.isArray(t)||"string"==typeof t)&&G(t).every(X)||(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),a=!1),a}).reduce((e,[t,a])=>(e[t]=G(a),e),{});return{description:B(e.description)&&""!==e.description?e.description:function(e){let t=[],a=Object.keys(e);for(let a of Object.values(e))for(let e of G(a))t.includes(e)||t.push(e);return t.length>0?t.join(", "):a.length>0?a.join(", "):"Files"}(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return a.length>0?a:void 0})(t),[t]),P=(0,a.useMemo)(()=>"function"==typeof h?h:ee,[h]),z=(0,a.useMemo)(()=>"function"==typeof g?g:ee,[g]),R=(0,a.useRef)(null),M=(0,a.useRef)(null),[H,et]=(0,a.useReducer)(J,Q),{isFocused:ea,isFileDialogActive:er}=H,es=(0,a.useRef)(er);es.current=er;let ei=(0,a.useRef)(null),en=(0,a.useCallback)(()=>{ei.current?.abort();let e=new AbortController;return ei.current=e,et({type:"setProcessing",isProcessing:!0}),e.signal},[]),el=(0,a.useCallback)(e=>{e.aborted||et({type:"setProcessing",isProcessing:!1})},[]);(0,a.useEffect)(()=>()=>ei.current?.abort(),[]);let eo=(0,a.useRef)("u">typeof window&&window.isSecureContext&&x&&"showOpenFilePicker"in window),ec=()=>{!eo.current&&er&&setTimeout(()=>{if(M.current){let{files:e}=M.current;e?.length||(et({type:"closeDialog"}),z())}},300)};(0,a.useEffect)(()=>(window.addEventListener("focus",ec,!1),()=>{window.removeEventListener("focus",ec,!1)}),[M,er,z,eo]);let ed=(0,a.useRef)([]),eu=(0,a.useRef)([]),ep=e=>{R.current&&e.target&&R.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),ed.current=[])};(0,a.useEffect)(()=>(b&&(document.addEventListener("dragover",q,!1),document.addEventListener("drop",ep,!1)),()=>{b&&(document.removeEventListener("dragover",q),document.removeEventListener("drop",ep))}),[R,b]),(0,a.useEffect)(()=>{let e=e=>{e.target&&(eu.current=[...eu.current,e.target]),L(e)&&et({isDragGlobal:!0,type:"setDragGlobal"})},t=e=>{eu.current=eu.current.filter(t=>t!==e.target&&null!==t),eu.current.length>0||et({isDragGlobal:!1,type:"setDragGlobal"})},a=()=>{eu.current=[],et({isDragGlobal:!1,type:"setDragGlobal"})},r=()=>{eu.current=[],et({isDragGlobal:!1,type:"setDragGlobal"})};return document.addEventListener("dragenter",e,!1),document.addEventListener("dragleave",t,!1),document.addEventListener("dragend",a,!1),document.addEventListener("drop",r,!1),()=>{document.removeEventListener("dragenter",e),document.removeEventListener("dragleave",t),document.removeEventListener("dragend",a),document.removeEventListener("drop",r)}},[R]),(0,a.useEffect)(()=>(!r&&v&&R.current&&R.current.focus(),()=>{}),[R,v,r]);let em=(0,a.useCallback)(e=>{S?S(e):console.error(e)},[S]),ef=(0,a.useCallback)(e=>{e.preventDefault(),e.persist?.(),eC(e),!es.current&&(ed.current=[...ed.current,e.target],L(e)&&Promise.resolve(s(e)).then(t=>{if(V(e)&&!N)return;let a=t.length>0?function({files:e,accept:t,minSize:a,maxSize:r,multiple:s,maxFiles:i=0,validator:n,getErrorMessage:l}){let o=[],c=[],d=(e,t)=>l&&"u">typeof File&&t instanceof File?{...e,message:l(e,t)}:e;e.forEach(e=>{let[s,i]=O(e,t),[n,l]=$(e,a,r);s&&n?o.push(e):c.push({file:e,errors:[i,l].filter(e=>null!=e).map(t=>d(t,e))})});let u=s?i>=1?i:1/0:1;return(o.length>u&&o.slice(u).forEach(e=>{c.push({file:e,errors:[d(U,e)]})}),c.length>0)?{verdict:"reject",rejections:c}:{verdict:n?"unknown":"accept",rejections:c}}({files:t,accept:A,minSize:n,maxSize:i,multiple:l,maxFiles:o,validator:E,getErrorMessage:C}):null;et({isDragAccept:a?.verdict==="accept",isDragReject:a?.verdict==="reject",isDragUnknown:a?.verdict==="unknown",isDragActive:!0,dragFileRejections:a?.rejections??[],type:"setDraggedFiles"}),c&&c(e)}).catch(e=>em(e)))},[s,c,em,N,A,n,i,l,o,E,C]),eg=(0,a.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),eC(e),es.current)return!1;let t=L(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch{}return t&&u&&u(e),!1},[u,N]),eh=(0,a.useCallback)(e=>{e.preventDefault(),e.persist?.(),eC(e);let t=ed.current.filter(e=>R.current?.contains(e)),a=t.indexOf(e.target);-1!==a&&t.splice(a,1),ed.current=t,!(t.length>0)&&(et({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),L(e)&&d&&d(e))},[R,d,N]),ex=(0,a.useCallback)(async(e,t,a)=>{let r,s=(e,t)=>C?{...e,message:C(e,t)}:e,c=e=>{let a=[],r=[];e.forEach(({file:e,accepted:t,acceptError:i,sizeMatch:n,sizeError:l,customErrors:o})=>{let c=!o||Array.isArray(o)&&0===o.length;if(t&&n&&c)a.push(e);else{let t=[i,l];o&&(t=t.concat(o)),r.push({file:e,errors:t.filter(e=>null!=e).map(t=>s(t,e))})}});let i=l?o>=1?o:1/0:1;a.length>i&&a.splice(i).forEach(e=>{r.push({file:e,errors:[s(U,e)]})}),et({acceptedFiles:a,fileRejections:r,type:"setFiles"}),p&&p(a,r,t),r.length>0&&f&&f(r,t),a.length>0&&m&&m(a,t)},d=e.map(e=>{let[t,a]=O(e,T),[r,s]=$(e,n,i);return{file:e,accepted:t,acceptError:a,sizeMatch:r,sizeError:s,customErrors:E?E(e):null}});if(!d.some(({customErrors:e})=>null!=e&&"function"==typeof e.then))return void c(d);try{r=await Promise.all(d.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){a.aborted||(el(a),em(e));return}a.aborted||c(r)},[et,l,T,n,i,o,p,m,f,E,C,em,el]),ey=(0,a.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),eC(e),ed.current=[],(!es.current||!e.dataTransfer)&&(et({type:"reset"}),L(e))){let t=en();Promise.resolve(s(e)).then(a=>{if(!t.aborted)return V(e)&&!N?void el(t):ex(a,e,t)}).catch(e=>{t.aborted||(el(t),em(e))})}},[s,ex,em,N,en,el]),ev=(0,a.useCallback)(e=>{if(!L(e))return;e.preventDefault(),e.persist?.(),eC(e);let t=en();Promise.resolve(s(e)).then(a=>{if(!t.aborted)return V(e)&&!N?void el(t):ex(a,e,t)}).catch(e=>{t.aborted||(el(t),em(e))})},[s,ex,em,N,en,el]),eb=(0,a.useCallback)(()=>{if(eo.current){let e;et({type:"openDialog"}),P(),window.showOpenFilePicker({multiple:l,types:F}).then(t=>(e=en(),s(t))).then(t=>{if(et({type:"closeDialog"}),!e.aborted)return ex(t,null,e)}).catch(t=>{(e&&el(e),t instanceof DOMException&&("AbortError"===t.name||t.code===t.ABORT_ERR))?(z(t),et({type:"closeDialog"})):t instanceof DOMException&&("SecurityError"===t.name||t.code===t.SECURITY_ERR)||t instanceof DOMException&&"NotAllowedError"===t.name?(eo.current=!1,M.current?(M.current.value="",M.current.click()):em(Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):em(t)});return}M.current&&(et({type:"openDialog"}),P(),M.current.value="",M.current.click())},[et,P,z,x,ex,em,F,l,en,el]),ew=(0,a.useCallback)(e=>{R.current?.isEqualNode(e.target)&&(" "===e.key||"Enter"===e.key||32===e.keyCode||13===e.keyCode)&&(e.preventDefault(),eb())},[R,eb]),ej=(0,a.useCallback)(()=>{et({type:"focus"})},[]),ek=(0,a.useCallback)(()=>{et({type:"blur"})},[]),eN=(0,a.useCallback)(()=>{w||(function(e=window.navigator.userAgent){return -1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")||-1!==e.indexOf("Edge/")}()?setTimeout(eb,0):eb())},[w,eb]),eD=e=>r?null:e,eS=e=>j?null:eD(e),eE=e=>k?null:eD(e),eC=e=>{N&&e.stopPropagation()},eI=(0,a.useMemo)(()=>({refKey:e="ref",role:t,onKeyDown:a,onFocus:s,onBlur:i,onClick:n,onDragEnter:l,onDragOver:o,onDragLeave:c,onDrop:d,onPaste:u,...p}={})=>{let m;return{onKeyDown:eS(W(a,ew)),onFocus:eS(W(s,ej)),onBlur:eS(W(i,ek)),onClick:eD(W(n,eN)),onDragEnter:eE(W(l,ef)),onDragOver:eE(W(o,eg)),onDragLeave:eE(W(c,eh)),onDrop:eE(W(d,ey)),onPaste:(m=W(u,ev),D?null:eD(m)),role:"string"==typeof t&&""!==t?t:"presentation",[e]:R,...!r&&!j?{tabIndex:0}:{},...r?{"aria-disabled":!0}:{},...p}},[R,ew,ej,ek,eN,ef,eg,eh,ey,ev,j,k,D,r]),eA=(0,a.useCallback)(e=>{e.stopPropagation()},[]),eT=(0,a.useMemo)(()=>({refKey:e="ref",onChange:t,onClick:a,...r}={})=>({accept:T,multiple:l,type:"file","aria-label":"file upload",style:{border:0,display:"block",height:0,margin:0,maxWidth:0,opacity:0,overflow:"hidden",padding:0,width:0},onChange:eD(W(t,ey)),onClick:eD(W(a,eA)),tabIndex:-1,[e]:M,...r}),[M,t,l,ey,r]);return{...H,isFocused:ea&&!r,getRootProps:eI,getInputProps:eT,rootRef:R,inputRef:M,open:eD(eb)}}function J(e,t){switch(t.type){case"focus":return{...e,isFocused:!0};case"blur":return{...e,isFocused:!1};case"openDialog":return{...Q,isFileDialogActive:!0};case"closeDialog":return{...e,isFileDialogActive:!1};case"setDraggedFiles":return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case"setProcessing":return{...e,isProcessing:t.isProcessing};case"setFiles":return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case"setDragGlobal":return{...e,isDragGlobal:t.isDragGlobal};case"reset":return{...Q};default:return e}}function ee(){}var et=e.i(518515),ea=e.i(456420);let er={name:"clipboard-paste",size:24,node:[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]};er.node;let es=(0,ea.f)(er),ei={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};ei.node;let en=(0,ea.f)(ei),el={name:"images",size:24,node:[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]};el.node;let eo=(0,ea.f)(el);var ec=e.i(446513);let ed={name:"cloud-upload",size:24,node:[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],aliases:["upload-cloud"]};ed.node;let eu=(0,ea.f)(ed);var ep=e.i(81968),em=e.i(201276),ef=e.i(294114);let eg=()=>()=>{};function eh(){return(0,a.useSyncExternalStore)(eg,()=>!0,()=>!1)}let ex={"image/*":[".jpg",".jpeg",".png",".webp",".gif",".bmp",".heic",".heif"]};e.s(["f",0,function({onImageSelect:e,isAnalyzing:r}){let{t:i}=(0,u.b)(),[n,c]=(0,a.useState)(!1),d=eh();(0,a.useEffect)(()=>{"Notification"in window&&"default"===Notification.permission&&Notification.requestPermission()},[]);let{getRootProps:p,getInputProps:m,isDragActive:f}=Y({onDrop:(0,a.useCallback)(t=>{let a=t[0];a&&e(a)},[e]),accept:ex,maxFiles:1,disabled:r}),g=function(){let[e,t]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if((0,ep.f)()||"u"<typeof navigator||!navigator.mediaDevices?.enumerateDevices)return;let e=!1;return navigator.mediaDevices.enumerateDevices().then(a=>{e||t(a.some(e=>"videoinput"===e.kind))}).catch(()=>void 0),()=>{e=!0}},[]),e}(),h=(0,a.useRef)(null),x=(0,a.useRef)(null),y=(0,a.useRef)(null),v=t=>{let a=t.target.files?.[0];t.target.value="",a&&e(a)},b=(0,a.useCallback)(t=>{let a=t.type||"image/png",r=a.split("/")[1]||"png";e(t instanceof File&&t.name?t:new File([t],`clipboard-${Date.now()}.${r}`,{type:a}))},[e]);(0,a.useEffect)(()=>{let e=e=>{if(r)return;let t=e.target;if(t&&(t.isContentEditable||["INPUT","TEXTAREA"].includes(t.tagName)))return;let a=Array.from(e.clipboardData?.items??[]).find(e=>"file"===e.kind&&e.type.startsWith("image/")),s=a?.getAsFile();s&&(e.preventDefault(),b(s))};return window.addEventListener("paste",e),()=>window.removeEventListener("paste",e)},[r,b]);let w=async()=>{if(!(d&&"u">typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.read))return void ef.c.warning(i.upload.pasteNotSupported);try{for(let e of(await navigator.clipboard.read())){let t=e.types.find(e=>e.startsWith("image/"));if(t){let a=await e.getType(t);b(a);return}}ef.c.warning(i.upload.pasteNoImage)}catch(e){em.V.warn("[UploadZone]","Clipboard read failed",{error:e instanceof Error?e.message:String(e)}),e instanceof Error&&"NotAllowedError"===e.name?ef.c.warning(i.upload.pastePermissionDenied):ef.c.error(i.upload.pasteFailed)}},j=()=>d&&"u">typeof navigator&&"mediaDevices"in navigator&&"getDisplayMedia"in navigator.mediaDevices,k=async()=>{if(!j())return void ef.c.warning(i.upload.screenshotNotSupported);c(!0);try{let t;"CaptureController"in window&&(t=new window.CaptureController);let a={video:!0,audio:!1,preferCurrentTab:!1};t&&(a.controller=t);let r=await navigator.mediaDevices.getDisplayMedia(a),[s]=r.getVideoTracks(),i=s.getSettings().displaySurface;if(t&&("browser"===i||"window"===i))try{t.setFocusBehavior("no-focus-change"),em.V.info("[UploadZone]","Screenshot focus behavior set to no-change",void 0,{sendToBackend:!1})}catch(e){em.V.warn("[UploadZone]","Unable to set screenshot focus behavior",{error:e})}let n=document.createElement("video");if(n.srcObject=r,n.muted=!0,n.autoplay=!0,n.playsInline=!0,await new Promise((e,t)=>{n.onloadedmetadata=()=>{n.play().then(()=>{e()}).catch(t)},n.onerror=t}),await new Promise(e=>setTimeout(e,500)),0===n.videoWidth||0===n.videoHeight)throw Error("视频没有有效尺寸");let l=document.createElement("canvas");l.width=n.videoWidth,l.height=n.videoHeight;let o=l.getContext("2d");if(!o)throw Error("无法获取canvas上下文");o.drawImage(n,0,0),r.getTracks().forEach(e=>e.stop()),l.toBlob(t=>{t?(e(new File([t],`screenshot-${Date.now()}.png`,{type:"image/png"})),em.V.info("[UploadZone]","Screenshot captured",void 0,{sendToBackend:!1})):ef.c.error("截图转换失败")},"image/png",1)}catch(e){em.V.error("[UploadZone]","Screenshot failed",{error:e}),e instanceof Error&&("NotAllowedError"===e.name?ef.c.warning(i.upload.screenshotPermissionDenied):ef.c.error(`${i.upload.screenshotFailed}: ${e.message}`))}finally{c(!1)}},N=[{key:"camera",icon:et.f,label:i.upload.camera,desc:i.upload.cameraDesc},{key:"album",icon:eo,label:i.upload.album,desc:i.upload.albumDesc},{key:"file",icon:en,label:i.upload.file,desc:i.upload.fileDesc}];return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("input",{ref:h,type:"file",accept:"image/*",capture:"environment",className:"hidden",onChange:v,"data-testid":"camera-input"}),(0,t.jsx)("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:v,"data-testid":"album-input"}),(0,t.jsx)("input",{ref:y,type:"file",className:"hidden",onChange:v,"data-testid":"file-input"}),d&&(0,t.jsx)("div",{className:"hidden grid-cols-3 gap-2 pointer-coarse:grid","data-testid":"image-sources",children:N.map(e=>(0,t.jsxs)(l.f,{type:"button",variant:"outline",onClick:()=>{var t;"camera"===(t=e.key)&&!1===g?ef.c.warning(i.upload.noCamera):({camera:h,album:x,file:y})[t].current?.click()},disabled:r,className:"flex h-auto flex-col gap-1 py-3","aria-description":e.desc,children:[(0,t.jsx)(e.icon,{className:"h-6 w-6"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:e.label})]},e.key))}),(0,t.jsx)(o.N,{...p(),className:`group cursor-pointer rounded-2xl border-2 border-dashed shadow-none transition-all hover:border-primary/60 hover:bg-accent/40 ${f?"border-primary bg-accent/60":"border-border bg-card"}`,children:(0,t.jsxs)(o.O,{className:"flex min-h-[260px] flex-col items-center justify-center space-y-4 py-10 text-center md:min-h-[300px]",children:[(0,t.jsx)("input",{...m()}),(0,t.jsx)("div",{className:"rounded-2xl bg-accent p-4 text-primary transition-transform group-hover:scale-105",children:r?(0,t.jsx)(s.f,{className:"h-10 w-10 animate-spin"}):(0,t.jsx)(eu,{className:"h-10 w-10"})}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:r?i.app.analyzing:i.upload.analyze}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r?i.app.analyzing:i.app.dragDrop}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:i.upload.support})]})]})}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:flex-wrap items-stretch sm:items-start justify-center gap-4",children:[d&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsxs)(l.f,{variant:"outline",onClick:w,disabled:r,className:"flex items-center gap-2 w-full sm:w-auto",children:[(0,t.jsx)(es,{className:"h-4 w-4"}),i.upload.paste]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:i.upload.pasteDesc})]}),j()&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsxs)(l.f,{variant:"outline",onClick:k,disabled:r||n,className:"flex items-center gap-2 w-full sm:w-auto",children:[n?(0,t.jsx)(s.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(ec.f,{className:"h-4 w-4"}),n?i.common.pleaseWait:i.upload.screenshot]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:i.upload.screenshotDesc})]})]})]})}],798469);var ey=e.i(168148),ev=e.i(975157);let eb={reading:3,converting:6,compressing:10,uploading:20,analyzing:50,processing:85,saving:95};function ew({status:e,message:r,className:i,completed:n}){let l,{t:o}=(0,u.b)(),[c]=(0,a.useState)(()=>Date.now()),[d,p]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=setInterval(()=>{p(Math.max(0,Math.floor((Date.now()-c)/1e3)))},1e3);return()=>clearInterval(e)},[c]);let m=eb[e],f=o.common.progress.estimated.replace("{percent}",String(m));return(0,t.jsx)("div",{className:(0,ev.f)("fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",i),children:(0,t.jsx)("div",{className:"w-full max-w-md p-6 space-y-6 bg-card rounded-lg border shadow-lg mx-4",children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-4 text-center",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(s.f,{className:"h-12 w-12 animate-spin text-primary"}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center"})]}),(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold tracking-tight","aria-live":"polite",children:r||o.common.progress[e]}),(0,t.jsx)(ey.f,{value:m,"aria-label":f,"aria-valuetext":f,className:"h-2 w-full"})]}),(0,t.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 text-sm text-muted-foreground tabular-nums",children:[(0,t.jsx)("span",{children:f}),(0,t.jsx)("span",{role:"timer","aria-live":"off",children:o.common.progress.elapsed.replace("{time}",(l=[Math.floor(d/60)%60,d%60],d>=3600&&l.unshift(Math.floor(d/3600)),l.map(e=>String(e).padStart(2,"0")).join(":")))})]}),n&&n.length>0&&(0,t.jsx)("ul",{className:"flex w-full flex-wrap justify-center gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","data-testid":"progress-stages",children:n.map(e=>{var a;return(0,t.jsxs)("li",{children:[e.label," ",(a=e.ms)<1e3?`${Math.round(a)}ms`:`${(a/1e3).toFixed(1)}s`]},e.label)})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.common.progress.estimateHint})]})})})}e.s(["f",0,function({status:e,message:a,className:r,completed:s}){return eh()&&"idle"!==e?(0,t.jsx)(ew,{status:e,message:a,className:r,completed:s}):null}],956738),e.s(["f",0,function({options:e,value:a,onChange:r,className:s}){return(0,t.jsx)("div",{className:(0,ev.f)("grid gap-1 rounded-xl bg-muted p-1",s),style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},role:"tablist",children:e.map(({value:e,label:s,icon:i})=>{let n=e===a;return(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":n,className:(0,ev.f)("flex items-center justify-center gap-1.5 rounded-lg px-2 py-2.5 text-sm font-medium transition-all",n?"bg-card text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>r(e),children:[i&&(0,t.jsx)(i,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:s})]},e)})})}],185592);var ej=e.i(618566),ek=e.i(61425),eN=e.i(41931),eD=e.i(303163),eS=e.i(575557),eE=e.i(116331),eC=e.i(810104),eI=e.i(213761),eA=e.i(62825),eT=e.i(364002),eF=e.i(768339),eP=e.i(752012);e.s(["u",0,4,"w",0,function({logPrefix:e,analyzeSubjectId:t,importSubjectId:r,textNotebook:s,fixedSubjectId:i}){let{t:n,language:l}=(0,u.b)(),o=(0,ej.useRouter)(),c=(0,eP.f)(e),[d,p]=(0,a.useState)(!1),[m,f]=(0,a.useState)("upload"),[g,h]=(0,a.useState)("idle"),[x,y]=(0,a.useState)(null),[v,b]=(0,a.useState)(null),[w,j]=(0,a.useState)(null),[k,N]=(0,a.useState)(null),[D,S]=(0,a.useState)(!1),[E,C]=(0,a.useState)(!1),[I,A]=(0,a.useState)(null),[T,F]=(0,a.useState)(null),[P,z]=(0,a.useState)([]),R=(0,a.useRef)(null),[M,U]=(0,a.useState)([]),[O,$]=(0,a.useState)(null),B=(0,eF.a)(O),V=w?.timeouts?.analyze||18e4,L=V+1e4;(0,a.useEffect)(()=>()=>R.current?.dispose(),[]),(0,a.useEffect)(()=>{(0,eT.x)().then(C),eN.k.get("/api/settings").then(j).catch(t=>em.V.error(e,"Failed to fetch config",{error:t}))},[e]),(0,a.useEffect)(()=>{if("idle"===g)return;let e=setTimeout(()=>{em.V.warn("[Progress]","处理超时,关闭进度提示",{analysisStep:g,safetyTimeout:L}),h("idle")},L);return()=>clearTimeout(e)},[g,L]);let H=async t=>{A(null),c.setSaveError(null),U([]),h("reading");try{let a=await (0,eI.p)(t,()=>h("converting"));R.current?.dispose(),R.current=a,em.V.info(e,"Image decoded",{format:a.format,sourceType:a.sourceType,sourceBytes:a.sourceBytes,width:a.width,height:a.height,decoder:a.decoder,...a.timings}),N(a.previewUrl),S(!0)}catch(r){let a=r instanceof eI.o?n.upload.decodeErrors[r.code].replace("{format}",r.format.toUpperCase()):(0,eD.Z)(r);em.V.warn(e,"Image decode failed",{code:r instanceof eI.o?r.code:"UNKNOWN",format:r instanceof eI.o?r.format:"unknown",sourceType:t.type,sourceBytes:t.size}),ef.c.error(a)}finally{h("idle")}},q=e=>[{label:n.upload.stages.read,ms:e.read??0},...void 0!==e.convert?[{label:n.upload.stages.convert,ms:e.convert}]:[],...void 0!==e.compress?[{label:n.upload.stages.compress,ms:(e.crop??0)+e.compress}]:[]],W=async(e,t)=>{let a=[];for(let r of t){let t=await (0,eI.X)(e,r);a.push({dataUrl:t.dataUrl,info:(0,eI.N)(e,t),timings:{...e.timings,...t.timings}})}return a},G=async t=>{let a;h("compressing");try{let e=await (0,eC.v)(t.map(e=>e.dataUrl)),r=e=>t.reduce((t,a)=>t+a.timings[e],0);a={dataUrl:e.dataUrl,info:{sourceType:`stacked-${t.length}`,sourceBytes:t.reduce((e,t)=>e+(t.info.sourceBytes??0),0),outputWidth:e.width,outputHeight:e.height,outputBytes:e.bytes,quality:e.quality},timings:{read:r("read"),convert:r("convert"),crop:r("crop")+e.timings.crop,compress:r("compress")+e.timings.compress}}}catch(a){em.V.error(e,"Stack parts failed",{parts:t.length,error:(0,eD.Z)(a)}),ef.c.error((0,ek.f)(a,n)),h("idle");return}em.V.info(e,"Question parts stacked",{parts:t.length,width:a.info.outputWidth,height:a.info.outputHeight}),z([]),await X(a)},Z=async t=>{let a=R.current;if(a&&!(P.length>=3)){S(!1),h("compressing");try{let[e]=await W(a,[t]);z(t=>[...t,e]),ef.c.info(n.upload.parts.added.replace("{n}",String(P.length+1)))}catch(t){em.V.error(e,"Crop part failed",{error:(0,eD.Z)(t)}),ef.c.error((0,ek.f)(t,n))}finally{h("idle")}}},_=async(t,a)=>{let r,s=R.current;if(s&&0!==t.length){S(!1),U(q(s.timings)),h("compressing");try{r=await W(s,t)}catch(t){em.V.error(e,"Crop failed",{error:(0,eD.Z)(t)}),ef.c.error((0,ek.f)(t,n)),h("idle");return}if(a){h("idle"),U([]),A(null),c.setSaveError(null),F(r);return}if(P.length>0)return void await G([...P,r[0]]);await X(r[0])}},K=async t=>{if(!E){h("saving");let a=await (0,eT.a)(t,{subjectId:r,imageUrl:null});A(a),b(null),em.V.info(e,"Imported without review",{id:a.id});return}b(null),y(t),f("review")},X=async a=>{let s=Date.now();U(q(a.timings));try{h("uploading");let n=await (0,eE.S)({imageBase64:a.dataUrl,language:l,subjectId:t,targetSubjectId:i??(E?null:r),clientTimings:a.timings,imageInfo:a.info}),o=Date.now()-s;em.V.info(e,"Import task created",{taskId:n.id,...a.info,...a.timings,uploadMs:o}),$(n.id),B.setTask(n),f("upload")}catch(t){em.V.error(e,"Upload failed",{errorDuration:Date.now()-s,error:(0,eD.Z)(t)}),ef.c.error((0,ek.f)(t,n))}finally{h("idle"),U([])}},Q=()=>i??(E?null:r),Y=async(a,r,i=!1)=>{c.setSaveError(null),p(!0);try{let n=await (0,eS.v)({source:"text",splitter:r,forceNumbered:i||void 0,text:a,language:l,subjectId:t??s?.id,targetSubjectId:Q()});em.V.info(e,"Text batch created",{batchId:n.id,splitter:r,questions:n.itemCount}),o.push(`/import-batches/${n.id}`)}catch(t){em.V.error(e,"Text batch failed",{error:(0,eD.Z)(t)}),ef.c.error((0,ek.f)(t,n))}finally{p(!1)}},J=async a=>{let r=R.current;if(r){S(!1),U(q(r.timings)),h("compressing");try{let s=await (0,eI.X)(r,a);U(q({...r.timings,...s.timings})),h("uploading");let i=await (0,eS.v)({source:"image",imageBase64:s.dataUrl,imageInfo:(0,eI.N)(r,s),language:l,subjectId:t,targetSubjectId:Q()});em.V.info(e,"Image batch created",{batchId:i.id,...(0,eI.N)(r,s)}),o.push(`/import-batches/${i.id}`)}catch(t){em.V.error(e,"Image batch failed",{error:(0,eD.Z)(t)}),ef.c.error((0,ek.f)(t,n))}finally{h("idle"),U([])}}},ee=async t=>{c.setSaveError(null);let a=Date.now();em.V.info(e,"Starting text-based analysis",{textLength:t.length});try{h("analyzing");let r=await eN.k.post("/api/reanswer",{questionText:t,language:l,forImport:!0,subject:s?.name,subjectId:s?.id},{timeout:V,recoverable:!0});h("processing"),await K({questionText:t,answerText:r.answerText,analysis:r.analysis,knowledgePoints:r.knowledgePoints||[],wrongAnswerText:r.wrongAnswerText||"",mistakeAnalysis:r.mistakeAnalysis||"",mistakeStatus:(0,eA.h)(r.mistakeStatus),subject:r.subject||"其他",requiresImage:!1,difficultyStars:r.difficultyStars??null,gradeSemester:r.gradeSemester??null}),em.V.info(e,"Text analysis completed",{totalDuration:Date.now()-a})}catch(t){em.V.error(e,"Text analysis failed",{errorDuration:Date.now()-a,error:(0,eD.Z)(t)}),ef.c.error((0,ek.f)(t,n))}finally{h("idle")}},et=e=>c.run(()=>eN.k.post("/api/error-items",e),e.subjectId),ea=async e=>{await et({...e,originalImageUrl:v||"",...i?{subjectId:i}:{}})&&(f("upload"),y(null),b(null))};return{step:m,cancelReview:()=>{f("upload"),c.setSaveError(null)},saveError:c.saveError,dismissSaveError:c.dismissSaveError,analysisStep:g,setAnalysisStep:h,isBusy:"idle"!==g,parsedData:x,currentImage:v,aiTimeout:V,croppingImage:k,isCropperOpen:D,closeCropper:()=>S(!1),lastImported:I,dismissImported:()=>A(null),batchImages:T,closeBatch:()=>F(null),completedStages:M,pendingTask:O?B.task:null,refreshPendingTask:B.refresh,dismissPendingTask:()=>$(null),selectImage:H,cropRegions:_,submitText:ee,saveQuestion:et,saveReviewed:ea,createTextBatch:Y,autoSplitImage:J,creatingBatch:d,parts:P,addPart:Z,finishParts:()=>G(P),discardParts:()=>z([])}}],267275)}])})();
@@ -1 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let r={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],711241)},952801,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(522016),a=e.i(215519),n=e.i(306831),i=e.i(226091),l=e.i(77071),d=e.i(519455),c=e.i(515288),o=e.i(912505),m=e.i(393842),u=e.i(86963),x=e.i(618566),f=e.i(632781),h=e.i(994533),p=e.i(257428),g=e.i(793479),b=e.i(110204),j=e.i(574041),v=e.i(111110);let y=["generate","original"];function k({value:e,onChange:r}){let{t:s}=(0,v.b)();return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:s.exam.modeLabel}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",role:"group","aria-label":s.exam.modeLabel,children:y.map(a=>(0,t.jsx)("button",{type:"button","aria-pressed":e===a,onClick:()=>r(a),className:`rounded px-2 py-1.5 text-sm transition-colors ${e===a?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:s.exam.modes[a]},a))}),"original"===e&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.exam.originalHint})]})}var N=e.i(41931),w=e.i(664030);let C=["unmastered","mastered","all"],S=["least_practiced","random"],E=["easy","medium","hard","harder"];function R(){let{t:e,language:s}=(0,v.b)(),a=(0,x.useRouter)(),[n,i]=(0,r.useState)([]),[l,o]=(0,r.useState)([]),[m,u]=(0,r.useState)([]),[y,R]=(0,r.useState)([]),[P,$]=(0,r.useState)("unmastered"),[I,L]=(0,r.useState)("least_practiced"),[M,T]=(0,r.useState)(10),[O,D]=(0,r.useState)("medium"),[F,_]=(0,r.useState)("generate"),[A,U]=(0,r.useState)(""),[q,H]=(0,r.useState)(!1),[B,z]=(0,r.useState)(null),{groups:K,loading:V}=(0,w.f)();(0,r.useEffect)(()=>{N.k.get("/api/notebooks").then(e=>{i(e),1===e.length&&o([e[0].id])}).catch(()=>i([]))},[]);let X=async t=>{if(t.preventDefault(),0===l.length)return void z(e.exam.noNotebook);H(!0),z(null);try{let e=await N.k.post("/api/exams",{subjectIds:l,tagNames:m,paperLevelIds:y.length>0?y:void 0,scope:P,pickRule:I,count:M,difficulty:"original"===F?void 0:O,mode:F,title:A.trim()||void 0,language:s});a.push(`/exams/${e.id}`)}catch(t){z("NO_SOURCE_ITEMS"===t?.data?.message?e.exam.noSource:e.common.messages?.saveFailed||"Failed"),H(!1)}},Y=e.practice.difficulty;return(0,t.jsxs)(c.N,{children:[(0,t.jsx)(c.Y,{children:(0,t.jsx)(c.v,{className:"text-lg",children:e.exam.createTitle})}),(0,t.jsx)(c.O,{children:(0,t.jsxs)("form",{onSubmit:X,className:"space-y-5",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(b.f,{children:e.exam.notebooks}),n.length>1&&(0,t.jsx)("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>o(l.length===n.length?[]:n.map(e=>e.id)),children:e.exam.selectAll})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:n.map(e=>(0,t.jsxs)("label",{className:"flex items-center gap-2 rounded-md border p-2 text-sm cursor-pointer hover:bg-muted/50",children:[(0,t.jsx)(p.f,{checked:l.includes(e.id),onCheckedChange:()=>{var t;return t=e.id,void o(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])}}),(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:e._count?.errorItems??""})]},e.id))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.tags}),(0,t.jsx)(j.f,{value:m,onChange:u,placeholder:e.exam.tagsPlaceholder})]}),!V&&K.filter(e=>e.isActive).length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.filter.paperLevel}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:K.filter(e=>e.isActive).map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.id,void R(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:`rounded-full border px-3 py-1.5 text-sm transition-colors ${y.includes(e.id)?"border-primary bg-primary text-primary-foreground":"border-input bg-background hover:bg-muted"}`,children:e.name},e.id))})]}),(0,t.jsx)(k,{value:F,onChange:_}),(0,t.jsxs)("div",{className:`grid gap-4 ${"generate"===F?"sm:grid-cols-3":"sm:grid-cols-2"}`,children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.scope}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-md bg-muted p-1",children:C.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>$(r),className:`rounded px-2 py-1.5 text-sm transition-colors ${P===r?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.scopes[r]},r))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-count",children:e.exam.count}),(0,t.jsx)(g.f,{id:"exam-count",type:"number",min:1,max:50,value:M,onChange:e=>T(Math.min(50,Math.max(1,parseInt(e.target.value,10)||1)))})]}),"generate"===F&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-difficulty",children:e.exam.difficulty}),(0,t.jsx)("select",{id:"exam-difficulty",value:O,onChange:e=>D(e.target.value),className:"h-9 w-full rounded-md border bg-background px-3 text-sm",children:E.map(e=>(0,t.jsx)("option",{value:e,children:Y[e]},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{children:e.exam.pickRule}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",children:S.map(r=>(0,t.jsx)("button",{type:"button",onClick:()=>L(r),className:`rounded px-2 py-1.5 text-sm transition-colors ${I===r?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.pickRules[r]},r))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.exam.pickRuleHints[I]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(b.f,{htmlFor:"exam-title",children:e.exam.titleLabel}),(0,t.jsx)(g.f,{id:"exam-title",value:A,maxLength:100,onChange:e=>U(e.target.value)})]}),B&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:B}),(0,t.jsxs)(d.f,{type:"submit",disabled:q,className:"w-full sm:w-auto",children:[q?(0,t.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(h.f,{className:"mr-2 h-4 w-4"}),q?e.exam.creating:"original"===F?e.exam.createOriginal:e.exam.generate]})]})})]})}var P=e.i(663661),$=e.i(487486),I=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,a.M)(),{t:x}=(0,v.b)();(0,I.f)(x.exam.title);let[f,h]=(0,r.useState)(null),[p,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{N.k.get("/api/exams").then(e=>{h(e),0===e.length&&g(!0)}).catch(()=>h([]))},[]);let b=x.practice.difficulty;return(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(m.f,{title:x.exam.title,description:x.exam.subtitle,actions:!p&&(0,t.jsxs)(d.f,{onClick:()=>g(!0),"aria-label":x.exam.create,children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:x.exam.create})]})}),p&&(0,t.jsx)(R,{}),(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:x.exam.list}),null===f?(0,t.jsx)(u.f,{}):0===f.length?(0,t.jsx)(o.f,{icon:i.f,title:x.exam.empty,className:"py-10"}):(0,t.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:f.map(r=>(0,t.jsx)(s.default,{href:`/exams/${r.id}`,children:(0,t.jsx)(c.N,{className:"h-full rounded-2xl transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md",children:(0,t.jsxs)(c.O,{className:"space-y-2 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 shrink-0 text-primary"}),r.title]}),(0,t.jsx)(P.f,{status:r.status,recorded:r.recordedCount>0})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:(0,n.r)(r.createdAt,"yyyy-MM-dd HH:mm",e)}),(0,t.jsx)("span",{children:x.exam.questionCount.replace("{count}",String(r.questionCount))}),(0,t.jsx)("span",{children:x.exam.scopes[r.scope]}),"original"===r.mode?(0,t.jsx)($.f,{variant:"secondary",children:x.exam.modes.original}):(0,t.jsx)("span",{children:b[r.difficulty]||r.difficulty}),(0,t.jsx)("span",{children:r.recordedCount>0?x.exam.recorded:x.exam.notRecorded})]})]})})},r.id))})]})]})})}],952801)},663661,e=>{var t=e.i(843476),r=e.i(487486),s=e.i(111110);let a={generating:"bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 border-blue-200 dark:border-blue-900",ready:"bg-indigo-100 dark:bg-indigo-900/40 text-indigo-700 dark:text-indigo-300 border-indigo-200 dark:border-indigo-900",partial:"bg-amber-100 dark:bg-amber-900/40 text-amber-700 dark:text-amber-300 border-amber-200 dark:border-amber-900",failed:"bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 border-red-200 dark:border-red-900",completed:"bg-green-100 dark:bg-green-900/40 text-green-700 dark:text-green-300 border-green-200 dark:border-green-900"};e.s(["f",0,function({status:e,recorded:n}){let{t:i}=(0,s.b)(),l=n&&("ready"===e||"partial"===e)?"completed":e;return(0,t.jsx)(r.f,{variant:"outline",className:a[l],children:i.exam.status[l]})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(263676),a=e.i(487486),n=e.i(793479),i=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:d,placeholder:c="Enter tags...",className:o="",enterHint:m,subject:u,gradeStage:x}){let[f,h]=(0,r.useState)(""),[p,g]=(0,r.useState)([]),[b,j]=(0,r.useState)(!1),[v,y]=(0,r.useState)(0),k=(0,r.useRef)(null),N=(0,r.useRef)(null),w=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});u&&r.append("subject",u),x&&r.append("stage",x);let s=((await i.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));g(s.slice(0,20)),j(s.length>0),y(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,x,e]);(0,r.useEffect)(()=>{f.trim()&&w(f)},[f,w]);let C=t=>{t.trim()&&!e.includes(t.trim())&&(d([...e,t.trim()]),h(""),g([]),j(!1),y(0))},S=t=>{d(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!N.current||N.current.contains(e.target)||k.current?.contains(e.target)||j(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${o}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>S(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.f,{ref:k,type:"text",value:f,onChange:e=>{h(e.target.value),e.target.value.trim()||(g([]),j(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&p[v]?C(p[v]):f.trim()&&C(f)):"ArrowDown"===t.key?(t.preventDefault(),y(e=>Math.min(e+1,p.length-1))):"ArrowUp"===t.key?(t.preventDefault(),y(e=>Math.max(e-1,0))):"Escape"===t.key?(j(!1),y(0)):"Backspace"===t.key&&!f&&e.length>0&&S(e[e.length-1])},onFocus:()=>{p.length>0&&j(!0)},placeholder:0===e.length?c:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),b&&p.length>0&&(0,t.jsx)("div",{ref:N,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:p.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===v?"bg-accent":""}`,onClick:()=>C(e),onMouseEnter:()=>y(r),children:e},e))}),f&&!b&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:m?`${m} "${f}"`:`Press Enter to create "${f}"`})]})}])},590546,e=>{var t=e.i(843476),r=e.i(618566),s=e.i(519455),a=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let i=(0,r.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:n,children:(0,t.jsx)(a.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(820783),a=e.i(30030),n=e.i(981140),i=e.i(369340),l=e.i(635804),d=e.i(296626),c=e.i(248425),o=Object.defineProperty,m=(e,t)=>o(e,"name",{value:t,configurable:!0}),u="Checkbox",[x,f]=(0,a.f)(u),[h,p]=x(u);function g(e){let{__scopeCheckbox:s,checked:a,children:n,defaultChecked:l,disabled:d,form:c,name:o,onCheckedChange:m,required:x,value:f="on",internal_do_not_use_render:p}=e,[g,b]=(0,i.f)({prop:a,defaultProp:l??!1,onChange:m,caller:u}),[j,v]=r.useState(null),[y,w]=r.useState(null),[C,S]=r.useState(null),E=!j||!!c||!!j.closest("form"),R={checked:g,disabled:d,setChecked:b,control:j,setControl:v,name:o,form:c,value:f,userClick:C,onUserClick:S,required:x,defaultChecked:!N(l)&&l,isFormControl:E,bubbleInput:y,setBubbleInput:w};return(0,t.jsx)(h,{scope:s,...R,children:k(p)?p(R):n})}m(g,"CheckboxProvider");var b=r.forwardRef(m(function({__scopeCheckbox:e,onKeyDown:a,onClick:i,...l},d){let{control:o,value:u,disabled:x,checked:f,required:h,setControl:g,setChecked:b,onUserClick:j,isFormControl:v,bubbleInput:y}=p("CheckboxTrigger",e),k=(0,s.f)(d,g),C=r.useRef(f);return r.useEffect(()=>{let e=o?.form;if(e){let t=m(()=>b(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[o,b]),(0,t.jsx)(c.V.button,{type:"button",role:"checkbox","aria-checked":N(f)?"mixed":f,"aria-required":h,"data-state":w(f),"data-disabled":x?"":void 0,disabled:x,value:u,...l,ref:k,onKeyDown:(0,n.f)(a,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,n.f)(i,e=>{let t=e.isPropagationStopped();j({requestedChecked:!!N(f)||!f,hasConsumerStoppedPropagation:t}),b(e=>!!N(e)||!e),y&&v&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),j=r.forwardRef(m(function(e,r){let{__scopeCheckbox:s,name:a,checked:n,defaultChecked:i,required:l,disabled:d,value:c,onCheckedChange:o,form:m,...u}=e;return(0,t.jsx)(g,{__scopeCheckbox:s,checked:n,defaultChecked:i,disabled:d,required:l,onCheckedChange:o,name:a,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...u,ref:r,__scopeCheckbox:s}),e&&(0,t.jsx)(y,{__scopeCheckbox:s})]})})},"Checkbox")),v=r.forwardRef(m(function(e,r){let{__scopeCheckbox:s,forceMount:a,...n}=e,i=p("CheckboxIndicator",s);return(0,t.jsx)(d.f,{present:a||N(i.checked)||!0===i.checked,children:(0,t.jsx)(c.V.span,{"data-state":w(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:r,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),y=r.forwardRef(m(function({__scopeCheckbox:e,onClick:a,...i},d){let{control:o,userClick:m,checked:u,defaultChecked:x,required:f,disabled:h,name:g,value:b,form:j,bubbleInput:v,setBubbleInput:y}=p("CheckboxBubbleInput",e),k=(0,s.f)(d,y),w=(0,l.f)(o),C=r.useRef(!1),S=r.useRef(u),E=r.useRef(m),R=r.useRef(null);r.useEffect(()=>{if(!v)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=S.current!==u;S.current=u;let r=null!==m&&m!==E.current;if(E.current=m,r)R.current=t?null:m,t&&(v.indeterminate=N(u),e.call(v,!N(u)&&u)),v.dispatchEvent(new Event("click",{bubbles:!m.hasConsumerStoppedPropagation}));else if(t){let t=R.current;R.current=null;let r=t?.requestedChecked===u;C.current=!0,v.indeterminate=N(u),e.call(v,!N(u)&&u),v.dispatchEvent(new Event("click",{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[v,u,m]);let P=r.useRef(!N(u)&&u);return(0,t.jsx)(c.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??P.current,required:f,disabled:h,name:g,value:b,form:j,...i,tabIndex:-1,ref:k,onClick:(0,n.f)(a,e=>{C.current&&e.stopPropagation()}),style:{...i.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function k(e){return"function"==typeof e}function N(e){return"indeterminate"===e}function w(e){return N(e)?"indeterminate":e?"checked":"unchecked"}m(k,"isFunction"),m(N,"isIndeterminate"),m(w,"getState");var C=e.i(689664),S=e.i(975157);let E=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(j,{ref:s,className:(0,S.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...r,children:(0,t.jsx)(v,{className:(0,S.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));E.displayName=j.displayName,e.s(["f",0,E],257428)},912505,e=>{var t=e.i(843476),r=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:a,action:n,className:i}){return(0,t.jsxs)("div",{className:(0,r.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",i),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),a&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:a}),n&&(0,t.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var t=e.i(843476),r=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:a,backHref:n,actions:i,titleAddon:l,className:d}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",d),children:[n&&(0,t.jsx)(r.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),a&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:a})]}),i&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:i})]})}])},86963,e=>{var t=e.i(843476),r=e.i(632781);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(r.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,r.b)(),a=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=a},[a])}])}])})();
@@ -1,33 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let a={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};a.node;let n=(0,t.f)(a);e.s(["f",0,n],711241)},77043,e=>{var t=e.i(456420);let a={name:"printer",size:24,node:[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]};a.node;let n=(0,t.f)(a);e.s(["f",0,n],77043)},580685,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(618566),s=e.i(762368),i=e.i(77043),r=e.i(519455),l=e.i(257428),c=e.i(967489),o=e.i(590546),u=e.i(520732),m=e.i(339023),d=e.i(511445),x=e.i(84583),f=e.i(111110),h=e.i(35209),p=e.i(41931);let g=`
2
- .exam-sheet { max-width: 210mm; margin: 0 auto; padding: 16px; color: #111; background: #fff; color-scheme: light; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.6; }
3
- .exam-sheet h1 { text-align: center; font-size: 22px; margin: 0 0 8px; }
4
- .exam-sheet .exam-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; font-size: 14px; margin-bottom: 20px; }
5
- .exam-sheet .exam-meta span { min-width: 120px; }
6
- .exam-sheet .exam-question { break-inside: avoid; page-break-inside: avoid; padding: 12px 0; border-bottom: 1px dashed #ccc; }
7
- .exam-sheet .exam-question-head { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
8
- .exam-sheet .exam-source { font-family: ui-monospace, Menlo, monospace; font-weight: 400; font-size: 12px; color: #666; white-space: nowrap; }
9
- .exam-sheet .exam-answer-space { min-height: 0; }
10
- .exam-sheet .exam-answer-key { break-before: page; page-break-before: always; padding-top: 8px; }
11
- .exam-sheet .exam-answer-key h2 { text-align: center; font-size: 18px; margin: 0 0 12px; }
12
- .exam-sheet .exam-label { font-weight: 600; color: #444; }
13
- .exam-sheet .markdown-content p { margin: 4px 0; }
14
- .exam-sheet .markdown-content img { max-width: 100%; }
15
- .exam-sheet .question-figure { margin: 8px 0; break-inside: avoid; page-break-inside: avoid; }
16
- .exam-sheet .question-figure img { display: block; margin: 0 auto; max-width: 100%; max-height: 360px; background: #fff; }
17
- .exam-sheet .markdown-content table { border-collapse: collapse; }
18
- .exam-sheet .markdown-content td, .exam-sheet .markdown-content th { border: 1px solid #999; padding: 2px 6px; }
19
- @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; } }
20
- `;function b(e){return e.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}var v=e.i(995677),j=e.i(192635);let w=[];e.s(["default",0,function(){let e=(0,n.useParams)(),{t:y,language:k}=(0,f.b)(),[S,N]=(0,a.useState)(null);(0,h.f)(y.exam.title,S?.title,y.pageTitle.examPrint);let[C,_]=(0,a.useState)(!0),[z,A]=(0,a.useState)(v.q),[q,R]=(0,a.useState)({scale:null,align:null}),T=(0,a.useRef)(null),$=S?.id,E=(0,a.useCallback)(async e=>{if($){if(e.length>1&&e.every(e=>null===e.answerSpacePx))return void await p.k.patch(`/api/exams/${$}`,{answerSpacePx:null});await Promise.all(e.map(({id:e,answerSpacePx:t})=>p.k.patch(`/api/exams/${$}`,{questionId:e,answerSpacePx:t})))}},[$]),{customSpaces:P,setSpace:F,resetAll:I,saveFailed:L}=(0,j.f)(S?.questions??w,E);if((0,a.useEffect)(()=>{let e=null;try{e=localStorage.getItem(v.p)}catch{}(0,v.I)(e)&&A(e)},[]),(0,a.useEffect)(()=>{p.k.get(`/api/exams/${e.id}`).then(N).catch(()=>N(null))},[e.id]),!S)return(0,t.jsx)("div",{className:"p-8 text-center",children:y.common.loading});let M=S.questions.filter(e=>"ready"===e.status&&e.questionText),H=M.filter(e=>!!e.figureSvg),O=async(e,t,a)=>{await p.k.patch(`/api/exams/${S.id}`,{questionId:e,figureScale:t,figureAlign:a}),N(n=>n?{...n,questions:n.questions.map(n=>n.id===e?{...n,figureScale:t,figureAlign:a}:n)}:n)},V=async e=>{await p.k.patch(`/api/exams/${S.id}`,e),N(t=>t?{...t,questions:t.questions.map(t=>({...t,...e}))}:t)};return(0,t.jsxs)("main",{className:"min-h-screen bg-white",children:[(0,t.jsx)("style",{children:g}),(0,t.jsx)("div",{className:"print:hidden sticky top-0 z-10 border-b bg-background p-3 shadow-sm",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto flex flex-wrap items-center gap-3",children:[(0,t.jsx)(o.f,{fallbackUrl:`/exams/${S.id}`}),(0,t.jsx)("span",{className:"font-semibold",children:y.exam.printTitle}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(l.f,{checked:C,onCheckedChange:e=>_(!0===e)}),y.exam.includeAnswers]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"shrink-0",children:y.exam.answerSpace}),(0,t.jsxs)(c.d,{value:z,onValueChange:e=>{if((0,v.I)(e)){A(e);try{localStorage.setItem(v.p,e)}catch{}}},children:[(0,t.jsx)(c.P,{className:"h-8 w-40",children:(0,t.jsx)(c.U,{})}),(0,t.jsxs)(c.r,{children:[(0,t.jsx)(c.T,{value:"auto",children:y.exam.answerSpaceAuto}),(0,t.jsx)(c.T,{value:"none",children:y.exam.answerSpaceNone}),(0,t.jsx)(c.T,{value:"small",children:y.exam.answerSpaceSmall}),(0,t.jsx)(c.T,{value:"medium",children:y.exam.answerSpaceMedium}),(0,t.jsx)(c.T,{value:"large",children:y.exam.answerSpaceLarge})]})]}),Object.keys(P).length>0&&(0,t.jsx)(r.f,{type:"button",variant:"ghost",size:"sm",onClick:I,children:y.exam.resetAllQuestionAnswerSpaces})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 sm:ml-auto",children:[(0,t.jsxs)(r.f,{variant:"outline",size:"sm",onClick:()=>{var e;if(!T.current)return;let t=T.current.cloneNode(!0);t.querySelectorAll(".figure-scale-editor-controls, .answer-space-controls, .print\\:hidden").forEach(e=>e.remove());let a=function(e,t,a="zh-CN"){return`<!doctype html>
21
- <html lang="${b(a)}">
22
- <head>
23
- <meta charset="utf-8">
24
- <meta name="viewport" content="width=device-width, initial-scale=1">
25
- <title>${b(e)}</title>
26
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.19.1/dist/katex.min.css">
27
- <style>body { margin: 0; background: #fff; }${g}</style>
28
- </head>
29
- <body>
30
- ${t}
31
- </body>
32
- </html>
33
- `}(S.title,t.outerHTML,"en"===k?"en":"zh-CN"),n=URL.createObjectURL(new Blob([a],{type:"text/html;charset=utf-8"})),s=document.createElement("a");s.href=n,e=S.title,s.download=`${e.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,s.click(),URL.revokeObjectURL(n)},children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4"}),y.exam.downloadHtml]}),(0,t.jsxs)(r.f,{size:"sm",onClick:()=>window.print(),children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),y.exam.printNow]})]}),"auto"===z&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:y.exam.answerSpaceAutoHint}),L&&(0,t.jsx)("p",{className:"w-full text-xs text-destructive",children:y.exam.answerSpaceSaveFailed}),M.length<S.questions.length&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:y.exam.notReadyHint}),H.length>0&&(0,t.jsx)(m.f,{scales:H.map(e=>e.figureScale),aligns:H.map(e=>e.figureAlign),onPreviewChange:R,onSave:V})]})}),(0,t.jsxs)("div",{ref:T,className:"exam-sheet",children:[(0,t.jsx)("h1",{children:S.title}),(0,t.jsxs)("div",{className:"exam-meta",children:[(0,t.jsxs)("span",{children:[y.exam.nameLine,y.common.colon,"________"]}),(0,t.jsxs)("span",{children:[y.exam.dateLine,y.common.colon,"________"]}),(0,t.jsxs)("span",{children:[y.exam.scoreLine,y.common.colon,"________"]})]}),M.map((e,a)=>{let n;return(0,t.jsxs)("section",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[a+1,"."]}),(0,t.jsxs)("span",{className:"exam-source",children:[y.exam.sourceLabel,": ",e.sourceShortId]})]}),(0,t.jsx)(d.f,{content:e.questionText}),(0,t.jsx)(u.f,{svg:e.figureSvg,scale:e.figureScale,align:e.figureAlign,previewScaleOverride:q.scale,previewAlignOverride:q.align,onSave:(t,a)=>O(e.id,t,a)},`${e.id}-${e.figureScale??100}-${e.figureAlign??"center"}`),(n=(0,v.z)(z,e.questionText,P[e.id]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"exam-answer-space",style:{minHeight:`${n}px`}}),(0,t.jsx)(x.f,{effectivePx:n,isCustom:"number"==typeof P[e.id],onChange:t=>F(e.id,t),onReset:()=>F(e.id,null)})]}))]},e.id)}),C&&(0,t.jsxs)("section",{className:"exam-answer-key",children:[(0,t.jsx)("h2",{children:y.exam.answerKey}),M.map((e,a)=>(0,t.jsxs)("div",{className:"exam-question",children:[(0,t.jsxs)("div",{className:"exam-question-head",children:[(0,t.jsxs)("span",{children:[a+1,"."]}),(0,t.jsxs)("span",{className:"exam-source",children:[y.exam.sourceLabel,": ",e.sourceShortId]})]}),e.answerText&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[y.exam.answerLabel,y.common.colon]}),(0,t.jsx)(d.f,{content:e.answerText})]}),e.analysis&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[y.exam.analysisLabel,y.common.colon]}),(0,t.jsx)(d.f,{content:e.analysis})]})]},e.id))]})]})]})}],580685)},520732,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(149704),s=e.i(519455),i=e.i(793479),r=e.i(111110),l=e.i(294114),c=e.i(184110),o=e.i(201276);e.s(["f",0,function({svg:e,scale:u,align:m,previewScaleOverride:d,previewAlignOverride:x,onSave:f}){let{t:h}=(0,r.b)(),p=(0,a.useId)(),g=(0,c.V)(u),b=(0,c.o)(m),[v,j]=(0,a.useState)(null),[w,y]=(0,a.useState)(null),[k,S]=(0,a.useState)(!1),N=v??String(g),C=""!==N.trim()&&(0,c.x)(Number(N)),_=C?Number(N):g,z=w??b,A=d??_,q=x??z,R=null!==v&&(!C||Number(N)!==g)||null!==w&&w!==b;if(!e)return null;let T=async e=>{if(e.preventDefault(),C&&R&&!k){S(!0);try{await f(_,z),j(null),y(null),l.c.success(h.common.messages.saveSuccess)}catch(e){o.V.error("[FigureScale]","保存配图比例失败",{error:e}),l.c.error(h.common.messages.saveFailed)}finally{S(!1)}}};return(0,t.jsxs)("div",{children:[(0,t.jsx)(n.f,{svg:e,scale:A,align:q}),(0,t.jsxs)("form",{onSubmit:T,className:"figure-scale-editor-controls space-y-2 rounded-md border p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:p,children:h.figure.scale}),(0,t.jsx)(i.f,{id:p,type:"number",min:c._,max:c.a,step:1,value:N,disabled:k,"aria-describedby":`${p}-hint`,"aria-invalid":!C,onChange:e=>j(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(s.f,{type:"button",variant:"outline",size:"sm",disabled:k||C&&_===c.n,onClick:()=>j(String(c.n)),children:h.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":h.figure.align,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:h.figure.align}),c.j.map(e=>(0,t.jsx)(s.f,{type:"button",variant:z===e?"default":"outline",size:"sm",disabled:k,"aria-pressed":z===e,onClick:()=>y(e===b?null:e),children:h.figure.aligns[e]},e))]}),(0,t.jsx)(s.f,{type:"submit",size:"sm",disabled:k||!R||!C,children:k?h.common.progress.saving:h.common.save}),R&&(0,t.jsx)(s.f,{type:"button",variant:"ghost",size:"sm",disabled:k,onClick:()=>{j(null),y(null)},children:h.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:c._,max:c.a,step:1,value:_,disabled:k,"aria-label":h.figure.scaleSlider,"aria-describedby":`${p}-hint`,onChange:e=>j(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${p}-hint`,className:"text-xs text-muted-foreground",children:h.figure.scaleHint})]})]})}])},339023,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(519455),s=e.i(793479),i=e.i(111110),r=e.i(294114),l=e.i(184110),c=e.i(201276);e.s(["f",0,function({scales:e,aligns:o,onPreviewChange:u,onSave:m}){let{t:d}=(0,i.b)(),x=(0,a.useId)(),f=e.map(l.V),h=new Set(f).size<=1,p=f[0]??l.n,g=(o??e.map(()=>l.E)).map(l.o),b=new Set(g).size<=1,v=g[0]??l.E,[j,w]=(0,a.useState)(null),[y,k]=(0,a.useState)(null),[S,N]=(0,a.useState)(!1);if(0===e.length)return null;let C=j??String(p),_=""!==C.trim()&&(0,l.x)(Number(C)),z=_?Number(C):p,A=y??v,q=null!==j||null!==y,R=null!==j?!_||!h||Number(C)!==p:!q&&!h,T=null!==y?!b||y!==v:!q&&!b,$=R||T,E=(e,t)=>{let a=null!==e&&""!==e.trim()&&(0,l.x)(Number(e))?Number(e):null;u?.({scale:a,align:t})},P=e=>{w(e),E(e,y)},F=async e=>{if(e.preventDefault(),_&&$&&!S){N(!0);try{let e={};null===j&&(q||h)||(e.figureScale=z),null===y&&(q||b)||(e.figureAlign=A),await m(e),w(null),k(null),u?.({scale:null,align:null}),r.c.success(d.common.messages.saveSuccess)}catch(e){c.V.error("[ExamFigureScale]","统一保存试卷配图设置失败",{error:e}),r.c.error(d.common.messages.saveFailed)}finally{N(!1)}}};return(0,t.jsxs)("form",{onSubmit:F,className:"figure-scale-editor-controls w-full space-y-2 rounded-md border bg-background p-3 print:hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("label",{htmlFor:x,className:"font-medium",children:d.exam.uniformFigureScale}),(0,t.jsx)(s.f,{id:x,type:"number",min:l._,max:l.a,step:1,value:C,disabled:S,"aria-describedby":`${x}-hint`,"aria-invalid":!_,onChange:e=>P(e.target.value),className:"h-8 w-20"}),(0,t.jsx)("span",{children:"%"}),(0,t.jsx)(n.f,{type:"button",variant:"outline",size:"sm",disabled:S||h&&_&&z===l.n,onClick:()=>P(String(l.n)),children:d.figure.resetScale}),(0,t.jsxs)("div",{role:"group","aria-label":d.exam.uniformFigureAlign,className:"inline-flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:d.exam.uniformFigureAlign}),l.j.map(e=>(0,t.jsx)(n.f,{type:"button",variant:A===e&&(null!==y||b)?"default":"outline",size:"sm",disabled:S,"aria-pressed":A===e&&(null!==y||b),onClick:()=>{var t;k(t=b&&e===v?null:e),E(j,t)},children:d.figure.aligns[e]},e))]}),(0,t.jsx)(n.f,{type:"submit",size:"sm",disabled:S||!$||!_,children:S?d.common.progress.saving:d.common.save}),q&&(0,t.jsx)(n.f,{type:"button",variant:"ghost",size:"sm",disabled:S,onClick:()=>{w(null),k(null),u?.({scale:null,align:null})},children:d.common.cancel})]}),(0,t.jsx)("input",{type:"range",min:l._,max:l.a,step:1,value:z,disabled:S,"aria-label":d.exam.uniformFigureScaleSlider,"aria-describedby":`${x}-hint`,onChange:e=>P(e.target.value),className:"block h-6 w-full max-w-sm accent-primary"}),(0,t.jsx)("p",{id:`${x}-hint`,className:"text-xs text-muted-foreground",children:d.exam.uniformFigureScaleHint})]})}])},84583,995677,192635,e=>{var t=e.i(843476),a=e.i(519455),n=e.i(111110);let s=["auto","none","small","medium","large"],i={none:0,small:60,medium:120,large:240},r={choice:12,judgment:12,fill:16,solution:240};function l(e){return Number.isFinite(e)?Math.min(600,Math.max(0,Math.round(e))):0}function c(e){return"number"!=typeof e||!Number.isInteger(e)||e<0||e>600?null:e}let o=/(?:(?:^|[\s*+\-))::。??;;,,_])([A-D])\s*[..::]|(?:^|\s{2,}|[))::。??])([A-D])\s*、|[((]([A-D])[))])/gm,u=/判断(?:下列|以下|正误|对错|题)|对的(?:打|画)|错的(?:打|画)|true\s*(?:or|\/)\s*false/i,m=/_{2,}|(?:\\_){2,}|\\underline|\\rule\b|\\hspace\b|(\s*)|【\s*】|\[\s+\]|(?<![A-Za-z0-9_])\(\s*\)|[==]\s*[。??]?\s*$|填空/,d=/求证|证明[::,,]|写出(?:解题|计算|推导|推理)?过程|解答下列|试说明理由|请说明理由/,x=/(\s*(\d{1,2})\s*)/g,f=/(?:^|[\n。;;::??!!]\s*)\(\s*(\d{1,2})\s*\)/g;function h(e){let t=new Set;for(let a of e.matchAll(x))t.add(a[1]);for(let a of e.matchAll(f))t.add(a[1]);return Math.max(1,t.size)}e.s(["p",0,"exam-print-answer-space","W",0,20,"q",0,"auto","R",0,600,"r",0,0,"O",0,l,"I",0,function(e){return"string"==typeof e&&s.includes(e)},"T",0,c,"z",0,function(e,t,a){let n;if("number"==typeof a&&Number.isFinite(a))return l(a);if("auto"!==e)return i[e];let s=(n=new Set(Array.from(t.matchAll(o),e=>e[1]??e[2]??e[3]))).has("A")&&n.has("B")&&n.has("C")?"choice":u.test(t)?"judgment":h(t)>1||d.test(t)?"solution":m.test(t)?"fill":"solution";if("solution"!==s)return r[s];let c=(h(t)-1)*120;return Math.min(560,r.solution+c)}],995677),e.s(["f",0,function({effectivePx:e,isCustom:s,onChange:i,onReset:r}){let{t:c}=(0,n.b)(),o=l(e);return(0,t.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,t.jsxs)("span",{children:[c.exam.questionAnswerSpace,": ",o,"px"]}),(0,t.jsx)(a.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":c.exam.decreaseAnswerSpace,disabled:o<=0,onClick:()=>i(l(o-20)),children:"-"}),(0,t.jsx)("input",{type:"range",min:0,max:600,step:10,value:o,"aria-label":c.exam.questionAnswerSpaceSlider,onChange:e=>i(l(Number(e.target.value))),className:"w-24 sm:w-32 accent-primary"}),(0,t.jsx)(a.f,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs","aria-label":c.exam.increaseAnswerSpace,disabled:o>=600,onClick:()=>i(l(o+20)),children:"+"}),s&&(0,t.jsx)(a.f,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:r,children:c.exam.resetQuestionAnswerSpace})]})}],84583);var p=e.i(271645),g=e.i(201276);e.s(["f",0,function(e,t){let[a,n]=(0,p.useState)({}),[s,i]=(0,p.useState)(!1),r=(0,p.useRef)(new Map),l=(0,p.useRef)(null),o=(0,p.useRef)(t);(0,p.useEffect)(()=>{o.current=t},[t]);let u=(0,p.useMemo)(()=>{let t={};for(let n of e){let e=n.id in a?a[n.id]:c(n.answerSpacePx);"number"==typeof e&&(t[n.id]=e)}return t},[e,a]),m=(0,p.useCallback)(()=>{if(l.current&&(clearTimeout(l.current),l.current=null),0===r.current.size)return;let e=Array.from(r.current,([e,t])=>({id:e,answerSpacePx:t}));r.current.clear(),o.current(e).then(()=>i(!1)).catch(e=>{i(!0),g.V.error("[AnswerSpace]","Failed to save answer space",{error:e})})},[]);(0,p.useEffect)(()=>m,[m]);let d=(0,p.useCallback)((e,t)=>{if(0!==e.length){for(let{id:t,answerSpacePx:a}of(n(t=>{let a={...t};for(let{id:t,answerSpacePx:n}of e)a[t]=n;return a}),e))r.current.set(t,a);if(t)return void m();l.current&&clearTimeout(l.current),l.current=setTimeout(m,600)}},[m]),x=(0,p.useCallback)((e,t)=>{d([{id:e,answerSpacePx:t}],null===t)},[d]),f=(0,p.useCallback)(()=>{d(Object.keys(u).map(e=>({id:e,answerSpacePx:null})),!0)},[u,d]);return{customSpaces:u,setSpace:x,resetAll:f,saveFailed:s}}],192635)},149704,e=>{var t=e.i(843476),a=e.i(111110),n=e.i(398019),s=e.i(184110),i=e.i(975157);let r={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:c,className:o}){let{t:u}=(0,a.b)();if(!e)return null;let m=(0,s.V)(l),d=(0,s.o)(c);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",o),children:(0,t.jsx)("img",{src:(0,n.f)(e),alt:u.figure.alt,className:(0,i.f)(r[d],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===d?{marginLeft:0,marginRight:"auto"}:"right"===d?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:m/100,maxWidth:`${Math.min(m,100)}%`}})})}])},590546,e=>{var t=e.i(843476),a=e.i(618566),n=e.i(519455),s=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:i}){let r=(0,a.useRouter)();return(0,t.jsx)(n.f,{variant:"ghost",size:"icon",onClick:()=>{r.push(e)},className:i,children:(0,t.jsx)(s.f,{className:"h-5 w-5"})})}])},257428,e=>{var t=e.i(843476),a=e.i(271645),n=e.i(820783),s=e.i(30030),i=e.i(981140),r=e.i(369340),l=e.i(635804),c=e.i(296626),o=e.i(248425),u=Object.defineProperty,m=(e,t)=>u(e,"name",{value:t,configurable:!0}),d="Checkbox",[x,f]=(0,s.f)(d),[h,p]=x(d);function g(e){let{__scopeCheckbox:n,checked:s,children:i,defaultChecked:l,disabled:c,form:o,name:u,onCheckedChange:m,required:x,value:f="on",internal_do_not_use_render:p}=e,[g,b]=(0,r.f)({prop:s,defaultProp:l??!1,onChange:m,caller:d}),[v,j]=a.useState(null),[w,S]=a.useState(null),[N,C]=a.useState(null),_=!v||!!o||!!v.closest("form"),z={checked:g,disabled:c,setChecked:b,control:v,setControl:j,name:u,form:o,value:f,userClick:N,onUserClick:C,required:x,defaultChecked:!k(l)&&l,isFormControl:_,bubbleInput:w,setBubbleInput:S};return(0,t.jsx)(h,{scope:n,...z,children:y(p)?p(z):i})}m(g,"CheckboxProvider");var b=a.forwardRef(m(function({__scopeCheckbox:e,onKeyDown:s,onClick:r,...l},c){let{control:u,value:d,disabled:x,checked:f,required:h,setControl:g,setChecked:b,onUserClick:v,isFormControl:j,bubbleInput:w}=p("CheckboxTrigger",e),y=(0,n.f)(c,g),N=a.useRef(f);return a.useEffect(()=>{let e=u?.form;if(e){let t=m(()=>b(N.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[u,b]),(0,t.jsx)(o.V.button,{type:"button",role:"checkbox","aria-checked":k(f)?"mixed":f,"aria-required":h,"data-state":S(f),"data-disabled":x?"":void 0,disabled:x,value:d,...l,ref:y,onKeyDown:(0,i.f)(s,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.f)(r,e=>{let t=e.isPropagationStopped();v({requestedChecked:!!k(f)||!f,hasConsumerStoppedPropagation:t}),b(e=>!!k(e)||!e),w&&j&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),v=a.forwardRef(m(function(e,a){let{__scopeCheckbox:n,name:s,checked:i,defaultChecked:r,required:l,disabled:c,value:o,onCheckedChange:u,form:m,...d}=e;return(0,t.jsx)(g,{__scopeCheckbox:n,checked:i,defaultChecked:r,disabled:c,required:l,onCheckedChange:u,name:s,form:m,value:o,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b,{...d,ref:a,__scopeCheckbox:n}),e&&(0,t.jsx)(w,{__scopeCheckbox:n})]})})},"Checkbox")),j=a.forwardRef(m(function(e,a){let{__scopeCheckbox:n,forceMount:s,...i}=e,r=p("CheckboxIndicator",n);return(0,t.jsx)(c.f,{present:s||k(r.checked)||!0===r.checked,children:(0,t.jsx)(o.V.span,{"data-state":S(r.checked),"data-disabled":r.disabled?"":void 0,...i,ref:a,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),w=a.forwardRef(m(function({__scopeCheckbox:e,onClick:s,...r},c){let{control:u,userClick:m,checked:d,defaultChecked:x,required:f,disabled:h,name:g,value:b,form:v,bubbleInput:j,setBubbleInput:w}=p("CheckboxBubbleInput",e),y=(0,n.f)(c,w),S=(0,l.f)(u),N=a.useRef(!1),C=a.useRef(d),_=a.useRef(m),z=a.useRef(null);a.useEffect(()=>{if(!j)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=C.current!==d;C.current=d;let a=null!==m&&m!==_.current;if(_.current=m,a)z.current=t?null:m,t&&(j.indeterminate=k(d),e.call(j,!k(d)&&d)),j.dispatchEvent(new Event("click",{bubbles:!m.hasConsumerStoppedPropagation}));else if(t){let t=z.current;z.current=null;let a=t?.requestedChecked===d;N.current=!0,j.indeterminate=k(d),e.call(j,!k(d)&&d),j.dispatchEvent(new Event("click",{bubbles:!(a&&t.hasConsumerStoppedPropagation)})),N.current=!1}},[j,d,m]);let A=a.useRef(!k(d)&&d);return(0,t.jsx)(o.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:x??A.current,required:f,disabled:h,name:g,value:b,form:v,...r,tabIndex:-1,ref:y,onClick:(0,i.f)(s,e=>{N.current&&e.stopPropagation()}),style:{...r.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function y(e){return"function"==typeof e}function k(e){return"indeterminate"===e}function S(e){return k(e)?"indeterminate":e?"checked":"unchecked"}m(y,"isFunction"),m(k,"isIndeterminate"),m(S,"getState");var N=e.i(689664),C=e.i(975157);let _=a.forwardRef(({className:e,...a},n)=>(0,t.jsx)(v,{ref:n,className:(0,C.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...a,children:(0,t.jsx)(j,{className:(0,C.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(N.f,{className:"h-4 w-4"})})}));_.displayName=v.displayName,e.s(["f",0,_],257428)},184110,e=>{let t=["left","center","right"],a="center";function n(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,a,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,n,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:a},"V",0,function(e){return n(e)?e:100}])},398019,e=>{e.s(["f",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:n}=(0,a.b)(),s=[n.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=s},[s])}])}])})();