wrong-notebook 2026.10.22-4 → 2026.10.23

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 (688) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +0 -1
  3. package/.next/build-manifest.json +8 -8
  4. package/.next/prerender-manifest.json +4 -4
  5. package/.next/routes-manifest.json +0 -8
  6. package/.next/server/app/_global-error/page/build-manifest.json +5 -5
  7. package/.next/server/app/_global-error/page.js +2 -2
  8. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  9. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/_global-error.html +1 -1
  11. package/.next/server/app/_global-error.rsc +8 -8
  12. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +7 -7
  13. package/.next/server/app/_global-error.segments/_full.segment.rsc +8 -8
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found/page/build-manifest.json +5 -5
  16. package/.next/server/app/_not-found/page.js +2 -2
  17. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/admin/page/build-manifest.json +5 -5
  20. package/.next/server/app/admin/page.js +2 -2
  21. package/.next/server/app/admin/page.js.nft.json +1 -1
  22. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  23. package/.next/server/app/admin/user/[id]/page/build-manifest.json +5 -5
  24. package/.next/server/app/admin/user/[id]/page.js +2 -2
  25. package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
  26. package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/admin/dashboard/route.js +10 -4
  28. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  29. package/.next/server/app/api/admin/migrate-tags/route.js +3 -3
  30. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  31. package/.next/server/app/api/admin/system-reset/route.js +4 -4
  32. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  33. package/.next/server/app/api/admin/users/[id]/detail/route.js +11 -4
  34. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  35. package/.next/server/app/api/admin/users/[id]/route.js +3 -3
  36. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  37. package/.next/server/app/api/admin/users/route.js +3 -3
  38. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  39. package/.next/server/app/api/ai/models/route.js +7 -7
  40. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  41. package/.next/server/app/api/ai/test/route.js +8 -8
  42. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  43. package/.next/server/app/api/analytics/route.js +5 -5
  44. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  45. package/.next/server/app/api/analyze/route.js +9 -9
  46. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  47. package/.next/server/app/api/auth/[...nextauth]/route.js +3 -3
  48. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  49. package/.next/server/app/api/error-items/[id]/delete/route.js +4 -4
  50. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  51. package/.next/server/app/api/error-items/[id]/figure/route.js +8 -8
  52. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  53. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +9 -9
  54. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  55. package/.next/server/app/api/error-items/[id]/geogebra/route.js +7 -7
  56. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  57. package/.next/server/app/api/error-items/[id]/image/route.js +4 -4
  58. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  59. package/.next/server/app/api/error-items/[id]/notes/route.js +4 -4
  60. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  61. package/.next/server/app/api/error-items/[id]/practice-records/route.js +4 -4
  62. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  63. package/.next/server/app/api/error-items/[id]/reanswer/route.js +10 -10
  64. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  65. package/.next/server/app/api/error-items/[id]/retag/route.js +8 -8
  66. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  67. package/.next/server/app/api/error-items/[id]/route.js +1 -1
  68. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  69. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +10 -10
  70. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  71. package/.next/server/app/api/error-items/batch-delete/route.js +4 -4
  72. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  73. package/.next/server/app/api/error-items/clear/route.js +4 -4
  74. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  75. package/.next/server/app/api/error-items/list/route.js +6 -6
  76. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  77. package/.next/server/app/api/error-items/route.js +10 -10
  78. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  79. package/.next/server/app/api/error-items/short/[shortId]/route.js +3 -3
  80. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  81. package/.next/server/app/api/error-items/similarity/route.js +4 -4
  82. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  83. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +9 -9
  84. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  85. package/.next/server/app/api/exams/[id]/results/route.js +7 -7
  86. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  87. package/.next/server/app/api/exams/[id]/retry/route.js +9 -9
  88. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  89. package/.next/server/app/api/exams/[id]/route.js +7 -7
  90. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  91. package/.next/server/app/api/exams/route.js +9 -9
  92. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  93. package/.next/server/app/api/export/route.js +4 -4
  94. package/.next/server/app/api/export/route.js.nft.json +1 -1
  95. package/.next/server/app/api/geogebra-analyze/route.js +7 -7
  96. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  97. package/.next/server/app/api/health/route.js +2 -2
  98. package/.next/server/app/api/health/route.js.nft.json +1 -1
  99. package/.next/server/app/api/import/route.js +9 -9
  100. package/.next/server/app/api/import/route.js.nft.json +1 -1
  101. package/.next/server/app/api/logs/frontend/route.js +4 -4
  102. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  103. package/.next/server/app/api/notebooks/[id]/retag/route.js +5 -5
  104. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  105. package/.next/server/app/api/notebooks/[id]/route.js +4 -4
  106. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  107. package/.next/server/app/api/notebooks/route.js +3 -3
  108. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  109. package/.next/server/app/api/openclaw/batch-upload/route.js +9 -9
  110. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  111. package/.next/server/app/api/practice/generate/route.js +7 -7
  112. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  113. package/.next/server/app/api/practice/record/[id]/route.js +7 -7
  114. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  115. package/.next/server/app/api/practice/record/route.js +9 -9
  116. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  117. package/.next/server/app/api/reanswer/route.js +9 -9
  118. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  119. package/.next/server/app/api/register/route.js.nft.json +1 -1
  120. package/.next/server/app/api/register/status/route.js +2 -2
  121. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  122. package/.next/server/app/api/settings/route.js +5 -5
  123. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  124. package/.next/server/app/api/stats/practice/clear/route.js +4 -4
  125. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  126. package/.next/server/app/api/stats/practice/route.js +3 -3
  127. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  128. package/.next/server/app/api/tags/route.js +4 -4
  129. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  130. package/.next/server/app/api/tags/stats/route.js +4 -4
  131. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  132. package/.next/server/app/api/tags/suggestions/route.js +3 -3
  133. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  134. package/.next/server/app/api/tasks/route.js +4 -4
  135. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  136. package/.next/server/app/api/user/route.js +4 -4
  137. package/.next/server/app/api/user/route.js.nft.json +1 -1
  138. package/.next/server/app/api/version/route.js +2 -2
  139. package/.next/server/app/api/version/route.js.nft.json +1 -1
  140. package/.next/server/app/error-items/[id]/page/build-manifest.json +5 -5
  141. package/.next/server/app/error-items/[id]/page.js +2 -2
  142. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  143. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  144. package/.next/server/app/exams/[id]/page/build-manifest.json +5 -5
  145. package/.next/server/app/exams/[id]/page.js +2 -2
  146. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  147. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  148. package/.next/server/app/exams/[id]/print/page/build-manifest.json +5 -5
  149. package/.next/server/app/exams/[id]/print/page.js +2 -2
  150. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  151. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  152. package/.next/server/app/exams/page/build-manifest.json +5 -5
  153. package/.next/server/app/exams/page.js +2 -2
  154. package/.next/server/app/exams/page.js.nft.json +1 -1
  155. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  156. package/.next/server/app/favicon.ico/route.js +2 -2
  157. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  158. package/.next/server/app/latex-test/page/build-manifest.json +5 -5
  159. package/.next/server/app/latex-test/page.js +2 -2
  160. package/.next/server/app/latex-test/page.js.nft.json +1 -1
  161. package/.next/server/app/latex-test/page_client-reference-manifest.js +1 -1
  162. package/.next/server/app/login/page/build-manifest.json +5 -5
  163. package/.next/server/app/login/page.js +2 -2
  164. package/.next/server/app/login/page.js.nft.json +1 -1
  165. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  166. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  167. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  168. package/.next/server/app/notebooks/[id]/add/page/build-manifest.json +5 -5
  169. package/.next/server/app/notebooks/[id]/add/page.js +2 -2
  170. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  171. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  172. package/.next/server/app/notebooks/[id]/page/build-manifest.json +5 -5
  173. package/.next/server/app/notebooks/[id]/page.js +2 -2
  174. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  175. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  176. package/.next/server/app/notebooks/page/build-manifest.json +5 -5
  177. package/.next/server/app/notebooks/page.js +2 -2
  178. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  179. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  180. package/.next/server/app/page/build-manifest.json +5 -5
  181. package/.next/server/app/page.js +2 -2
  182. package/.next/server/app/page.js.nft.json +1 -1
  183. package/.next/server/app/page_client-reference-manifest.js +1 -1
  184. package/.next/server/app/practice/page/build-manifest.json +5 -5
  185. package/.next/server/app/practice/page.js +2 -2
  186. package/.next/server/app/practice/page.js.nft.json +1 -1
  187. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  188. package/.next/server/app/print-preview/page/build-manifest.json +5 -5
  189. package/.next/server/app/print-preview/page.js +2 -2
  190. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  191. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  192. package/.next/server/app/register/page/build-manifest.json +5 -5
  193. package/.next/server/app/register/page.js.nft.json +1 -1
  194. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  195. package/.next/server/app/stats/page/build-manifest.json +5 -5
  196. package/.next/server/app/stats/page.js +2 -2
  197. package/.next/server/app/stats/page.js.nft.json +1 -1
  198. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  199. package/.next/server/app/tags/page/build-manifest.json +5 -5
  200. package/.next/server/app/tags/page.js +2 -2
  201. package/.next/server/app/tags/page.js.nft.json +1 -1
  202. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  203. package/.next/server/app-paths-manifest.json +0 -1
  204. package/.next/server/chunks/1jng_app_api_exams_[id]_questions_[questionId]_regenerate_route_actions_1ggead3.js +1 -1
  205. package/.next/server/chunks/1oeh_server_app_api_error-items_[id]_practice-records_route_actions_0z2zuf1.js +1 -1
  206. package/.next/server/chunks/1oeh_server_app_api_error-items_[id]_svg-animation_route_actions_17gckf3.js +1 -1
  207. package/.next/server/chunks/[externals]__04n7qbr._.js +1 -1
  208. package/.next/server/chunks/[externals]__0jzwjtl._.js +3 -0
  209. package/.next/server/chunks/[externals]__0pot68n._.js +1 -1
  210. package/.next/server/chunks/[externals]_assert_1pwe1ri._.js +1 -1
  211. package/.next/server/chunks/[root-of-the-server]__0-2l_pu._.js +3 -0
  212. package/.next/server/chunks/[root-of-the-server]__00_hq9v._.js +6 -6
  213. package/.next/server/chunks/[root-of-the-server]__00moo9h._.js +3 -0
  214. package/.next/server/chunks/[root-of-the-server]__012xcq-._.js +3 -0
  215. package/.next/server/chunks/[root-of-the-server]__01bzczj._.js +1 -1
  216. package/.next/server/chunks/[root-of-the-server]__02pqrw_._.js +3 -0
  217. package/.next/server/chunks/[root-of-the-server]__033ri9p._.js +3 -0
  218. package/.next/server/chunks/[root-of-the-server]__04pjde6._.js +3 -0
  219. package/.next/server/chunks/[root-of-the-server]__064krqp._.js +3 -0
  220. package/.next/server/chunks/[root-of-the-server]__07iraov._.js +3 -0
  221. package/.next/server/chunks/[root-of-the-server]__07jl92a._.js +1 -1
  222. package/.next/server/chunks/[root-of-the-server]__07q7nsp._.js +3 -0
  223. package/.next/server/chunks/[root-of-the-server]__0_t7bbz._.js +1 -1
  224. package/.next/server/chunks/[root-of-the-server]__0_unb90._.js +3 -0
  225. package/.next/server/chunks/[root-of-the-server]__0a1zwxf._.js +3 -0
  226. package/.next/server/chunks/[root-of-the-server]__0aefi10._.js +3 -0
  227. package/.next/server/chunks/[root-of-the-server]__0akadps._.js +1 -1
  228. package/.next/server/chunks/[root-of-the-server]__0cfjgye._.js +3 -0
  229. package/.next/server/chunks/[root-of-the-server]__0d-37yj._.js +3 -0
  230. package/.next/server/chunks/[root-of-the-server]__0d2kpnm._.js +3 -0
  231. package/.next/server/chunks/[root-of-the-server]__0dqgi36._.js +3 -0
  232. package/.next/server/chunks/[root-of-the-server]__0dz5c04._.js +3 -0
  233. package/.next/server/chunks/[root-of-the-server]__0e_u82_._.js +3 -0
  234. package/.next/server/chunks/[root-of-the-server]__0f3jyg0._.js +3 -0
  235. package/.next/server/chunks/[root-of-the-server]__0gwwa9b._.js +3 -0
  236. package/.next/server/chunks/[root-of-the-server]__0hars8c._.js +3 -0
  237. package/.next/server/chunks/[root-of-the-server]__0iozebm._.js +3 -0
  238. package/.next/server/chunks/[root-of-the-server]__0k-5uu2._.js +3 -0
  239. package/.next/server/chunks/[root-of-the-server]__0k3mm05._.js +3 -0
  240. package/.next/server/chunks/[root-of-the-server]__0l-xu_t._.js +3 -0
  241. package/.next/server/chunks/[root-of-the-server]__0lggrcf._.js +3 -0
  242. package/.next/server/chunks/[root-of-the-server]__0m0eall._.js +3 -0
  243. package/.next/server/chunks/[root-of-the-server]__0m37xyb._.js +3 -0
  244. package/.next/server/chunks/[root-of-the-server]__0m8p-6f._.js +1 -1
  245. package/.next/server/chunks/[root-of-the-server]__0pa47kn._.js +3 -0
  246. package/.next/server/chunks/[root-of-the-server]__0r42_o7._.js +3 -0
  247. package/.next/server/chunks/[root-of-the-server]__0rgjh3q._.js +3 -0
  248. package/.next/server/chunks/[root-of-the-server]__0rk_yxy._.js +3 -3
  249. package/.next/server/chunks/[root-of-the-server]__0scij0p._.js +3 -0
  250. package/.next/server/chunks/[root-of-the-server]__0sixhu9._.js +3 -0
  251. package/.next/server/chunks/[root-of-the-server]__0sj18kk._.js +3 -0
  252. package/.next/server/chunks/[root-of-the-server]__0sp4_zo._.js +3 -0
  253. package/.next/server/chunks/[root-of-the-server]__0t2o8v-._.js +3 -0
  254. package/.next/server/chunks/[root-of-the-server]__0w58v6b._.js +3 -0
  255. package/.next/server/chunks/[root-of-the-server]__0wp40ty._.js +3 -0
  256. package/.next/server/chunks/[root-of-the-server]__0wsj4a_._.js +3 -0
  257. package/.next/server/chunks/[root-of-the-server]__0wvvsah._.js +3 -0
  258. package/.next/server/chunks/[root-of-the-server]__0xg5h56._.js +3 -0
  259. package/.next/server/chunks/[root-of-the-server]__0zpazf3._.js +3 -0
  260. package/.next/server/chunks/[root-of-the-server]__10hs-qn._.js +3 -0
  261. package/.next/server/chunks/[root-of-the-server]__119xork._.js +3 -0
  262. package/.next/server/chunks/[root-of-the-server]__11_-ncy._.js +1 -1
  263. package/.next/server/chunks/[root-of-the-server]__11jhplo._.js +3 -0
  264. package/.next/server/chunks/[root-of-the-server]__122xu-0._.js +9 -9
  265. package/.next/server/chunks/[root-of-the-server]__15tkoe6._.js +1 -1
  266. package/.next/server/chunks/[root-of-the-server]__15y1l96._.js +3 -0
  267. package/.next/server/chunks/[root-of-the-server]__16hnc6-._.js +3 -0
  268. package/.next/server/chunks/[root-of-the-server]__17i9sje._.js +3 -0
  269. package/.next/server/chunks/[root-of-the-server]__19_wn9u._.js +3 -0
  270. package/.next/server/chunks/[root-of-the-server]__1_gkx5x._.js +1 -1
  271. package/.next/server/chunks/[root-of-the-server]__1_hp3ol._.js +3 -0
  272. package/.next/server/chunks/[root-of-the-server]__1_ogacf._.js +3 -0
  273. package/.next/server/chunks/[root-of-the-server]__1a4-26x._.js +3 -0
  274. package/.next/server/chunks/[root-of-the-server]__1b6i9mu._.js +3 -0
  275. package/.next/server/chunks/[root-of-the-server]__1b_y2wk._.js +3 -0
  276. package/.next/server/chunks/[root-of-the-server]__1bl7t8i._.js +3 -0
  277. package/.next/server/chunks/[root-of-the-server]__1c0vatt._.js +3 -0
  278. package/.next/server/chunks/[root-of-the-server]__1c7a0rs._.js +3 -0
  279. package/.next/server/chunks/[root-of-the-server]__1chx4lo._.js +3 -0
  280. package/.next/server/chunks/[root-of-the-server]__1cngnud._.js +3 -0
  281. package/.next/server/chunks/[root-of-the-server]__1d82zkk._.js +3 -0
  282. package/.next/server/chunks/[root-of-the-server]__1ezju_2._.js +3 -0
  283. package/.next/server/chunks/[root-of-the-server]__1fc23i5._.js +122 -0
  284. package/.next/server/chunks/[root-of-the-server]__1flnfu4._.js +3 -0
  285. package/.next/server/chunks/[root-of-the-server]__1gya7jq._.js +3 -0
  286. package/.next/server/chunks/[root-of-the-server]__1hng_h2._.js +3 -0
  287. package/.next/server/chunks/[root-of-the-server]__1i40psm._.js +3 -0
  288. package/.next/server/chunks/[root-of-the-server]__1ijkds_._.js +3 -0
  289. package/.next/server/chunks/[root-of-the-server]__1j4v2e3._.js +3 -0
  290. package/.next/server/chunks/[root-of-the-server]__1jtd2ar._.js +2 -2
  291. package/.next/server/chunks/[root-of-the-server]__1kpo44g._.js +1 -1
  292. package/.next/server/chunks/[root-of-the-server]__1lbcdia._.js +3 -0
  293. package/.next/server/chunks/[root-of-the-server]__1m86czr._.js +3 -0
  294. package/.next/server/chunks/[root-of-the-server]__1mnpqkx._.js +3 -0
  295. package/.next/server/chunks/[root-of-the-server]__1n4b6nb._.js +3 -0
  296. package/.next/server/chunks/[root-of-the-server]__1nmrlew._.js +3 -0
  297. package/.next/server/chunks/[root-of-the-server]__1nmtv65._.js +1 -1
  298. package/.next/server/chunks/[root-of-the-server]__1o34kp3._.js +3 -0
  299. package/.next/server/chunks/[root-of-the-server]__1q7yl7l._.js +3 -0
  300. package/.next/server/chunks/[root-of-the-server]__1qv60vg._.js +3 -0
  301. package/.next/server/chunks/[root-of-the-server]__1ry8uat._.js +3 -0
  302. package/.next/server/chunks/[root-of-the-server]__1s2rww3._.js +3 -0
  303. package/.next/server/chunks/[root-of-the-server]__1svvf40._.js +3 -0
  304. package/.next/server/chunks/[root-of-the-server]__1tk0-4v._.js +3 -0
  305. package/.next/server/chunks/[root-of-the-server]__1v-71me._.js +3 -0
  306. package/.next/server/chunks/[root-of-the-server]__1vw740y._.js +9 -9
  307. package/.next/server/chunks/[root-of-the-server]__1x_ud_-._.js +3 -0
  308. package/.next/server/chunks/[root-of-the-server]__1yt_xxr._.js +3 -0
  309. package/.next/server/chunks/_0-eguqv._.js +1 -1
  310. package/.next/server/chunks/_008zx49._.js +1 -1
  311. package/.next/server/chunks/_011-ll5._.js +1 -1
  312. package/.next/server/chunks/_0389uce._.js +1 -1
  313. package/.next/server/chunks/_0431fxn._.js +1 -1
  314. package/.next/server/chunks/_0ekrwj-._.js +6 -6
  315. package/.next/server/chunks/_0gwg6ba._.js +1 -1
  316. package/.next/server/chunks/_0gxi3zr._.js +1 -1
  317. package/.next/server/chunks/_0lz3t4l._.js +2 -2
  318. package/.next/server/chunks/_0n36ev0._.js +3 -0
  319. package/.next/server/chunks/_0oc8oe4._.js +3 -0
  320. package/.next/server/chunks/_0rjzgi0._.js +3 -0
  321. package/.next/server/chunks/_0uxp3uh._.js +1 -1
  322. package/.next/server/chunks/_0x3ltk0._.js +6 -6
  323. package/.next/server/chunks/_10y361h._.js +3 -0
  324. package/.next/server/chunks/_12w5k19._.js +1 -1
  325. package/.next/server/chunks/_13ffmxv._.js +1 -1
  326. package/.next/server/chunks/_14tz_k9._.js +1 -1
  327. package/.next/server/chunks/_15neond._.js +11 -0
  328. package/.next/server/chunks/_16jdov0._.js +1 -1
  329. package/.next/server/chunks/_18amra5._.js +1 -1
  330. package/.next/server/chunks/_1_ns7o3._.js +1 -1
  331. package/.next/server/chunks/_1a1aqmi._.js +1 -1
  332. package/.next/server/chunks/_1a1udq0._.js +1 -1
  333. package/.next/server/chunks/_1b0269x._.js +1 -1
  334. package/.next/server/chunks/_1b7qjlv._.js +1 -1
  335. package/.next/server/chunks/_1be-y66._.js +1 -1
  336. package/.next/server/chunks/_1ex6ovo._.js +1 -1
  337. package/.next/server/chunks/_1fgb9ve._.js +1 -1
  338. package/.next/server/chunks/_1m-yyz-._.js +1 -1
  339. package/.next/server/chunks/_1n1xsqj._.js +3 -0
  340. package/.next/server/chunks/_1oj6gy_._.js +1 -1
  341. package/.next/server/chunks/_1pvqo-q._.js +1 -1
  342. package/.next/server/chunks/_1z_ujac._.js +1 -1
  343. package/.next/server/chunks/_211va-d._.js +1 -1
  344. package/.next/server/chunks/_2194yr7._.js +11 -0
  345. package/.next/server/chunks/_next-internal_server_app_api_admin_dashboard_route_actions_1ispso-.js +1 -1
  346. package/.next/server/chunks/_next-internal_server_app_api_admin_users_[id]_detail_route_actions_0oe_wkt.js +1 -1
  347. package/.next/server/chunks/_next-internal_server_app_api_admin_users_route_actions_0q-rtz1.js +1 -1
  348. package/.next/server/chunks/_next-internal_server_app_api_ai_models_route_actions_0w7iwv-.js +1 -1
  349. package/.next/server/chunks/_next-internal_server_app_api_ai_test_route_actions_1p0n1q8.js +1 -1
  350. package/.next/server/chunks/_next-internal_server_app_api_analytics_route_actions_1e0ou17.js +1 -1
  351. package/.next/server/chunks/_next-internal_server_app_api_analyze_route_actions_0lx-23h.js +1 -1
  352. package/.next/server/chunks/_next-internal_server_app_api_auth_[___nextauth]_route_actions_08nexdk.js +1 -1
  353. package/.next/server/chunks/_next-internal_server_app_api_error-items_[id]_figure_route_actions_0adlts0.js +1 -1
  354. package/.next/server/chunks/_next-internal_server_app_api_error-items_[id]_fix-latex_route_actions_0hc7dhx.js +1 -1
  355. package/.next/server/chunks/_next-internal_server_app_api_error-items_[id]_geogebra_route_actions_1-ks4uv.js +1 -1
  356. package/.next/server/chunks/_next-internal_server_app_api_error-items_[id]_image_route_actions_1k9n5yl.js +1 -1
  357. package/.next/server/chunks/_next-internal_server_app_api_error-items_[id]_reanswer_route_actions_1-sw0j2.js +1 -1
  358. package/.next/server/chunks/_next-internal_server_app_api_error-items_[id]_retag_route_actions_0ckki4n.js +1 -1
  359. package/.next/server/chunks/_next-internal_server_app_api_error-items_[id]_route_actions_1kbs4ux.js +1 -1
  360. package/.next/server/chunks/_next-internal_server_app_api_error-items_batch-delete_route_actions_0hiq_1k.js +1 -1
  361. package/.next/server/chunks/_next-internal_server_app_api_error-items_clear_route_actions_14t_6i-.js +1 -1
  362. package/.next/server/chunks/_next-internal_server_app_api_error-items_list_route_actions_032x4ue.js +1 -1
  363. package/.next/server/chunks/_next-internal_server_app_api_error-items_route_actions_1zdvz0p.js +1 -1
  364. package/.next/server/chunks/_next-internal_server_app_api_error-items_similarity_route_actions_1i26if9.js +1 -1
  365. package/.next/server/chunks/_next-internal_server_app_api_exams_[id]_retry_route_actions_1fdi39f.js +1 -1
  366. package/.next/server/chunks/_next-internal_server_app_api_exams_[id]_route_actions_1wuidrq.js +1 -1
  367. package/.next/server/chunks/_next-internal_server_app_api_exams_route_actions_1c_zhtj.js +1 -1
  368. package/.next/server/chunks/_next-internal_server_app_api_export_route_actions_0lpcnjc.js +1 -1
  369. package/.next/server/chunks/_next-internal_server_app_api_geogebra-analyze_route_actions_1xng0_c.js +1 -1
  370. package/.next/server/chunks/_next-internal_server_app_api_health_route_actions_1ryftkb.js +1 -1
  371. package/.next/server/chunks/_next-internal_server_app_api_import_route_actions_20ko04x.js +1 -1
  372. package/.next/server/chunks/_next-internal_server_app_api_logs_frontend_route_actions_0nxepty.js +1 -1
  373. package/.next/server/chunks/_next-internal_server_app_api_notebooks_[id]_retag_route_actions_00su_t8.js +1 -1
  374. package/.next/server/chunks/_next-internal_server_app_api_notebooks_[id]_route_actions_11j3vxg.js +1 -1
  375. package/.next/server/chunks/_next-internal_server_app_api_notebooks_route_actions_02cy45r.js +1 -1
  376. package/.next/server/chunks/_next-internal_server_app_api_openclaw_batch-upload_route_actions_1zz3oen.js +1 -1
  377. package/.next/server/chunks/_next-internal_server_app_api_practice_generate_route_actions_1krr9n_.js +1 -1
  378. package/.next/server/chunks/_next-internal_server_app_api_practice_record_[id]_route_actions_0zreiom.js +1 -1
  379. package/.next/server/chunks/_next-internal_server_app_api_practice_record_route_actions_0py9z__.js +1 -1
  380. package/.next/server/chunks/_next-internal_server_app_api_reanswer_route_actions_04xweh_.js +1 -1
  381. package/.next/server/chunks/_next-internal_server_app_api_register_route_actions_0vlzh_c.js +1 -1
  382. package/.next/server/chunks/_next-internal_server_app_api_register_status_route_actions_0b52_sj.js +1 -1
  383. package/.next/server/chunks/_next-internal_server_app_api_settings_route_actions_1bpm9ac.js +1 -1
  384. package/.next/server/chunks/_next-internal_server_app_api_stats_practice_clear_route_actions_1iz6iz0.js +1 -1
  385. package/.next/server/chunks/_next-internal_server_app_api_stats_practice_route_actions_1tfoxx-.js +1 -1
  386. package/.next/server/chunks/_next-internal_server_app_api_tags_route_actions_1nb9ma2.js +1 -1
  387. package/.next/server/chunks/_next-internal_server_app_api_tags_stats_route_actions_0fmeadc.js +1 -1
  388. package/.next/server/chunks/_next-internal_server_app_api_tags_suggestions_route_actions_1xpolyv.js +1 -1
  389. package/.next/server/chunks/_next-internal_server_app_api_tasks_route_actions_123tq1_.js +1 -1
  390. package/.next/server/chunks/_next-internal_server_app_favicon_ico_route_actions_0g2jjls.js +1 -1
  391. package/.next/server/chunks/_next-internal_server_app_manifest_webmanifest_route_actions_08hcpz0.js +1 -1
  392. package/.next/server/chunks/node_modules_next_1zdbrne._.js +1 -1
  393. package/.next/server/chunks/node_modules_zod_v4_classic_external_1-pw2v2.js +3 -3
  394. package/.next/server/chunks/src_0tzpy5j._.js +1 -1
  395. package/.next/server/chunks/src_lib_ai_prompts_ts_0z36zms._.js +1 -1
  396. package/.next/server/chunks/src_lib_date-time_ts_14chb27._.js +1 -1
  397. package/.next/server/chunks/src_lib_question-deduplication_ts_1p1bik-._.js +1 -1
  398. package/.next/server/chunks/ssr/[externals]_fs_0pplqgc._.js +1 -1
  399. package/.next/server/chunks/ssr/[root-of-the-server]__00gewu3._.js +3 -3
  400. package/.next/server/chunks/ssr/[root-of-the-server]__03psbtz._.js +3 -0
  401. package/.next/server/chunks/ssr/[root-of-the-server]__05f8wbh._.js +1 -1
  402. package/.next/server/chunks/ssr/[root-of-the-server]__0a0nty7._.js +1 -1
  403. package/.next/server/chunks/ssr/[root-of-the-server]__0ax9dog._.js +1 -1
  404. package/.next/server/chunks/ssr/[root-of-the-server]__0bvtza7._.js +2 -2
  405. package/.next/server/chunks/ssr/[root-of-the-server]__0g_-bym._.js +1 -1
  406. package/.next/server/chunks/ssr/[root-of-the-server]__0gwwr7e._.js +1 -1
  407. package/.next/server/chunks/ssr/[root-of-the-server]__0hzktoi._.js +1 -1
  408. package/.next/server/chunks/ssr/[root-of-the-server]__0koj8h0._.js +1 -1
  409. package/.next/server/chunks/ssr/[root-of-the-server]__0s87xha._.js +1 -1
  410. package/.next/server/chunks/ssr/[root-of-the-server]__0skyo1a._.js +3 -0
  411. package/.next/server/chunks/ssr/[root-of-the-server]__0snpjfe._.js +1 -1
  412. package/.next/server/chunks/ssr/[root-of-the-server]__0y_e9do._.js +1 -1
  413. package/.next/server/chunks/ssr/[root-of-the-server]__0ybs_4c._.js +1 -1
  414. package/.next/server/chunks/ssr/[root-of-the-server]__14l7peq._.js +1 -1
  415. package/.next/server/chunks/ssr/[root-of-the-server]__1507q8a._.js +1 -1
  416. package/.next/server/chunks/ssr/[root-of-the-server]__15ppb9j._.js +1 -1
  417. package/.next/server/chunks/ssr/[root-of-the-server]__191jn5n._.js +1 -1
  418. package/.next/server/chunks/ssr/[root-of-the-server]__1f2jx51._.js +2 -2
  419. package/.next/server/chunks/ssr/[root-of-the-server]__1gth76-._.js +1 -1
  420. package/.next/server/chunks/ssr/[root-of-the-server]__1ko_dw5._.js +1 -1
  421. package/.next/server/chunks/ssr/[root-of-the-server]__1l84pks._.js +1 -1
  422. package/.next/server/chunks/ssr/[root-of-the-server]__1m7qw-2._.js +1 -1
  423. package/.next/server/chunks/ssr/[root-of-the-server]__1ma2oml._.js +1 -1
  424. package/.next/server/chunks/ssr/[root-of-the-server]__1o8jotz._.js +1 -1
  425. package/.next/server/chunks/ssr/[root-of-the-server]__1o__w27._.js +1 -1
  426. package/.next/server/chunks/ssr/[root-of-the-server]__1p7f0va._.js +1 -1
  427. package/.next/server/chunks/ssr/[root-of-the-server]__1sg9eoj._.js +1 -1
  428. package/.next/server/chunks/ssr/[root-of-the-server]__1u74hyi._.js +1 -1
  429. package/.next/server/chunks/ssr/[root-of-the-server]__1xsovpr._.js +1 -1
  430. package/.next/server/chunks/ssr/_054yhx9._.js +1 -1
  431. package/.next/server/chunks/ssr/_07ls0n_._.js +1 -1
  432. package/.next/server/chunks/ssr/_0i9hwpv._.js +1 -1
  433. package/.next/server/chunks/ssr/_0iqp5hs._.js +1 -1
  434. package/.next/server/chunks/ssr/_0m1-rq-._.js +1 -1
  435. package/.next/server/chunks/ssr/_0mgbe2b._.js +1 -1
  436. package/.next/server/chunks/ssr/_0nv22wt._.js +1 -1
  437. package/.next/server/chunks/ssr/_0rz2_qb._.js +5 -5
  438. package/.next/server/chunks/ssr/_0sbbx9z._.js +2 -2
  439. package/.next/server/chunks/ssr/_0sf1gd9._.js +1 -1
  440. package/.next/server/chunks/ssr/_0uemk57._.js +1 -1
  441. package/.next/server/chunks/ssr/_0zj7dlu._.js +1 -1
  442. package/.next/server/chunks/ssr/_11ut-6_._.js +3 -0
  443. package/.next/server/chunks/ssr/_17igtpd._.js +1 -1
  444. package/.next/server/chunks/ssr/_1aot_70._.js +3 -0
  445. package/.next/server/chunks/ssr/_1filpif._.js +3 -0
  446. package/.next/server/chunks/ssr/_1jniqsj._.js +1 -1
  447. package/.next/server/chunks/ssr/_1kgnhmo._.js +2 -2
  448. package/.next/server/chunks/ssr/_1lt1lhz._.js +2 -2
  449. package/.next/server/chunks/ssr/_1yeu09q._.js +1 -1
  450. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0zi5s8-.js +1 -1
  451. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0pt47yr.js +1 -1
  452. package/.next/server/chunks/ssr/_next-internal_server_app_admin_page_actions_1mcickz.js +1 -1
  453. package/.next/server/chunks/ssr/_next-internal_server_app_admin_user_[id]_page_actions_0baj8gs.js +1 -1
  454. package/.next/server/chunks/ssr/_next-internal_server_app_error-items_[id]_page_actions_0qla9ak.js +1 -1
  455. package/.next/server/chunks/ssr/_next-internal_server_app_exams_[id]_print_page_actions_0pxdgxq.js +1 -1
  456. package/.next/server/chunks/ssr/_next-internal_server_app_exams_page_actions_0av69f-.js +1 -1
  457. package/.next/server/chunks/ssr/_next-internal_server_app_latex-test_page_actions_19v7ka0.js +1 -1
  458. package/.next/server/chunks/ssr/_next-internal_server_app_login_page_actions_04fnjo0.js +1 -1
  459. package/.next/server/chunks/ssr/_next-internal_server_app_notebooks_[id]_add_page_actions_0275ft2.js +1 -1
  460. package/.next/server/chunks/ssr/_next-internal_server_app_notebooks_[id]_page_actions_1qj0i-7.js +1 -1
  461. package/.next/server/chunks/ssr/_next-internal_server_app_notebooks_page_actions_06x1kdz.js +1 -1
  462. package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_0hhsz1j.js +1 -1
  463. package/.next/server/chunks/ssr/_next-internal_server_app_practice_page_actions_0cy-h5n.js +1 -1
  464. package/.next/server/chunks/ssr/_next-internal_server_app_print-preview_page_actions_1jhaaln.js +1 -1
  465. package/.next/server/chunks/ssr/_next-internal_server_app_register_page_actions_1op-s-x.js +1 -1
  466. package/.next/server/chunks/ssr/_next-internal_server_app_stats_page_actions_1olf1_a.js +1 -1
  467. package/.next/server/chunks/ssr/node_modules_0o2aki7._.js +1 -1
  468. package/.next/server/chunks/ssr/node_modules_1y5ym6h._.js +1 -1
  469. package/.next/server/chunks/ssr/node_modules_next_1lnqo1a._.js +3 -3
  470. package/.next/server/chunks/ssr/node_modules_next_dist_077yo5w._.js +1 -1
  471. package/.next/server/chunks/ssr/node_modules_next_dist_0nkkbfv._.js +2 -2
  472. package/.next/server/chunks/ssr/node_modules_next_dist_1_c-t1n._.js +4 -4
  473. package/.next/server/chunks/ssr/node_modules_next_dist_1v8aef8._.js +1 -1
  474. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0bew68i._.js +2 -2
  475. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j3._.js +1 -1
  476. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js +1 -1
  477. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892.js +1 -1
  478. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js +1 -1
  479. package/.next/server/chunks/ssr/src_1biegcg._.js +1 -1
  480. package/.next/server/chunks/ssr/src_1gayunq._.js +1 -1
  481. package/.next/server/chunks/ssr/src_1o363ao._.js +1 -1
  482. package/.next/server/chunks/ssr/src_app_admin_page_tsx_0ublbd0._.js +1 -1
  483. package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdm._.js +1 -1
  484. package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5._.js +1 -1
  485. package/.next/server/chunks/ssr/src_app_notebooks_page_tsx_1p9src5._.js +1 -1
  486. package/.next/server/chunks/ssr/src_app_page_tsx_1chiuah._.js +1 -1
  487. package/.next/server/chunks/ssr/src_app_practice_page_tsx_10gnx53._.js +1 -1
  488. package/.next/server/chunks/ssr/src_app_tags_page_tsx_1h2vkk4._.js +1 -1
  489. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv._.js +2 -2
  490. package/.next/server/chunks/ssr/src_lib_date-time_ts_0oyqctn._.js +1 -1
  491. package/.next/server/edge/chunks/[root-of-the-server]__1osrt2u._.js +1 -1
  492. package/.next/server/edge/chunks/_1s0wgnu._.js +1 -1
  493. package/.next/server/edge/chunks/node_modules_0g4gi6f._.js +3 -3
  494. package/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_1iafar9.js +1 -1
  495. package/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_1x1n1fx.js +1 -1
  496. package/.next/server/instrumentation.js +2 -2
  497. package/.next/server/middleware-build-manifest.js +8 -8
  498. package/.next/server/middleware-manifest.json +5 -5
  499. package/.next/server/pages/500.html +1 -1
  500. package/.next/server/server-reference-manifest.js +1 -1
  501. package/.next/server/server-reference-manifest.json +1 -1
  502. package/.next/static/chunks/03gmdewlo3s6u.js +1 -0
  503. package/.next/static/chunks/06q8lm6y95ac4.css +1 -0
  504. package/.next/static/chunks/0_w084ms_lq25.js +22 -0
  505. package/.next/static/chunks/0dzfsm6h13fyr.js +1 -0
  506. package/.next/static/chunks/0ehjiuuxbbhq9.js +1 -0
  507. package/.next/static/chunks/0ij2dqb0qj5ry.js +1 -0
  508. package/.next/static/chunks/0iq53qkw5hvrs.js +1 -0
  509. package/.next/static/chunks/0m81l71kojx8j.js +1 -0
  510. package/.next/static/chunks/0nckb2-62ooyq.js +1 -0
  511. package/.next/static/chunks/0pwdmc9gw8ben.js +33 -0
  512. package/.next/static/chunks/0snej-v5yglxr.js +1 -0
  513. package/.next/static/chunks/1-7k9gbbjkcml.js +1 -0
  514. package/.next/static/chunks/1c92up8k2x0z4.js +1 -0
  515. package/.next/static/chunks/1cd32rtomdngh.js +1 -0
  516. package/.next/static/chunks/1io3-cth_2-cd.js +1 -0
  517. package/.next/static/chunks/1oiuiyv1cv06v.js +31 -0
  518. package/.next/static/chunks/1t4-pobw0y5cf.js +1 -0
  519. package/.next/static/chunks/1xg811762s1p1.js +1 -0
  520. package/.next/static/chunks/1z_5sj1wqi06v.js +1 -0
  521. package/.next/static/chunks/24dymggis4suf.css +3 -0
  522. package/.next/static/chunks/24jbwfpgmio7x.js +1 -0
  523. package/.next/static/chunks/27fr34_1v7xyh.js +1 -0
  524. package/.next/static/chunks/2dlme2fdlkms6.js +1 -0
  525. package/.next/static/chunks/2eu_bls12m1wj.js +1 -0
  526. package/.next/static/chunks/2pmzqbg-qabof.js +1 -0
  527. package/.next/static/chunks/2w2uo9jjxt-re.js +1 -0
  528. package/.next/static/chunks/2x8e_fbze06sd.js +1 -0
  529. package/.next/static/chunks/2z1_5umv36es6.js +191 -0
  530. package/.next/static/chunks/32bl-oqw9oso0.js +1 -0
  531. package/.next/static/chunks/3b-g5_r9nto3s.js +6 -0
  532. package/.next/static/chunks/3g1rm2suowncy.js +3 -0
  533. package/.next/static/chunks/3helovsg02qr4.js +1 -0
  534. package/.next/static/chunks/3jta6jrk-jubq.js +1 -0
  535. package/.next/static/chunks/3m4c1r8_2ga_1.js +1 -0
  536. package/.next/static/chunks/3whzkc6d8oefw.js +1 -0
  537. package/.next/static/chunks/3yhf6xyypekz6.js +1 -0
  538. package/.next/static/chunks/3z9gc_02gl8n9.js +1 -0
  539. package/.next/static/chunks/427wg73nuzpiz.js +5 -0
  540. package/.next/static/chunks/turbopack-1-0r7_puvz3eq.js +1 -0
  541. package/launcher.js +22 -6
  542. package/package.json +1 -1
  543. package/prisma/seed.db +0 -0
  544. package/.next/server/app/api/error-items/[id]/mastery/route/app-paths-manifest.json +0 -3
  545. package/.next/server/app/api/error-items/[id]/mastery/route/build-manifest.json +0 -12
  546. package/.next/server/app/api/error-items/[id]/mastery/route/server-reference-manifest.json +0 -4
  547. package/.next/server/app/api/error-items/[id]/mastery/route.js +0 -8
  548. package/.next/server/app/api/error-items/[id]/mastery/route.js.map +0 -5
  549. package/.next/server/app/api/error-items/[id]/mastery/route.js.nft.json +0 -1
  550. package/.next/server/app/api/error-items/[id]/mastery/route_client-reference-manifest.js +0 -3
  551. package/.next/server/chunks/[externals]__1735khz._.js +0 -3
  552. package/.next/server/chunks/[root-of-the-server]__02j1w81._.js +0 -3
  553. package/.next/server/chunks/[root-of-the-server]__03nfvnm._.js +0 -3
  554. package/.next/server/chunks/[root-of-the-server]__04tyyvs._.js +0 -3
  555. package/.next/server/chunks/[root-of-the-server]__05s4wut._.js +0 -3
  556. package/.next/server/chunks/[root-of-the-server]__06_nln5._.js +0 -3
  557. package/.next/server/chunks/[root-of-the-server]__06h5afw._.js +0 -3
  558. package/.next/server/chunks/[root-of-the-server]__0be5c5r._.js +0 -3
  559. package/.next/server/chunks/[root-of-the-server]__0bqawi0._.js +0 -3
  560. package/.next/server/chunks/[root-of-the-server]__0bsw5c9._.js +0 -3
  561. package/.next/server/chunks/[root-of-the-server]__0c59gc3._.js +0 -3
  562. package/.next/server/chunks/[root-of-the-server]__0cmxmwt._.js +0 -3
  563. package/.next/server/chunks/[root-of-the-server]__0d5dpu4._.js +0 -3
  564. package/.next/server/chunks/[root-of-the-server]__0d9ijed._.js +0 -3
  565. package/.next/server/chunks/[root-of-the-server]__0e22a4y._.js +0 -122
  566. package/.next/server/chunks/[root-of-the-server]__0fnyu4s._.js +0 -3
  567. package/.next/server/chunks/[root-of-the-server]__0gp88gz._.js +0 -3
  568. package/.next/server/chunks/[root-of-the-server]__0inxsnu._.js +0 -3
  569. package/.next/server/chunks/[root-of-the-server]__0j5231l._.js +0 -3
  570. package/.next/server/chunks/[root-of-the-server]__0jaawra._.js +0 -3
  571. package/.next/server/chunks/[root-of-the-server]__0k-nf6a._.js +0 -3
  572. package/.next/server/chunks/[root-of-the-server]__0k-p1pj._.js +0 -3
  573. package/.next/server/chunks/[root-of-the-server]__0lrdm1u._.js +0 -3
  574. package/.next/server/chunks/[root-of-the-server]__0lro5a7._.js +0 -3
  575. package/.next/server/chunks/[root-of-the-server]__0mfjf2y._.js +0 -3
  576. package/.next/server/chunks/[root-of-the-server]__0mqorxb._.js +0 -3
  577. package/.next/server/chunks/[root-of-the-server]__0no6umu._.js +0 -3
  578. package/.next/server/chunks/[root-of-the-server]__0nqbham._.js +0 -3
  579. package/.next/server/chunks/[root-of-the-server]__0o9gtvd._.js +0 -3
  580. package/.next/server/chunks/[root-of-the-server]__0obb4y-._.js +0 -3
  581. package/.next/server/chunks/[root-of-the-server]__0p3u6_q._.js +0 -3
  582. package/.next/server/chunks/[root-of-the-server]__0rmrkd_._.js +0 -3
  583. package/.next/server/chunks/[root-of-the-server]__0tdibjz._.js +0 -3
  584. package/.next/server/chunks/[root-of-the-server]__0u58zap._.js +0 -3
  585. package/.next/server/chunks/[root-of-the-server]__0vhjihq._.js +0 -3
  586. package/.next/server/chunks/[root-of-the-server]__0vz88er._.js +0 -3
  587. package/.next/server/chunks/[root-of-the-server]__0wf9znr._.js +0 -3
  588. package/.next/server/chunks/[root-of-the-server]__0yc8r2x._.js +0 -3
  589. package/.next/server/chunks/[root-of-the-server]__0zv7jom._.js +0 -3
  590. package/.next/server/chunks/[root-of-the-server]__11_1z7m._.js +0 -3
  591. package/.next/server/chunks/[root-of-the-server]__11n87go._.js +0 -3
  592. package/.next/server/chunks/[root-of-the-server]__11p4ahb._.js +0 -3
  593. package/.next/server/chunks/[root-of-the-server]__131taws._.js +0 -3
  594. package/.next/server/chunks/[root-of-the-server]__13ebiit._.js +0 -3
  595. package/.next/server/chunks/[root-of-the-server]__1413v0e._.js +0 -3
  596. package/.next/server/chunks/[root-of-the-server]__14dnbrn._.js +0 -3
  597. package/.next/server/chunks/[root-of-the-server]__14jqm9_._.js +0 -3
  598. package/.next/server/chunks/[root-of-the-server]__152lbaw._.js +0 -3
  599. package/.next/server/chunks/[root-of-the-server]__16begv4._.js +0 -3
  600. package/.next/server/chunks/[root-of-the-server]__17duis5._.js +0 -3
  601. package/.next/server/chunks/[root-of-the-server]__17q3k-v._.js +0 -3
  602. package/.next/server/chunks/[root-of-the-server]__184u6de._.js +0 -3
  603. package/.next/server/chunks/[root-of-the-server]__18atlj8._.js +0 -3
  604. package/.next/server/chunks/[root-of-the-server]__18c7l6u._.js +0 -3
  605. package/.next/server/chunks/[root-of-the-server]__18zrkky._.js +0 -3
  606. package/.next/server/chunks/[root-of-the-server]__19vj8qy._.js +0 -3
  607. package/.next/server/chunks/[root-of-the-server]__1aaux7e._.js +0 -3
  608. package/.next/server/chunks/[root-of-the-server]__1cceu4b._.js +0 -3
  609. package/.next/server/chunks/[root-of-the-server]__1cn6rlb._.js +0 -3
  610. package/.next/server/chunks/[root-of-the-server]__1csfdxc._.js +0 -3
  611. package/.next/server/chunks/[root-of-the-server]__1ezwxao._.js +0 -3
  612. package/.next/server/chunks/[root-of-the-server]__1g1wi9i._.js +0 -3
  613. package/.next/server/chunks/[root-of-the-server]__1gmc_uw._.js +0 -3
  614. package/.next/server/chunks/[root-of-the-server]__1h09r50._.js +0 -3
  615. package/.next/server/chunks/[root-of-the-server]__1hpwwxw._.js +0 -3
  616. package/.next/server/chunks/[root-of-the-server]__1j6mx-v._.js +0 -3
  617. package/.next/server/chunks/[root-of-the-server]__1jdi-1f._.js +0 -3
  618. package/.next/server/chunks/[root-of-the-server]__1ju8z29._.js +0 -3
  619. package/.next/server/chunks/[root-of-the-server]__1kqv61m._.js +0 -3
  620. package/.next/server/chunks/[root-of-the-server]__1lct0vi._.js +0 -3
  621. package/.next/server/chunks/[root-of-the-server]__1loecue._.js +0 -3
  622. package/.next/server/chunks/[root-of-the-server]__1m4-ab6._.js +0 -3
  623. package/.next/server/chunks/[root-of-the-server]__1mkpya8._.js +0 -3
  624. package/.next/server/chunks/[root-of-the-server]__1nwf3ua._.js +0 -3
  625. package/.next/server/chunks/[root-of-the-server]__1oup682._.js +0 -3
  626. package/.next/server/chunks/[root-of-the-server]__1p8hw44._.js +0 -3
  627. package/.next/server/chunks/[root-of-the-server]__1pplzr1._.js +0 -3
  628. package/.next/server/chunks/[root-of-the-server]__1rsn804._.js +0 -3
  629. package/.next/server/chunks/[root-of-the-server]__1sdtn83._.js +0 -3
  630. package/.next/server/chunks/[root-of-the-server]__1u-1vx4._.js +0 -3
  631. package/.next/server/chunks/[root-of-the-server]__1v6nwhq._.js +0 -3
  632. package/.next/server/chunks/[root-of-the-server]__20465pr._.js +0 -3
  633. package/.next/server/chunks/[root-of-the-server]__207mxv8._.js +0 -3
  634. package/.next/server/chunks/_0_o8yhv._.js +0 -3
  635. package/.next/server/chunks/_0c5hvv3._.js +0 -11
  636. package/.next/server/chunks/_0frix22._.js +0 -11
  637. package/.next/server/chunks/_0rdo0a4._.js +0 -3
  638. package/.next/server/chunks/_167vv93._.js +0 -3
  639. package/.next/server/chunks/_1e1h1f1._.js +0 -3
  640. package/.next/server/chunks/_1flar98._.js +0 -3
  641. package/.next/server/chunks/_next-internal_server_app_api_error-items_[id]_mastery_route_actions_1l5uan6.js +0 -3
  642. package/.next/server/chunks/ssr/[root-of-the-server]__0b8kewv._.js +0 -3
  643. package/.next/server/chunks/ssr/[root-of-the-server]__0icjezr._.js +0 -3
  644. package/.next/server/chunks/ssr/_062gk85._.js +0 -3
  645. package/.next/server/chunks/ssr/_0idg05p._.js +0 -3
  646. package/.next/server/chunks/ssr/_1gu1rou._.js +0 -3
  647. package/.next/static/chunks/02d-8f2qj7j3j.js +0 -1
  648. package/.next/static/chunks/02t7qqptint2p.js +0 -1
  649. package/.next/static/chunks/090a6irxe0c6j.js +0 -1
  650. package/.next/static/chunks/0bhxyq7e2eqjc.js +0 -5
  651. package/.next/static/chunks/0if-vqkhyn-zc.js +0 -1
  652. package/.next/static/chunks/0jf31atbtr1mv.js +0 -1
  653. package/.next/static/chunks/0te6mr86gdyyi.js +0 -191
  654. package/.next/static/chunks/0vgthy7v615hq.js +0 -1
  655. package/.next/static/chunks/1e5n4cprhwujv.js +0 -1
  656. package/.next/static/chunks/1edfvwc5_eck-.js +0 -31
  657. package/.next/static/chunks/1f0u19gh5_49z.js +0 -1
  658. package/.next/static/chunks/1fdj59ys-pend.js +0 -1
  659. package/.next/static/chunks/1kerqdluzq2l0.js +0 -1
  660. package/.next/static/chunks/1r4lwlvm7m53v.js +0 -1
  661. package/.next/static/chunks/1rz1bokv9edzr.js +0 -1
  662. package/.next/static/chunks/1s-d67d-yroyw.js +0 -1
  663. package/.next/static/chunks/1tw5_upsy-qj_.js +0 -22
  664. package/.next/static/chunks/1w1xvldfmcs67.js +0 -6
  665. package/.next/static/chunks/1zdof8ylzqm8w.js +0 -1
  666. package/.next/static/chunks/2-k1hjh6ff6y4.js +0 -1
  667. package/.next/static/chunks/21qpve5q3mjly.js +0 -1
  668. package/.next/static/chunks/21v32ctwcoxqt.js +0 -1
  669. package/.next/static/chunks/27-t289uq6_ju.js +0 -3
  670. package/.next/static/chunks/293-te2b34thz.js +0 -1
  671. package/.next/static/chunks/2dgleoh5fbs83.js +0 -1
  672. package/.next/static/chunks/2di_nd6djcxwu.js +0 -1
  673. package/.next/static/chunks/2mk03owifu2m1.js +0 -33
  674. package/.next/static/chunks/2qza4p5d9fz_2.js +0 -1
  675. package/.next/static/chunks/2s4c8fcrdnew4.js +0 -1
  676. package/.next/static/chunks/2zdqnkem9n6a9.js +0 -1
  677. package/.next/static/chunks/3-wm04s--suy5.js +0 -1
  678. package/.next/static/chunks/33t46atd3n2zd.js +0 -1
  679. package/.next/static/chunks/37yx4gh09tzwc.js +0 -1
  680. package/.next/static/chunks/3c4-ozf1dxam2.css +0 -1
  681. package/.next/static/chunks/3gwb465dhjxo9.js +0 -1
  682. package/.next/static/chunks/3hkgw-uib19xl.js +0 -1
  683. package/.next/static/chunks/3n-yabfsiog4i.css +0 -3
  684. package/.next/static/chunks/3umldi5zknsyi.js +0 -1
  685. package/.next/static/chunks/turbopack-1yjxh4vceobdr.js +0 -1
  686. /package/.next/static/{678uJSzOSzePaLyv5hUv0 → Y0pwgmRdVAifh_zukihNt}/_buildManifest.js +0 -0
  687. /package/.next/static/{678uJSzOSzePaLyv5hUv0 → Y0pwgmRdVAifh_zukihNt}/_clientMiddlewareManifest.js +0 -0
  688. /package/.next/static/{678uJSzOSzePaLyv5hUv0 → Y0pwgmRdVAifh_zukihNt}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71689,e=>{"use strict";let s=(0,e.i(75254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,s],71689)},66944,e=>{"use strict";var s=e.i(18050),t=e.i(71645),r=e.i(18566),a=e.i(19455),i=e.i(90546),n=e.i(11445),l=e.i(49704),c=e.i(41931),o=e.i(11110),m=e.i(35209),d=e.i(69817);function p(){var e,p,x,u;let h=(0,r.useSearchParams)(),{t:g}=(0,o.useLanguage)(),[w,f]=(0,t.useState)([]);(0,m.usePageTitle)(g.printPreview.title);let[j,v]=(0,t.useState)(!0),[b,N]=(0,t.useState)(!1),[y,S]=(0,t.useState)(!1),[P,k]=(0,t.useState)(!1),[I,T]=(0,t.useState)(70),[A,C]=(0,t.useState)(!1),[E,L]=(0,t.useState)(new Set);(0,t.useEffect)(()=>{R()},[]);let R=async()=>{try{let e=new URLSearchParams(h.toString());e.set("pageSize",String(d.PRINT_PREVIEW_PAGE_SIZE));let s=await c.apiClient.get(`/api/error-items/list?${e.toString()}`);f(s.items),L(new Set(s.items.map(e=>e.id)))}catch(e){console.error(e)}finally{v(!1)}},B=w.filter(e=>E.has(e.id)),$=!b&&!y,_=(e=w.length,(p=B.length)===e?String(e):`${p}/${e}`),U=(x=w.length,u=B.length,0===x?"noItems":0===u?"noSelection":null);return j?(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,s.jsx)("p",{className:"text-muted-foreground",children:g.common.loading})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"print:hidden sticky top-0 z-10 bg-background border-b p-3 sm:p-4 shadow-sm",children:(0,s.jsxs)("div",{className:"max-w-6xl mx-auto space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(i.BackButton,{fallbackUrl:"/notebooks"}),(0,s.jsxs)("h1",{className:"text-lg sm:text-xl font-bold flex-1",children:[g.printPreview?.title||"Print Preview"," (",_," ",g.notebooks?.items||"items",")"]}),(0,s.jsx)(a.Button,{onClick:()=>{window.print()},size:"sm",className:"whitespace-nowrap",disabled:0===B.length,children:g.printPreview?.printButton||"Print / Save PDF"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,s.jsxs)("span",{className:"whitespace-nowrap text-xs sm:text-sm",children:[g.printPreview?.imageScale||"Image Scale",": ",I,"%"]}),(0,s.jsx)("input",{type:"range",min:"30",max:"100",value:I,onChange:e=>T(Number(e.target.value)),className:"w-16 sm:w-20 accent-primary"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 sm:gap-4",children:[(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:A,onChange:e=>C(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),g.printPreview?.showQuestionText||"Question Text"]}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:b,onChange:e=>N(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),g.printPreview?.showAnswers||"Show Answers"]}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:y,onChange:e=>S(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),g.printPreview?.showAnalysis||"Show Analysis"]}),(0,s.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,s.jsx)("input",{type:"checkbox",checked:P,onChange:e=>k(e.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),g.printPreview?.showTags||"Show Tags"]})]})]}),(0,s.jsxs)("div",{className:"rounded-md border bg-muted/20 p-3 space-y-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("div",{className:"text-sm font-medium",children:[g.printPreview?.selectItems||"Select Items"," (",B.length,"/",w.length,")"]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(a.Button,{variant:"outline",size:"sm",onClick:()=>{L(new Set(w.map(e=>e.id)))},children:g.printPreview?.selectAll||"Select All"}),(0,s.jsx)(a.Button,{variant:"outline",size:"sm",onClick:()=>{L(new Set)},children:g.printPreview?.clearSelection||"Clear Selection"})]})]}),(0,s.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3 max-h-44 overflow-y-auto pr-1",children:w.map((e,t)=>(0,s.jsxs)("label",{className:"flex items-start gap-2 rounded border bg-background p-2 text-xs cursor-pointer hover:border-primary/50",children:[(0,s.jsx)("input",{type:"checkbox",checked:E.has(e.id),onChange:()=>{var s;return s=e.id,void L(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},className:"mt-0.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,s.jsxs)("span",{className:"line-clamp-2",children:[(0,s.jsx)("span",{className:"font-semibold",children:g.printPreview?.questionNumber?.replace("{num}",String(t+1))||`Question ${t+1}`}),e.questionText?`:${e.questionText}`:""]})]},e.id))})]})]})}),(0,s.jsxs)("div",{className:"max-w-4xl mx-auto p-8 print:p-0",children:[B.map((e,t)=>{let r=[];if(e.tags&&e.tags.length>0)r=e.tags.map(e=>e.name);else try{r=JSON.parse(e.knowledgePoints||"[]")}catch(e){r=[]}return(0,s.jsxs)("div",{className:`mb-4 border-b last:border-b-0 print:break-inside-avoid ${$?"pb-20 print:pb-16":"pb-6"}`,children:[(0,s.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 leading-7",children:[(0,s.jsx)("span",{className:"text-lg font-bold",children:g.printPreview?.questionNumber?.replace("{num}",String(t+1))||`Question ${t+1}`}),e.shortId&&(0,s.jsx)("span",{className:"font-mono text-sm text-muted-foreground whitespace-nowrap",children:g.printPreview.source.replace("{id}",e.shortId)}),e.subject&&(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:e.subject.name}),e.gradeSemester&&(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:e.gradeSemester}),e.paperLevel&&(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:[g.printPreview?.paperLevel||"Paper Level",": ",e.paperLevel.toUpperCase()]}),P&&r.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"font-semibold",children:[g.printPreview?.knowledgePoints||"Knowledge Points",":"]}),r.map((e,t)=>(0,s.jsx)("span",{className:"px-2 py-1 bg-muted rounded text-sm",children:e},`${e}-${t}`))]})]}),A&&e.questionText?(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)(n.MarkdownRenderer,{content:e.questionText}),(0,s.jsx)(l.QuestionFigure,{svg:e.figureSvg})]}):e.originalImageUrl&&(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)("img",{src:e.originalImageUrl,alt:g.detail?.originalProblem||"Question Image",className:"h-auto border rounded",style:{maxWidth:`${I}%`}})}),b&&e.answerText&&(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("h3",{className:"font-semibold mb-2",children:[g.printPreview?.referenceAnswer||"Reference Answer",":"]}),(0,s.jsx)(n.MarkdownRenderer,{content:e.answerText})]}),y&&e.analysis&&(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("h3",{className:"font-semibold mb-2",children:[g.printPreview?.analysis||"Analysis",":"]}),(0,s.jsx)(n.MarkdownRenderer,{content:e.analysis})]})]},e.id)}),U&&(0,s.jsx)("div",{className:"text-center py-12 text-muted-foreground",children:"noSelection"===U?g.printPreview?.noSelection||"No items selected":g.printPreview?.noItems||"No matching error items"})]})]})}e.s(["default",0,function(){let{t:e}=(0,o.useLanguage)();return(0,s.jsx)(t.Suspense,{fallback:(0,s.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:e.common.loading}),children:(0,s.jsx)(p,{})})}],66944)},49704,e=>{"use strict";var s=e.i(18050),t=e.i(11110),r=e.i(75157);e.s(["QuestionFigure",0,function({svg:e,className:a}){let{t:i}=(0,t.useLanguage)();return e?(0,s.jsx)("figure",{className:(0,r.cn)("question-figure my-3",a),children:(0,s.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:i.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360}})}):null}],49704)},90546,e=>{"use strict";var s=e.i(18050),t=e.i(18566),r=e.i(19455),a=e.i(71689);e.s(["BackButton",0,function({fallbackUrl:e,className:i}){let n=(0,t.useRouter)();return(0,s.jsx)(r.Button,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:i,children:(0,s.jsx)(a.ArrowLeft,{className:"h-5 w-5"})})}])},69817,e=>{"use strict";e.s(["DEFAULT_PAGE_SIZE",0,18,"MAX_VISIBLE_PAGES",0,5,"PRINT_PREVIEW_PAGE_SIZE",0,200])},35209,e=>{"use strict";var s=e.i(71645),t=e.i(11110);e.s(["usePageTitle",0,function(...e){let{t:r}=(0,t.useLanguage)(),a=[r.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=a},[a])}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71689,e=>{"use strict";let t=(0,e.i(75254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],71689)},8821,e=>{"use strict";let t=(0,e.i(75254).default)("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);e.s(["default",0,t])},52801,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(22016),r=e.i(15519),n=e.i(30691),i=e.i(78583),l=e.i(7233),c=e.i(19455),d=e.i(15288),o=e.i(12505),u=e.i(93842),m=e.i(86963),x=e.i(18566),p=e.i(31278),h=e.i(8821),h=h,f=e.i(57428),g=e.i(93479),j=e.i(10204),b=e.i(88218),v=e.i(11110),y=e.i(41931);let N=["unmastered","mastered","all"],k=["least_practiced","random"],w=["easy","medium","hard","harder"];function C(){let{t:e,language:s}=(0,v.useLanguage)(),r=(0,x.useRouter)(),[n,i]=(0,a.useState)([]),[l,o]=(0,a.useState)([]),[u,m]=(0,a.useState)([]),[C,S]=(0,a.useState)("unmastered"),[E,R]=(0,a.useState)("least_practiced"),[L,P]=(0,a.useState)(10),[T,B]=(0,a.useState)("medium"),[M,_]=(0,a.useState)(""),[I,$]=(0,a.useState)(!1),[D,H]=(0,a.useState)(null);(0,a.useEffect)(()=>{y.apiClient.get("/api/notebooks").then(e=>{i(e),1===e.length&&o([e[0].id])}).catch(()=>i([]))},[]);let F=async t=>{if(t.preventDefault(),0===l.length)return void H(e.exam.noNotebook);$(!0),H(null);try{let e=await y.apiClient.post("/api/exams",{subjectIds:l,tagNames:u,scope:C,pickRule:E,count:L,difficulty:T,title:M.trim()||void 0,language:s});r.push(`/exams/${e.id}`)}catch(t){H("NO_SOURCE_ITEMS"===t?.data?.message?e.exam.noSource:e.common.messages?.saveFailed||"Failed"),$(!1)}},A=e.practice.difficulty;return(0,t.jsxs)(d.Card,{children:[(0,t.jsx)(d.CardHeader,{children:(0,t.jsx)(d.CardTitle,{className:"text-lg",children:e.exam.createTitle})}),(0,t.jsx)(d.CardContent,{children:(0,t.jsxs)("form",{onSubmit:F,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)(j.Label,{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)(f.Checkbox,{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)(j.Label,{children:e.exam.tags}),(0,t.jsx)(b.TagInput,{value:u,onChange:m,placeholder:e.exam.tagsPlaceholder})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.Label,{children:e.exam.scope}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-md bg-muted p-1",children:N.map(a=>(0,t.jsx)("button",{type:"button",onClick:()=>S(a),className:`rounded px-2 py-1.5 text-sm transition-colors ${C===a?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:e.exam.scopes[a]},a))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.Label,{htmlFor:"exam-count",children:e.exam.count}),(0,t.jsx)(g.Input,{id:"exam-count",type:"number",min:1,max:50,value:L,onChange:e=>P(Math.min(50,Math.max(1,parseInt(e.target.value,10)||1)))})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.Label,{htmlFor:"exam-difficulty",children:e.exam.difficulty}),(0,t.jsx)("select",{id:"exam-difficulty",value:T,onChange:e=>B(e.target.value),className:"h-9 w-full rounded-md border bg-background px-3 text-sm",children:w.map(e=>(0,t.jsx)("option",{value:e,children:A[e]},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.Label,{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:k.map(a=>(0,t.jsx)("button",{type:"button",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:e.exam.pickRules[a]},a))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e.exam.pickRuleHints[E]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(j.Label,{htmlFor:"exam-title",children:e.exam.titleLabel}),(0,t.jsx)(g.Input,{id:"exam-title",value:M,maxLength:100,onChange:e=>_(e.target.value)})]}),D&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:D}),(0,t.jsxs)(c.Button,{type:"submit",disabled:I,className:"w-full sm:w-auto",children:[I?(0,t.jsx)(p.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(h.default,{className:"mr-2 h-4 w-4"}),I?e.exam.creating:e.exam.generate]})]})})]})}var S=e.i(63661),E=e.i(35209);e.s(["default",0,function(){let{timeZone:e}=(0,r.useTimeZone)(),{t:x}=(0,v.useLanguage)();(0,E.usePageTitle)(x.exam.title);let[p,h]=(0,a.useState)(null),[f,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{y.apiClient.get("/api/exams").then(e=>{h(e),0===e.length&&g(!0)}).catch(()=>h([]))},[]);let j=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)(u.PageHeader,{title:x.exam.title,description:x.exam.subtitle,actions:!f&&(0,t.jsxs)(c.Button,{onClick:()=>g(!0),"aria-label":x.exam.create,children:[(0,t.jsx)(l.Plus,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:x.exam.create})]})}),f&&(0,t.jsx)(C,{}),(0,t.jsxs)("section",{className:"space-y-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold",children:x.exam.list}),null===p?(0,t.jsx)(m.PageLoading,{}):0===p.length?(0,t.jsx)(o.EmptyState,{icon:i.FileText,title:x.exam.empty,className:"py-10"}):(0,t.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:p.map(a=>(0,t.jsx)(s.default,{href:`/exams/${a.id}`,children:(0,t.jsx)(d.Card,{className:"h-full rounded-2xl transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md",children:(0,t.jsxs)(d.CardContent,{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.FileText,{className:"h-4 w-4 shrink-0 text-primary"}),a.title]}),(0,t.jsx)(S.ExamStatusBadge,{status:a.status})]}),(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.formatDateTime)(a.createdAt,"yyyy-MM-dd HH:mm",e)}),(0,t.jsx)("span",{children:x.exam.questionCount.replace("{count}",String(a.questionCount))}),(0,t.jsx)("span",{children:x.exam.scopes[a.scope]}),(0,t.jsx)("span",{children:j[a.difficulty]||a.difficulty}),(0,t.jsx)("span",{children:a.recordedCount>0?x.exam.recorded:x.exam.notRecorded})]})]})})},a.id))})]})]})})}],52801)},63661,e=>{"use strict";var t=e.i(18050),a=e.i(87486),s=e.i(11110);let r={generating:"bg-blue-100 text-blue-700 border-blue-200",ready:"bg-green-100 text-green-700 border-green-200",partial:"bg-amber-100 text-amber-700 border-amber-200",failed:"bg-red-100 text-red-700 border-red-200"};e.s(["ExamStatusBadge",0,function({status:e}){let{t:n}=(0,s.useLanguage)();return(0,t.jsx)(a.Badge,{variant:"outline",className:r[e],children:n.exam.status[e]})}])},88218,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(37727),r=e.i(87486),n=e.i(93479),i=e.i(41931);e.s(["TagInput",0,function({value:e=[],onChange:l,placeholder:c="Enter tags...",className:d="",enterHint:o,subject:u,gradeStage:m}){let[x,p]=(0,a.useState)(""),[h,f]=(0,a.useState)([]),[g,j]=(0,a.useState)(!1),[b,v]=(0,a.useState)(0),y=(0,a.useRef)(null),N=(0,a.useRef)(null);(0,a.useEffect)(()=>{x.trim()?k(x):(f([]),j(!1))},[x,u,m]);let k=async t=>{try{let a=new URLSearchParams({q:t});u&&a.append("subject",u),m&&a.append("stage",m);let s=((await i.apiClient.get(`/api/tags/suggestions?${a.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));f(s.slice(0,20)),j(s.length>0),v(0)}catch(e){console.error("Failed to fetch suggestions:",e)}},w=t=>{t.trim()&&!e.includes(t.trim())&&(l([...e,t.trim()]),p(""),f([]),j(!1),v(0))},C=t=>{l(e.filter(e=>e!==t))};return(0,a.useEffect)(()=>{let e=e=>{!N.current||N.current.contains(e.target)||y.current?.contains(e.target)||j(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${d}`,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)(r.Badge,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>C(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.Input,{ref:y,type:"text",value:x,onChange:e=>p(e.target.value),onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&h[b]?w(h[b]):x.trim()&&w(x)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,h.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(j(!1),v(0)):"Backspace"===t.key&&!x&&e.length>0&&C(e[e.length-1])},onFocus:()=>{h.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"})]}),g&&h.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:h.map((e,a)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${a===b?"bg-accent":""}`,onClick:()=>w(e),onMouseEnter:()=>v(a),children:e},e))}),x&&!g&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:o?`${o} "${x}"`:`Press Enter to create "${x}"`})]})}])},90546,e=>{"use strict";var t=e.i(18050),a=e.i(18566),s=e.i(19455),r=e.i(71689);e.s(["BackButton",0,function({fallbackUrl:e,className:n}){let i=(0,a.useRouter)();return(0,t.jsx)(s.Button,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:n,children:(0,t.jsx)(r.ArrowLeft,{className:"h-5 w-5"})})}])},15288,e=>{"use strict";var t=e.i(18050),a=e.i(75157);e.s(["Card",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...s})},"CardContent",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",e),...s})},"CardDescription",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",e),...s})},"CardHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...s})},"CardTitle",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",e),...s})}])},57428,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(20783),r=e.i(30030),n=e.i(81140),i=e.i(69340),l=e.i(99682),c=e.i(35804),d=e.i(96626);e.i(74080);var o=Symbol("radix.slottable");function u(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===o}var m=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{var n,i;let l,c,d,o=(i=n=`Primitive.${r}`,(l=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(a.isValidElement(r)){var i;let e,l,c=(i=r,(l=(e=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.ref:(l=(e=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.props.ref:i.props.ref||i.ref),d=function(e,t){let a={...t};for(let s in t){let r=e[s],n=t[s];/^on[A-Z]/.test(s)?r&&n?a[s]=(...e)=>{let t=n(...e);return r(...e),t}:r&&(a[s]=r):"style"===s?a[s]={...r,...n}:"className"===s&&(a[s]=[r,n].filter(Boolean).join(" "))}return{...e,...a}}(n,r.props);return r.type!==a.Fragment&&(d.ref=t?(0,s.composeRefs)(t,c):c),a.cloneElement(r,d)}return a.Children.count(r)>1?a.Children.only(null):null})).displayName=`${i}.SlotClone`,c=l,(d=a.forwardRef((e,s)=>{let{children:r,...n}=e,i=a.Children.toArray(r),l=i.find(u);if(l){let e=l.props.children,r=i.map(t=>t!==l?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,t.jsx)(c,{...n,ref:s,children:a.isValidElement(e)?a.cloneElement(e,void 0,r):null})}return(0,t.jsx)(c,{...n,ref:s,children:r})})).displayName=`${n}.Slot`,d),m=a.forwardRef((e,a)=>{let{asChild:s,...n}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(s?o:r,{...n,ref:a})});return m.displayName=`Primitive.${r}`,{...e,[r]:m}},{}),x="Checkbox",[p,h]=(0,r.createContextScope)(x),[f,g]=p(x);function j(e){let{__scopeCheckbox:s,checked:r,children:n,defaultChecked:l,disabled:c,form:d,name:o,onCheckedChange:u,required:m,value:p="on",internal_do_not_use_render:h}=e,[g,j]=(0,i.useControllableState)({prop:r,defaultProp:l??!1,onChange:u,caller:x}),[b,v]=a.useState(null),[y,N]=a.useState(null),k=a.useRef(!1),w=!b||!!d||!!b.closest("form"),C={checked:g,disabled:c,setChecked:j,control:b,setControl:v,name:o,form:d,value:p,hasConsumerStoppedPropagationRef:k,required:m,defaultChecked:!S(l)&&l,isFormControl:w,bubbleInput:y,setBubbleInput:N};return(0,t.jsx)(f,{scope:s,...C,children:"function"==typeof h?h(C):n})}var b="CheckboxTrigger",v=a.forwardRef(({__scopeCheckbox:e,onKeyDown:r,onClick:i,...l},c)=>{let{control:d,value:o,disabled:u,checked:x,required:p,setControl:h,setChecked:f,hasConsumerStoppedPropagationRef:j,isFormControl:v,bubbleInput:y}=g(b,e),N=(0,s.useComposedRefs)(c,h),k=a.useRef(x);return a.useEffect(()=>{let e=d?.form;if(e){let t=()=>f(k.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,f]),(0,t.jsx)(m.button,{type:"button",role:"checkbox","aria-checked":S(x)?"mixed":x,"aria-required":p,"data-state":E(x),"data-disabled":u?"":void 0,disabled:u,value:o,...l,ref:N,onKeyDown:(0,n.composeEventHandlers)(r,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,n.composeEventHandlers)(i,e=>{f(e=>!!S(e)||!e),y&&v&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})})});v.displayName=b;var y=a.forwardRef((e,a)=>{let{__scopeCheckbox:s,name:r,checked:n,defaultChecked:i,required:l,disabled:c,value:d,onCheckedChange:o,form:u,...m}=e;return(0,t.jsx)(j,{__scopeCheckbox:s,checked:n,defaultChecked:i,disabled:c,required:l,onCheckedChange:o,name:r,form:u,value:d,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{...m,ref:a,__scopeCheckbox:s}),e&&(0,t.jsx)(C,{__scopeCheckbox:s})]})})});y.displayName=x;var N="CheckboxIndicator",k=a.forwardRef((e,a)=>{let{__scopeCheckbox:s,forceMount:r,...n}=e,i=g(N,s);return(0,t.jsx)(d.Presence,{present:r||S(i.checked)||!0===i.checked,children:(0,t.jsx)(m.span,{"data-state":E(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:a,style:{pointerEvents:"none",...e.style}})})});k.displayName=N;var w="CheckboxBubbleInput",C=a.forwardRef(({__scopeCheckbox:e,...r},n)=>{let{control:i,hasConsumerStoppedPropagationRef:d,checked:o,defaultChecked:u,required:x,disabled:p,name:h,value:f,form:j,bubbleInput:b,setBubbleInput:v}=g(w,e),y=(0,s.useComposedRefs)(n,v),N=(0,l.usePrevious)(o),k=(0,c.useSize)(i);a.useEffect(()=>{if(!b)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!d.current;if(N!==o&&e){let a=new Event("click",{bubbles:t});b.indeterminate=S(o),e.call(b,!S(o)&&o),b.dispatchEvent(a)}},[b,N,o,d]);let C=a.useRef(!S(o)&&o);return(0,t.jsx)(m.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??C.current,required:x,disabled:p,name:h,value:f,form:j,...r,tabIndex:-1,ref:y,style:{...r.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function S(e){return"indeterminate"===e}function E(e){return S(e)?"indeterminate":e?"checked":"unchecked"}C.displayName=w;var R=e.i(43531),L=e.i(75157);let P=a.forwardRef(({className:e,...a},s)=>(0,t.jsx)(y,{ref:s,className:(0,L.cn)("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)(k,{className:(0,L.cn)("flex items-center justify-center text-current"),children:(0,t.jsx)(R.Check,{className:"h-4 w-4"})})}));P.displayName=y.displayName,e.s(["Checkbox",0,P],57428)},12505,e=>{"use strict";var t=e.i(18050),a=e.i(75157);e.s(["EmptyState",0,function({icon:e,title:s,description:r,action:n,className:i}){return(0,t.jsxs)("div",{className:(0,a.cn)("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}),r&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:r}),n&&(0,t.jsx)("div",{className:"mt-5",children:n})]})}])},93842,e=>{"use strict";var t=e.i(18050),a=e.i(90546),s=e.i(75157);e.s(["PageHeader",0,function({title:e,description:r,backHref:n,actions:i,titleAddon:l,className:c}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex items-start gap-3",c),children:[n&&(0,t.jsx)(a.BackButton,{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]}),r&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:r})]}),i&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:i})]})}])},86963,e=>{"use strict";var t=e.i(18050),a=e.i(31278);e.s(["PageLoading",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)(a.Loader2,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{"use strict";var t=e.i(71645),a=e.i(11110);e.s(["usePageTitle",0,function(...e){let{t:s}=(0,a.useLanguage)(),r=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94542,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(17255),r=e.i(18566),i=e.i(19455),n=e.i(93479),l=e.i(15288),d=e.i(22016),o=e.i(80342),c=e.i(11110),u=e.i(35209);e.s(["default",0,function(){let e=(0,r.useRouter)(),{t:g,language:m}=(0,c.useLanguage)();(0,u.usePageTitle)(g.pageTitle.login);let[x,h]=(0,a.useState)(""),[p,f]=(0,a.useState)(""),[v,j]=(0,a.useState)(""),[b,N]=(0,a.useState)(!1),w=async t=>{t.preventDefault(),N(!0),j("");try{let t=await (0,s.signIn)("credentials",{redirect:!1,email:x,password:p});t?.error?j(g.auth?.login?.failed||"Login failed"):(e.push("/"),e.refresh())}catch(e){j(g.auth?.login?.error||"An error occurred")}finally{N(!1)}};return(0,t.jsx)(o.AuthShell,{children:(0,t.jsxs)(l.Card,{className:"w-full rounded-2xl border-0 shadow-xl shadow-indigo-500/5 ring-1 ring-border",children:[(0,t.jsx)(l.CardHeader,{children:(0,t.jsx)(l.CardTitle,{className:"text-2xl text-center",children:g.auth?.login?.title||"Login"})}),(0,t.jsx)(l.CardContent,{children:(0,t.jsxs)("form",{onSubmit:w,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"email",className:"text-sm font-medium",children:g.auth?.email||"Email"}),(0,t.jsx)(n.Input,{id:"email",name:"email",type:"email",value:x,onChange:e=>h(e.target.value),required:!0})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"password",className:"text-sm font-medium",children:g.auth?.password||"Password"}),(0,t.jsx)(n.Input,{id:"password",name:"password",type:"password",value:p,onChange:e=>f(e.target.value),required:!0})]}),v&&(0,t.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-center text-sm text-destructive",children:v}),(0,t.jsx)(i.Button,{type:"submit",size:"lg",className:"w-full",disabled:b,children:b?g.auth?.login?.loggingIn||"Logging in...":g.auth?.login?.action||"Login"}),(0,t.jsxs)("div",{className:"text-center text-sm text-muted-foreground",children:[g.auth?.login?.noAccount||"Don't have an account? ",(0,t.jsx)(d.default,{href:"/register",className:"text-primary hover:underline",children:g.auth?.login?.registerNow||"Register now"})]})]})})]})})}])},80342,e=>{"use strict";var t=e.i(18050),a=e.i(57688),s=e.i(11110);e.s(["AuthShell",0,function({children:e}){let{t:r}=(0,s.useLanguage)();return(0,t.jsxs)("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -left-32 -top-32 h-96 w-96 rounded-full bg-indigo-400/25 blur-3xl"}),(0,t.jsx)("div",{className:"pointer-events-none absolute -bottom-40 -right-24 h-[28rem] w-[28rem] rounded-full bg-violet-400/20 blur-3xl"}),(0,t.jsxs)("div",{className:"relative w-full max-w-md space-y-6 py-8",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,t.jsx)(a.default,{src:"/icons/icon.png",alt:"",width:64,height:64,className:"rounded-2xl shadow-lg shadow-indigo-500/30",priority:!0,unoptimized:!0}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-xl font-bold tracking-tight",children:r.pageTitle.base}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r.app.subtitle})]})]}),e]})]})}])},15288,e=>{"use strict";var t=e.i(18050),a=e.i(75157);e.s(["Card",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...s})},"CardContent",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",e),...s})},"CardDescription",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",e),...s})},"CardHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...s})},"CardTitle",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",e),...s})}])},35209,e=>{"use strict";var t=e.i(71645),a=e.i(11110);e.s(["usePageTitle",0,function(...e){let{t:s}=(0,a.useLanguage)(),r=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}]);
@@ -0,0 +1,33 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71689,e=>{"use strict";let t=(0,e.i(75254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],71689)},3281,e=>{"use strict";let t=(0,e.i(75254).default)("printer",[["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"}]]);e.s(["Printer",0,t],3281)},80685,e=>{"use strict";var t=e.i(18050),a=e.i(71645),n=e.i(18566),s=e.i(40160),r=e.i(3281),i=e.i(19455),l=e.i(57428),o=e.i(90546),c=e.i(11445),d=e.i(49704),m=e.i(11110),u=e.i(35209),x=e.i(41931);let p=`
2
+ .exam-sheet { max-width: 210mm; margin: 0 auto; padding: 16px; color: #111; background: #fff; 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: 120px; }
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; } @page { size: A4; margin: 15mm; } }
20
+ `;function h(e){return e.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}e.s(["default",0,function(){let e=(0,n.useParams)(),{t:f,language:g}=(0,m.useLanguage)(),[b,w]=(0,a.useState)(null);(0,u.usePageTitle)(f.exam.title,b?.title,f.pageTitle.examPrint);let[y,j]=(0,a.useState)(!0),k=(0,a.useRef)(null);if((0,a.useEffect)(()=>{x.apiClient.get(`/api/exams/${e.id}`).then(w).catch(()=>w(null))},[e.id]),!b)return(0,t.jsx)("div",{className:"p-8 text-center",children:f.common.loading});let v=b.questions.filter(e=>"ready"===e.status&&e.questionText);return(0,t.jsxs)("main",{className:"min-h-screen bg-white",children:[(0,t.jsx)("style",{children:p}),(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.BackButton,{fallbackUrl:`/exams/${b.id}`}),(0,t.jsx)("span",{className:"font-semibold",children:f.exam.printTitle}),(0,t.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(l.Checkbox,{checked:y,onCheckedChange:e=>j(!0===e)}),f.exam.includeAnswers]}),(0,t.jsxs)("div",{className:"flex gap-2 sm:ml-auto",children:[(0,t.jsxs)(i.Button,{variant:"outline",size:"sm",onClick:()=>{var e;if(!k.current)return;let t=function(e,t,a="zh-CN"){return`<!doctype html>
21
+ <html lang="${h(a)}">
22
+ <head>
23
+ <meta charset="utf-8">
24
+ <meta name="viewport" content="width=device-width, initial-scale=1">
25
+ <title>${h(e)}</title>
26
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.19.0/dist/katex.min.css">
27
+ <style>body { margin: 0; background: #fff; }${p}</style>
28
+ </head>
29
+ <body>
30
+ ${t}
31
+ </body>
32
+ </html>
33
+ `}(b.title,k.current.outerHTML,"en"===g?"en":"zh-CN"),a=URL.createObjectURL(new Blob([t],{type:"text/html;charset=utf-8"})),n=document.createElement("a");n.href=a,e=b.title,n.download=`${e.replace(/[\\/:*?"<>|\s]+/g,"_").slice(0,80)||"exam"}.html`,n.click(),URL.revokeObjectURL(a)},children:[(0,t.jsx)(s.Download,{className:"mr-2 h-4 w-4"}),f.exam.downloadHtml]}),(0,t.jsxs)(i.Button,{size:"sm",onClick:()=>window.print(),children:[(0,t.jsx)(r.Printer,{className:"mr-2 h-4 w-4"}),f.exam.printNow]})]}),v.length<b.questions.length&&(0,t.jsx)("p",{className:"w-full text-xs text-muted-foreground",children:f.exam.notReadyHint})]})}),(0,t.jsxs)("div",{ref:k,className:"exam-sheet",children:[(0,t.jsx)("h1",{children:b.title}),(0,t.jsxs)("div",{className:"exam-meta",children:[(0,t.jsxs)("span",{children:[f.exam.nameLine,":________"]}),(0,t.jsxs)("span",{children:[f.exam.dateLine,":________"]}),(0,t.jsxs)("span",{children:[f.exam.scoreLine,":________"]})]}),v.map((e,a)=>(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:[f.exam.sourceLabel,": ",e.sourceShortId]})]}),(0,t.jsx)(c.MarkdownRenderer,{content:e.questionText}),(0,t.jsx)(d.QuestionFigure,{svg:e.figureSvg}),(0,t.jsx)("div",{className:"exam-answer-space"})]},e.id)),y&&(0,t.jsxs)("section",{className:"exam-answer-key",children:[(0,t.jsx)("h2",{children:f.exam.answerKey}),v.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:[f.exam.sourceLabel,": ",e.sourceShortId]})]}),e.answerText&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[f.exam.answerLabel,":"]}),(0,t.jsx)(c.MarkdownRenderer,{content:e.answerText})]}),e.analysis&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"exam-label",children:[f.exam.analysisLabel,":"]}),(0,t.jsx)(c.MarkdownRenderer,{content:e.analysis})]})]},e.id))]})]})]})}],80685)},49704,e=>{"use strict";var t=e.i(18050),a=e.i(11110),n=e.i(75157);e.s(["QuestionFigure",0,function({svg:e,className:s}){let{t:r}=(0,a.useLanguage)();return e?(0,t.jsx)("figure",{className:(0,n.cn)("question-figure my-3",s),children:(0,t.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:r.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360}})}):null}],49704)},90546,e=>{"use strict";var t=e.i(18050),a=e.i(18566),n=e.i(19455),s=e.i(71689);e.s(["BackButton",0,function({fallbackUrl:e,className:r}){let i=(0,a.useRouter)();return(0,t.jsx)(n.Button,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:r,children:(0,t.jsx)(s.ArrowLeft,{className:"h-5 w-5"})})}])},57428,e=>{"use strict";var t=e.i(18050),a=e.i(71645),n=e.i(20783),s=e.i(30030),r=e.i(81140),i=e.i(69340),l=e.i(99682),o=e.i(35804),c=e.i(96626);e.i(74080);var d=Symbol("radix.slottable");function m(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===d}var u=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,s)=>{var r,i;let l,o,c,d=(i=r=`Primitive.${s}`,(l=a.forwardRef((e,t)=>{let{children:s,...r}=e;if(a.isValidElement(s)){var i;let e,l,o=(i=s,(l=(e=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.ref:(l=(e=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.props.ref:i.props.ref||i.ref),c=function(e,t){let a={...t};for(let n in t){let s=e[n],r=t[n];/^on[A-Z]/.test(n)?s&&r?a[n]=(...e)=>{let t=r(...e);return s(...e),t}:s&&(a[n]=s):"style"===n?a[n]={...s,...r}:"className"===n&&(a[n]=[s,r].filter(Boolean).join(" "))}return{...e,...a}}(r,s.props);return s.type!==a.Fragment&&(c.ref=t?(0,n.composeRefs)(t,o):o),a.cloneElement(s,c)}return a.Children.count(s)>1?a.Children.only(null):null})).displayName=`${i}.SlotClone`,o=l,(c=a.forwardRef((e,n)=>{let{children:s,...r}=e,i=a.Children.toArray(s),l=i.find(m);if(l){let e=l.props.children,s=i.map(t=>t!==l?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,t.jsx)(o,{...r,ref:n,children:a.isValidElement(e)?a.cloneElement(e,void 0,s):null})}return(0,t.jsx)(o,{...r,ref:n,children:s})})).displayName=`${r}.Slot`,c),u=a.forwardRef((e,a)=>{let{asChild:n,...r}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(n?d:s,{...r,ref:a})});return u.displayName=`Primitive.${s}`,{...e,[s]:u}},{}),x="Checkbox",[p,h]=(0,s.createContextScope)(x),[f,g]=p(x);function b(e){let{__scopeCheckbox:n,checked:s,children:r,defaultChecked:l,disabled:o,form:c,name:d,onCheckedChange:m,required:u,value:p="on",internal_do_not_use_render:h}=e,[g,b]=(0,i.useControllableState)({prop:s,defaultProp:l??!1,onChange:m,caller:x}),[w,y]=a.useState(null),[j,k]=a.useState(null),v=a.useRef(!1),N=!w||!!c||!!w.closest("form"),C={checked:g,disabled:o,setChecked:b,control:w,setControl:y,name:d,form:c,value:p,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:!_(l)&&l,isFormControl:N,bubbleInput:j,setBubbleInput:k};return(0,t.jsx)(f,{scope:n,...C,children:"function"==typeof h?h(C):r})}var w="CheckboxTrigger",y=a.forwardRef(({__scopeCheckbox:e,onKeyDown:s,onClick:i,...l},o)=>{let{control:c,value:d,disabled:m,checked:x,required:p,setControl:h,setChecked:f,hasConsumerStoppedPropagationRef:b,isFormControl:y,bubbleInput:j}=g(w,e),k=(0,n.useComposedRefs)(o,h),v=a.useRef(x);return a.useEffect(()=>{let e=c?.form;if(e){let t=()=>f(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[c,f]),(0,t.jsx)(u.button,{type:"button",role:"checkbox","aria-checked":_(x)?"mixed":x,"aria-required":p,"data-state":R(x),"data-disabled":m?"":void 0,disabled:m,value:d,...l,ref:k,onKeyDown:(0,r.composeEventHandlers)(s,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,r.composeEventHandlers)(i,e=>{f(e=>!!_(e)||!e),j&&y&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})})});y.displayName=w;var j=a.forwardRef((e,a)=>{let{__scopeCheckbox:n,name:s,checked:r,defaultChecked:i,required:l,disabled:o,value:c,onCheckedChange:d,form:m,...u}=e;return(0,t.jsx)(b,{__scopeCheckbox:n,checked:r,defaultChecked:i,disabled:o,required:l,onCheckedChange:d,name:s,form:m,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y,{...u,ref:a,__scopeCheckbox:n}),e&&(0,t.jsx)(C,{__scopeCheckbox:n})]})})});j.displayName=x;var k="CheckboxIndicator",v=a.forwardRef((e,a)=>{let{__scopeCheckbox:n,forceMount:s,...r}=e,i=g(k,n);return(0,t.jsx)(c.Presence,{present:s||_(i.checked)||!0===i.checked,children:(0,t.jsx)(u.span,{"data-state":R(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{pointerEvents:"none",...e.style}})})});v.displayName=k;var N="CheckboxBubbleInput",C=a.forwardRef(({__scopeCheckbox:e,...s},r)=>{let{control:i,hasConsumerStoppedPropagationRef:c,checked:d,defaultChecked:m,required:x,disabled:p,name:h,value:f,form:b,bubbleInput:w,setBubbleInput:y}=g(N,e),j=(0,n.useComposedRefs)(r,y),k=(0,l.usePrevious)(d),v=(0,o.useSize)(i);a.useEffect(()=>{if(!w)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!c.current;if(k!==d&&e){let a=new Event("click",{bubbles:t});w.indeterminate=_(d),e.call(w,!_(d)&&d),w.dispatchEvent(a)}},[w,k,d,c]);let C=a.useRef(!_(d)&&d);return(0,t.jsx)(u.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??C.current,required:x,disabled:p,name:h,value:f,form:b,...s,tabIndex:-1,ref:j,style:{...s.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function _(e){return"indeterminate"===e}function R(e){return _(e)?"indeterminate":e?"checked":"unchecked"}C.displayName=N;var E=e.i(43531),L=e.i(75157);let P=a.forwardRef(({className:e,...a},n)=>(0,t.jsx)(j,{ref:n,className:(0,L.cn)("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)(v,{className:(0,L.cn)("flex items-center justify-center text-current"),children:(0,t.jsx)(E.Check,{className:"h-4 w-4"})})}));P.displayName=j.displayName,e.s(["Checkbox",0,P],57428)},35209,e=>{"use strict";var t=e.i(71645),a=e.i(11110);e.s(["usePageTitle",0,function(...e){let{t:n}=(0,a.useLanguage)(),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])}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,72664,41176,38465,3198,e=>{"use strict";var t=e.i(75254);let r=(0,t.default)("box",[["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"}]]);e.s(["Box",0,r],72664);var a=e.i(18050),i=e.i(71645);let n=(0,t.default)("code-xml",[["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"}]]);var s=e.i(86536),o=e.i(11445),l=e.i(24687),d=e.i(11110),h=e.i(75157);e.s(["MarkdownEditor",0,function({value:e,onChange:t,className:r,...c}){let{t:u}=(0,d.useLanguage)(),[m,g]=(0,i.useState)("source"),p=(0,i.useId)(),w=[{mode:"source",label:u.markdownEditor.source,icon:n},{mode:"preview",label:u.markdownEditor.preview,icon:s.Eye}];return(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,a.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:w.map(({mode:e,label:t,icon:r})=>(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,h.cn)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,a.jsx)(r,{className:"h-3.5 w-3.5"}),t]},e))})}),(0,a.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,a.jsx)(l.Textarea,{value:e,onChange:e=>t(e.target.value),className:r,...c}):(0,a.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,a.jsx)(o.MarkdownRenderer,{content:e}):(0,a.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],41176);var c=e.i(67489),u=e.i(10980),m=e.i(41931);e.s(["NotebookSelector",0,function({value:e,onChange:t,className:r}){let[n,s]=(0,i.useState)([]),[o,l]=(0,i.useState)(!0),{t:h}=(0,d.useLanguage)();return(0,i.useEffect)(()=>{(async()=>{try{let e=await m.apiClient.get("/api/notebooks");s(e)}catch(e){console.error("Failed to fetch notebooks:",e)}finally{l(!1)}})()},[]),(0,a.jsxs)(c.Select,{value:e,onValueChange:t,children:[(0,a.jsx)(c.SelectTrigger,{className:r,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(u.BookOpen,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)(c.SelectValue,{placeholder:h.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,a.jsx)(c.SelectContent,{children:0===n.length?(0,a.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:h.notebooks?.selector?.empty||"No notebooks available"}):n.map(e=>(0,a.jsx)(c.SelectItem,{value:e.id,children:e.name},e.id))})]})}],38465);var g=e.i(31278);let p=(0,t.default)("maximize-2",[["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"}]]),w=(0,t.default)("minimize-2",[["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"}]]);var x=e.i(67240),f=e.i(16715),y=e.i(27612),b=e.i(19455),v=e.i(94114);let C=null,j=["setcoordsystem","setaxesvisible","setgridvisible","setcolor","setlinethickness","setlinestyle","setpointsize","setpointstyle","setlabelvisible","setcaption","setvisible","setfilling","setvalue","setfixed","setbackgroundcolor"];function k(e,t){for(let r of t)try{if(function(e){let t=e.toLowerCase().trim();return j.some(e=>t.startsWith(e+"("))}(r)){let t=function(e){let t=e.match(/^(\w+)\(([\s\S]+)\)$/);if(!t)return null;try{let e=t[2].trim();if(e.startsWith("[")&&e.endsWith("]"))return{m:t[1],a:JSON.parse(e)};if(/^-?\d+(\.\d+)?$/.test(e))return{m:t[1],a:[Number(e)]};if("true"===e||"false"===e)return{m:t[1],a:["true"===e]};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{m:t[1],a:[e.slice(1,-1)]};let r=e.split(",").map(e=>e.trim()).map(e=>/^-?\d+(\.\d+)?$/.test(e)?Number(e):"true"===e||"false"===e?"true"===e:e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e);return{m:t[1],a:r}}catch{return null}}(r);t&&"function"==typeof e[t.m]&&e[t.m](...t.a)}else{let t=r.trim();t&&!/[<>'"]/.test(t)?e.evalCommand(t):console.warn(`[GGB] Blocked potentially unsafe command: ${r.substring(0,50)}`)}}catch(e){console.warn(`[GGB] Failed: ${r}`,e)}}e.s(["GeogebraDemo",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:n=!1,showMenuBar:s=!1,className:o="",onRegenerate:l,onDelete:h}){let{t:c}=(0,d.useLanguage)(),u=(0,i.useRef)(null),m=(0,i.useRef)(null),j=(0,i.useRef)(`ggb-${Math.random().toString(36).slice(2,9)}`),[D,N]=(0,i.useState)(!0),[M,R]=(0,i.useState)(null),[S,E]=(0,i.useState)(!0),[$,B]=(0,i.useState)(!1),[_,L]=(0,i.useState)(!1),P=(0,i.useMemo)(()=>(function(e){if(!e?.trim())return[];let t=e.trim();if(t.startsWith("["))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&""!==e.trim())}catch{}return t.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//"))})(e),[e]);(0,i.useEffect)(()=>{if(0===P.length)return;let e=!1,a=j.current;return(C||(C=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=()=>{C=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let i=window.GGBApplet;if(!i){R("GeoGebra 未正确加载"),N(!1);return}let o=u.current;if(o){o.innerHTML=`<div id="${a}" style="width:100%;height:${t}px"></div>`;try{new i({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:n,showMenuBar:s,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{if(e)return;m.current=r;let a=u.current?.firstElementChild;if(a){a.style.width="100%";let e=u.current?.offsetWidth||a.offsetWidth||800;r.setSize(e,t)}k(r,P),N(!1)}},!0).inject(a)}catch(t){console.error("[GGB] Init failed:",t),e||(R("GeoGebra 初始化失败"),N(!1))}}}).catch(t=>{console.error("[GGB] Script load failed:",t),e||(R("无法加载 GeoGebra 组件"),N(!1))}),()=>{e=!0;try{let e=m.current;e&&"function"==typeof e.remove&&e.remove()}catch(e){console.warn("[GGB] Cleanup failed:",e)}m.current=null,u.current&&(u.current.innerHTML="")}},[P,r,n,s]),(0,i.useEffect)(()=>{let e=u.current?.firstElementChild;if(!e)return;let r=S?700:t;e.style.width="100%",e.style.height=`${r}px`;let a=m.current;if(a?.setSize){let t=u.current?.offsetWidth||e.offsetWidth||800;a.setSize(t,r)}},[S,t]);let I=(0,i.useCallback)(()=>{let e=m.current;if(e)try{e.resetConstruction(),setTimeout(()=>{m.current&&k(m.current,P)},300)}catch(e){console.warn("[GGB] Reset failed",e)}},[P]),H=(0,i.useCallback)(async()=>{if(l&&!$){B(!0);try{await l()}finally{B(!1)}}},[l,$]),A=(0,i.useCallback)(async()=>{if(h&&!_&&await (0,v.confirmDialog)(c.geogebra.confirmDelete,{destructive:!0})){L(!0);try{await h()}catch{v.toast.error(c.geogebra.deleteFailed)}finally{L(!1)}}},[h,_,c]);return 0===P.length?null:(0,a.jsxs)("div",{className:`relative rounded-lg border bg-card ${o}`,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:"GeoGebra 动态演示"}),D&&(0,a.jsx)(g.Loader2,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[l&&(0,a.jsxs)(b.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:H,title:"重新生成",disabled:$||D,children:[$?(0,a.jsx)(g.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(f.RefreshCw,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:"重新生成"})]}),h&&(0,a.jsxs)(b.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:A,title:c.geogebra.delete,disabled:_||$,children:[_?(0,a.jsx)(g.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(y.Trash2,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:c.geogebra.delete})]}),(0,a.jsx)(b.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:I,title:"重置",disabled:D,children:(0,a.jsx)(x.RotateCcw,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(b.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>E(e=>!e),title:S?"缩小":"放大",children:S?(0,a.jsx)(w,{className:"h-3.5 w-3.5"}):(0,a.jsx)(p,{className:"h-3.5 w-3.5"})})]})]}),(0,a.jsx)("div",{ref:u,style:{width:"100%"}}),D&&(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)(g.Loader2,{className:"h-6 w-6 animate-spin text-primary"}),(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:"加载 GeoGebra..."})]})}),M&&(0,a.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:M})]})}],3198)},56909,e=>{"use strict";let t=(0,e.i(75254).default)("save",[["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"}]]);e.s(["Save",0,t],56909)},83086,e=>{"use strict";let t=(0,e.i(75254).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],83086)},69937,e=>{"use strict";var t=e.i(18050);let r=(0,e.i(75254).default)("star",[["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"}]]);var a=e.i(11110),i=e.i(75157);let n=[1,2,3,4,5];e.s(["DifficultyStars",0,function({value:e,onChange:s,disabled:o,size:l="sm",showUnrated:d=!0,className:h}){let{t:c}=(0,a.useLanguage)(),u=e??0,m="sm"===l?"h-3.5 w-3.5":"h-5 w-5",g=u?c.difficulty.starsLabel.replace("{n}",String(u)):c.difficulty.unrated;return s?(0,t.jsxs)("span",{className:(0,i.cn)("inline-flex items-center gap-0.5",h),role:"group","aria-label":`${c.difficulty.label}:${g}`,title:c.difficulty.clearHint,children:[n.map(e=>(0,t.jsx)("button",{type:"button",disabled:o,onClick:()=>s(e===u?null:e),"aria-label":c.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,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,{className:(0,i.cn)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:c.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,i.cn)("inline-flex items-center",h),role:"img","aria-label":`${c.difficulty.label}:${g}`,title:g,children:n.map(e=>(0,t.jsx)(r,{className:(0,i.cn)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,i.cn)("text-xs text-muted-foreground",h),children:c.difficulty.unrated}):null}],69937)},12130,28928,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=r,i=Object.defineProperty,n=(e,t,r)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?i(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r};let s={x:0,y:0,width:0,height:0,unit:"px"},o=(e,t,r)=>Math.min(Math.max(e,t),r),l=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function d(e,t,r){return"%"===e.unit?{...s,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function h(e,t,r){return e.unit?"px"===e.unit?{...s,...e,unit:"px"}:{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...s,...e,unit:"px"}}function c(e,t,r,a,i,n=0,s=0,o=a,l=i){let d={...e},h=Math.min(n,a),u=Math.min(s,i),m=Math.min(o,a),g=Math.min(l,i);t&&(t>1?(u=(h=s?s*t:h)/t,m=o*t):(h=(u=n?n/t:u)*t,g=l/t)),d.y<0&&(d.height=Math.max(d.height+d.y,u),d.y=0),d.x<0&&(d.width=Math.max(d.width+d.x,h),d.x=0);let p=a-(d.x+d.width);p<0&&(d.x=Math.min(d.x,a-h),d.width+=p);let w=i-(d.y+d.height);if(w<0&&(d.y=Math.min(d.y,i-u),d.height+=w),d.width<h&&(("sw"===r||"nw"==r)&&(d.x-=h-d.width),d.width=h),d.height<u&&(("nw"===r||"ne"==r)&&(d.y-=u-d.height),d.height=u),d.width>m&&(("sw"===r||"nw"==r)&&(d.x-=m-d.width),d.width=m),d.height>g&&(("nw"===r||"ne"==r)&&(d.y-=g-d.height),d.height=g),t){let e=d.width/d.height;if(e<t){let e=Math.max(d.width/t,u);("nw"===r||"ne"==r)&&(d.y-=e-d.height),d.height=e}else if(e>t){let e=Math.max(d.height*t,h);("sw"===r||"nw"==r)&&(d.x-=e-d.width),d.width=e}}return d}let u={capture:!0,passive:!1},m=0,g=class e extends a.PureComponent{constructor(){super(...arguments),n(this,"docMoveBound",!1),n(this,"mouseDownOnCrop",!1),n(this,"dragStarted",!1),n(this,"evData",{startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0}),n(this,"componentRef",(0,a.createRef)()),n(this,"mediaRef",(0,a.createRef)()),n(this,"resizeObserver"),n(this,"initChangeCalled",!1),n(this,"instanceId",`rc-${m++}`),n(this,"state",{cropIsActive:!1,newCropIsBeingDrawn:!1}),n(this,"onCropPointerDown",e=>{let{crop:t,disabled:r}=this.props,a=this.getBox();if(!t)return;let i=h(t,a.width,a.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let n=e.target.dataset.ord,s=e.clientX,o=e.clientY,l=i.x,d=i.y;if(n){let t=e.clientX-a.x,r=e.clientY-a.y,h=0,c=0;"ne"===n||"e"==n?(h=t-(i.x+i.width),c=r-i.y,l=i.x,d=i.y+i.height):"se"===n||"s"===n?(h=t-(i.x+i.width),c=r-(i.y+i.height),l=i.x,d=i.y):"sw"===n||"w"==n?(h=t-i.x,c=r-(i.y+i.height),l=i.x+i.width,d=i.y):("nw"===n||"n"==n)&&(h=t-i.x,c=r-i.y,l=i.x+i.width,d=i.y+i.height),s=l+a.x+h,o=d+a.y+c}this.evData={startClientX:s,startClientY:o,startCropX:l,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:!!n,ord:n},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})}),n(this,"onComponentPointerDown",e=>{let{crop:t,disabled:r,locked:a,keepSelection:i,onChange:n}=this.props,s=this.getBox();if(r||a||i&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let o=e.clientX-s.x,l=e.clientY-s.y,c={unit:"px",x:o,y:l,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:o,startCropY:l,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,n(h(c,s.width,s.height),d(c,s.width,s.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})}),n(this,"onDocPointerMove",e=>{let t,{crop:r,disabled:a,onChange:i,onDragStart:n}=this.props,s=this.getBox();if(a||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,n&&n(e));let{evData:o}=this;o.clientX=e.clientX,o.clientY=e.clientY,l(r,t=o.isResize?this.resizeCrop():this.dragCrop())||i(h(t,s.width,s.height),d(t,s.width,s.height))}),n(this,"onComponentKeyDown",t=>{let{crop:r,disabled:a,onChange:i,onComplete:n}=this.props;if(a)return;let s=t.key,l=!1;if(!r)return;let c=this.getBox(),u=this.makePixelCrop(c),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===s?(u.x-=m,l=!0):"ArrowRight"===s?(u.x+=m,l=!0):"ArrowUp"===s?(u.y-=m,l=!0):"ArrowDown"===s&&(u.y+=m,l=!0),l){t.cancelable&&t.preventDefault(),u.x=o(u.x,0,c.width-u.width),u.y=o(u.y,0,c.height-u.height);let e=h(u,c.width,c.height),r=d(u,c.width,c.height);i(e,r),n&&n(e,r)}}),n(this,"onHandlerKeyDown",(t,r)=>{var a,i;let n,{aspect:s=0,crop:o,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:w,onChange:x,onComplete:f}=this.props,y=this.getBox();if(u||!o||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=c((a=h(o,y.width,y.height),i=t.key,n={...a},"ArrowLeft"===i?"nw"===r?(n.x-=b,n.y-=b,n.width+=b,n.height+=b):"w"===r?(n.x-=b,n.width+=b):"sw"===r?(n.x-=b,n.width+=b,n.height+=b):"ne"===r?(n.y+=b,n.width-=b,n.height-=b):"e"===r?n.width-=b:"se"===r&&(n.width-=b,n.height-=b):"ArrowRight"===i&&("nw"===r?(n.x+=b,n.y+=b,n.width-=b,n.height-=b):"w"===r?(n.x+=b,n.width-=b):"sw"===r?(n.x+=b,n.width-=b,n.height-=b):"ne"===r?(n.y-=b,n.width+=b,n.height+=b):"e"===r?n.width+=b:"se"===r&&(n.width+=b,n.height+=b)),"ArrowUp"===i?"nw"===r?(n.x-=b,n.y-=b,n.width+=b,n.height+=b):"n"===r?(n.y-=b,n.height+=b):"ne"===r?(n.y-=b,n.width+=b,n.height+=b):"sw"===r?(n.x+=b,n.width-=b,n.height-=b):"s"===r?n.height-=b:"se"===r&&(n.width-=b,n.height-=b):"ArrowDown"===i&&("nw"===r?(n.x+=b,n.y+=b,n.width-=b,n.height-=b):"n"===r?(n.y+=b,n.height-=b):"ne"===r?(n.y+=b,n.width-=b,n.height-=b):"sw"===r?(n.x-=b,n.width+=b,n.height+=b):"s"===r?n.height+=b:"se"===r&&(n.width+=b,n.height+=b)),n),s,r,y.width,y.height,m,g,p,w);if(!l(o,v)){let e=d(v,y.width,y.height);x(v,e),f&&f(v,e)}}),n(this,"onDocPointerDone",e=>{let{crop:t,disabled:r,onComplete:a,onDragEnd:i}=this.props,n=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),a&&a(h(t,n.width,n.height),d(t,n.width,n.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))}),n(this,"onDragFocus",()=>{var e;null==(e=this.componentRef.current)||e.scrollTo(0,0)})}get document(){return document}getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:r,width:a,height:i}=e.getBoundingClientRect();return{x:t,y:r,width:a,height:i}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:a}=this.getBox();e&&a&&r(h(t,e,a),d(t,e,a))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,u),this.document.addEventListener("pointerup",this.onDocPointerDone,u),this.document.addEventListener("pointercancel",this.onDocPointerDone,u),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,u),this.document.removeEventListener("pointerup",this.onDocPointerDone,u),this.document.removeEventListener("pointercancel",this.onDocPointerDone,u),this.docMoveBound=!1)}getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),a=e.clientX-e.startClientX,i=e.clientY-e.startClientY;return r.x=o(e.startCropX+a,0,t.width-r.width),r.y=o(e.startCropY+i,0,t.height-r.height),r}getPointRegion(e,t,r,a){let i,{evData:n}=this,s=n.clientX-e.x,o=n.clientY-e.y;return i=a&&t?"nw"===t||"n"===t||"ne"===t:o<n.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:s<n.startCropX)?i?"nw":"sw":i?"ne":"se"}resolveMinDimensions(e,t,r=0,a=0){let i=Math.min(r,e.width),n=Math.min(a,e.height);return t&&(i||n)?t>1?i?[i,i/t]:[n*t,n]:n?[n*t,n]:[i,i/t]:[i,n]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:a,maxHeight:i}=this.props,n=this.getBox(),[s,l]=this.resolveMinDimensions(n,r,this.props.minWidth,this.props.minHeight),d=this.makePixelCrop(n),h=this.getPointRegion(n,t.ord,s,l),u=t.ord||h,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(s&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-s)),(l&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-l));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===h?(p.x=t.startCropX,p.width=m,r?p.height=p.width/r:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===h?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,r?p.height=p.width/r:p.height=g):"sw"===h?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),r?p.height=p.width/r:p.height=g):"nw"===h&&(p.x=t.startCropX+m,p.width=Math.abs(m),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let w=c(p,r,h,n.width,n.height,s,l,a,i);return r||e.xyOrds.indexOf(u)>-1?d=w:e.xOrds.indexOf(u)>-1?(d.x=w.x,d.width=w.width):e.yOrds.indexOf(u)>-1&&(d.y=w.y,d.height=w.height),d.x=o(d.x,0,n.width-d.width),d.y=o(d.y,0,n.height-d.height),d}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:i,renderSelectionAddon:n,ruleOfThirds:s,crop:o}=this.props,l=this.getCropStyle();if(o)return a.default.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!i&&a.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},a.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),a.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),a.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),a.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),a.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),a.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),a.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),a.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),a.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),a.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),a.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),a.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),n&&a.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},n(this.state)),s&&a.default.createElement(a.default.Fragment,null,a.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),a.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return h({...s,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:i,crop:n,disabled:s,locked:o,style:l,ruleOfThirds:d}=this.props,{cropIsActive:h,newCropIsBeingDrawn:c}=this.state,u=n?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",i,h&&"ReactCrop--active",s&&"ReactCrop--disabled",o&&"ReactCrop--locked",c&&"ReactCrop--new-crop",n&&e&&"ReactCrop--fixed-aspect",n&&r&&"ReactCrop--circular-crop",n&&d&&"ReactCrop--rule-of-thirds",!this.dragStarted&&n&&!n.width&&!n.height&&"ReactCrop--invisible-crop",r&&"ReactCrop--no-animate");return a.default.createElement("div",{ref:this.componentRef,className:m,style:l},a.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),n?a.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},a.default.createElement("defs",null,a.default.createElement("mask",{id:`hole-${this.instanceId}`},a.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),r?a.default.createElement("ellipse",{cx:`${n.x+n.width/2}${n.unit}`,cy:`${n.y+n.height/2}${n.unit}`,rx:`${n.width/2}${n.unit}`,ry:`${n.height/2}${n.unit}`,fill:"black"}):a.default.createElement("rect",{x:`${n.x}${n.unit}`,y:`${n.y}${n.unit}`,width:`${n.width}${n.unit}`,height:`${n.height}${n.unit}`,fill:"black"}))),a.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};n(g,"xOrds",["e","w"]),n(g,"yOrds",["n","s"]),n(g,"xyOrds",["nw","ne","se","sw"]),n(g,"nudgeStep",1),n(g,"nudgeStepMedium",10),n(g,"nudgeStepLarge",100),n(g,"defaultProps",{ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}});var p=e.i(19455),w=e.i(76639),x=e.i(37727),f=e.i(11110);async function y(e,t){let{naturalWidth:r,naturalHeight:a}=e;return Promise.all(t.map(t=>new Promise((i,n)=>{let s=document.createElement("canvas"),o=Math.round(t.x*r),l=Math.round(t.y*a);s.width=Math.max(1,Math.round(t.width*r)),s.height=Math.max(1,Math.round(t.height*a));let d=s.getContext("2d");d?(d.drawImage(e,o,l,s.width,s.height,0,0,s.width,s.height),s.toBlob(e=>e?i(e):n(Error("Canvas is empty")),"image/jpeg",.95)):n(Error("Canvas is not supported"))})))}let b=(0,r.forwardRef)(function({imageSrc:e,regions:a,onChange:i},n){let{t:s}=(0,f.useLanguage)(),o=(0,r.useRef)(null),l=(0,r.useRef)(null),[d,h]=(0,r.useState)(null),c=e=>{let t=o.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},u=()=>{d&&d.width>=.02&&d.height>=.02&&i([...a,d]),l.current=null,h(null)},m=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:n,src:e,alt:"",draggable:!1,style:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},className:"block"}),(0,t.jsxs)("div",{ref:o,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(o.current?.setPointerCapture(e.pointerId),l.current=c(e),h(null))},onPointerMove:e=>{var t,r,a,i;let n,s,o;if(!l.current)return;let d=c(e);h((t=l.current.x,r=l.current.y,a=d.x,i=d.y,s=(n=e=>Math.min(1,Math.max(0,e)))(Math.min(t,a)),o=n(Math.min(r,i)),{x:s,y:o,width:n(Math.max(t,a))-s,height:n(Math.max(r,i))-o}))},onPointerUp:u,onPointerCancel:u,children:[a.map((e,r)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:m(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:r+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":s.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>i(a.filter((e,t)=>t!==r)),children:(0,t.jsx)(x.X,{className:"h-3 w-3"})})]},r)),d&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:m(d)})]})]})});async function v(e,t=1,r=1920,a=.8){return new Promise((i,n)=>{let s=new FileReader;s.onload=s=>{let o=new Image;o.onload=()=>{let s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return void n(Error("无法获取 Canvas 上下文"));let d=o.width,h=o.height;d>r&&(h=h*r/d,d=r),s.width=d,s.height=h,l.drawImage(o,0,0,d,h);let c=a,u=s.toDataURL("image/jpeg",c),m=3*u.length/4/1024/1024;for(;m>t&&c>.1;){c-=.1;let e=3*(u=s.toDataURL("image/jpeg",c)).length/4/1024/1024;if(console.log(`压缩质量: ${c.toFixed(1)}, 大小: ${e.toFixed(2)}MB`),e<=t)break}console.log(`原始文件: ${(e.size/1024/1024).toFixed(2)}MB, 压缩后: ${(3*u.length/4/1024/1024).toFixed(2)}MB`),i(u)},o.onerror=()=>n(Error("图片加载失败")),o.src=s.target?.result},s.onerror=()=>n(Error("文件读取失败")),s.readAsDataURL(e)})}async function C(e){let t=e.size/1024/1024;return(console.log(`文件大小: ${t.toFixed(2)}MB`),t>1)?(console.log("文件超过阈值,开始压缩..."),await v(e,1)):(console.log("文件大小合适,无需压缩"),new Promise((t,r)=>{let a=new FileReader;a.onload=()=>t(a.result),a.onerror=r,a.readAsDataURL(e)}))}e.s(["ImageCropper",0,function({imageSrc:e,open:a,onClose:i,onCropComplete:n,onMultiCropComplete:s}){let{t:o}=(0,f.useLanguage)(),[l,d]=(0,r.useState)(),[h,c]=(0,r.useState)(),u=(0,r.useRef)(null),[m,x]=(0,r.useState)("single"),[v,C]=(0,r.useState)({src:e,regions:[]}),j=v.src===e?v.regions:[],k=t=>C({src:e,regions:t}),D=(0,r.useRef)(null),N=async()=>{if(D.current&&0!==j.length&&s)try{s(await y(D.current,j)),k([])}catch(e){console.error(e)}},M=async(e,t)=>{let r=document.createElement("canvas"),a=e.naturalWidth/e.width,i=e.naturalHeight/e.height;r.width=t.width*a,r.height=t.height*i;let n=r.getContext("2d");return n?(n.drawImage(e,t.x*a,t.y*i,t.width*a,t.height*i,0,0,t.width*a,t.height*i),new Promise((e,t)=>{r.toBlob(r=>{r?e(r):t(Error("Canvas is empty"))},"image/jpeg")})):null},R=async()=>{if(h&&u.current)try{let e=await M(u.current,h);e&&n(e)}catch(e){console.error(e)}else if(!h&&e)try{let t=await fetch(e),r=await t.blob();n(r)}catch(e){console.error(e)}};return(0,t.jsx)(w.Dialog,{open:a,onOpenChange:e=>!e&&i(),children:(0,t.jsxs)(w.DialogContent,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(w.DialogHeader,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(w.DialogTitle,{children:o.common.cropper?.title||"Crop Image"})}),(0,t.jsx)("div",{className:"flex-1 bg-black w-full overflow-auto flex items-center justify-center p-4",children:"multi"===m?(0,t.jsx)(b,{ref:D,imageSrc:e,regions:j,onChange:k}):(0,t.jsx)(g,{crop:l,onChange:(e,t)=>d(t),onComplete:e=>c(e),className:"max-h-full",children:(0,t.jsx)("img",{ref:u,alt:"Crop me",src:e,onLoad:function(e){let{width:t,height:r}=e.currentTarget;d({unit:"%",x:0,y:0,width:100,height:100}),c({unit:"px",x:0,y:0,width:t,height:r})},style:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"}})})}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[s&&(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:w-80",children:["single","multi"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>x(e),className:`rounded px-3 py-1.5 text-sm font-medium transition-colors ${m===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:"single"===e?o.batchImport.singleMode:o.batchImport.multiMode},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===m?`${o.batchImport.hint} ${o.batchImport.regionCount.replace("{count}",String(j.length))}`:o.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===m&&j.length>0&&(0,t.jsx)(p.Button,{variant:"ghost",onClick:()=>k([]),children:o.batchImport.clear}),(0,t.jsx)(p.Button,{variant:"outline",onClick:i,children:o.common.cancel||"Cancel"}),"multi"===m?(0,t.jsx)(p.Button,{onClick:N,disabled:0===j.length,children:o.batchImport.start.replace("{count}",String(j.length))}):(0,t.jsx)(p.Button,{onClick:R,children:o.common.confirm||"Confirm"})]})]})]})]})})}],12130),e.s(["processImageFile",0,C],28928)},49704,e=>{"use strict";var t=e.i(18050),r=e.i(11110),a=e.i(75157);e.s(["QuestionFigure",0,function({svg:e,className:i}){let{t:n}=(0,r.useLanguage)();return e?(0,t.jsx)("figure",{className:(0,a.cn)("question-figure my-3",i),children:(0,t.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:n.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360}})}):null}],49704)},88218,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(37727),i=e.i(87486),n=e.i(93479),s=e.i(41931);e.s(["TagInput",0,function({value:e=[],onChange:o,placeholder:l="Enter tags...",className:d="",enterHint:h,subject:c,gradeStage:u}){let[m,g]=(0,r.useState)(""),[p,w]=(0,r.useState)([]),[x,f]=(0,r.useState)(!1),[y,b]=(0,r.useState)(0),v=(0,r.useRef)(null),C=(0,r.useRef)(null);(0,r.useEffect)(()=>{m.trim()?j(m):(w([]),f(!1))},[m,c,u]);let j=async t=>{try{let r=new URLSearchParams({q:t});c&&r.append("subject",c),u&&r.append("stage",u);let a=((await s.apiClient.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(a.slice(0,20)),f(a.length>0),b(0)}catch(e){console.error("Failed to fetch suggestions:",e)}},k=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),w([]),f(!1),b(0))},D=t=>{o(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!C.current||C.current.contains(e.target)||v.current?.contains(e.target)||f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${d}`,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)(i.Badge,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>D(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(a.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.Input,{ref:v,type:"text",value:m,onChange:e=>g(e.target.value),onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),y>=0&&p[y]?k(p[y]):m.trim()&&k(m)):"ArrowDown"===t.key?(t.preventDefault(),b(e=>Math.min(e+1,p.length-1))):"ArrowUp"===t.key?(t.preventDefault(),b(e=>Math.max(e-1,0))):"Escape"===t.key?(f(!1),b(0)):"Backspace"===t.key&&!m&&e.length>0&&D(e[e.length-1])},onFocus:()=>{p.length>0&&f(!0)},placeholder:0===e.length?l:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&p.length>0&&(0,t.jsx)("div",{ref:C,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===y?"bg-accent":""}`,onClick:()=>k(e),onMouseEnter:()=>b(r),children:e},e))}),m&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:h?`${h} "${m}"`:`Press Enter to create "${m}"`})]})}])},15288,e=>{"use strict";var t=e.i(18050),r=e.i(75157);e.s(["Card",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,r.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",e),...a})}])},52122,e=>{"use strict";e.i(30691),e.s(["inferSubjectFromName",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=>{"use strict";function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["getMistakeStatusLabel",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)]},"normalizeMistakeStatusForSave",0,function(e,r){return(r||"").trim()?"wrong_attempt":t(e)}])},35209,e=>{"use strict";var t=e.i(71645),r=e.i(11110);e.s(["usePageTitle",0,function(...e){let{t:a}=(0,r.useLanguage)(),i=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])},43710,e=>{"use strict";e.s(["getDefaultPaperLevel",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<1||e>5?null:e<=3?"a":"b"}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,72664,41176,38465,3198,e=>{"use strict";var t=e.i(75254);let r=(0,t.default)("box",[["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"}]]);e.s(["Box",0,r],72664);var i=e.i(18050),n=e.i(71645);let a=(0,t.default)("code-xml",[["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"}]]);var s=e.i(86536),o=e.i(11445),l=e.i(24687),h=e.i(11110),d=e.i(75157);e.s(["MarkdownEditor",0,function({value:e,onChange:t,className:r,...c}){let{t:u}=(0,h.useLanguage)(),[m,g]=(0,n.useState)("source"),p=(0,n.useId)(),w=[{mode:"source",label:u.markdownEditor.source,icon:a},{mode:"preview",label:u.markdownEditor.preview,icon:s.Eye}];return(0,i.jsxs)("div",{className:"space-y-1.5",children:[(0,i.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,i.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:w.map(({mode:e,label:t,icon:r})=>(0,i.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,d.cn)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,i.jsx)(r,{className:"h-3.5 w-3.5"}),t]},e))})}),(0,i.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,i.jsx)(l.Textarea,{value:e,onChange:e=>t(e.target.value),className:r,...c}):(0,i.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,i.jsx)(o.MarkdownRenderer,{content:e}):(0,i.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],41176);var c=e.i(67489),u=e.i(10980),m=e.i(41931);e.s(["NotebookSelector",0,function({value:e,onChange:t,className:r}){let[a,s]=(0,n.useState)([]),[o,l]=(0,n.useState)(!0),{t:d}=(0,h.useLanguage)();return(0,n.useEffect)(()=>{(async()=>{try{let e=await m.apiClient.get("/api/notebooks");s(e)}catch(e){console.error("Failed to fetch notebooks:",e)}finally{l(!1)}})()},[]),(0,i.jsxs)(c.Select,{value:e,onValueChange:t,children:[(0,i.jsx)(c.SelectTrigger,{className:r,children:(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(u.BookOpen,{className:"h-4 w-4 text-muted-foreground"}),(0,i.jsx)(c.SelectValue,{placeholder:d.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,i.jsx)(c.SelectContent,{children:0===a.length?(0,i.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:d.notebooks?.selector?.empty||"No notebooks available"}):a.map(e=>(0,i.jsx)(c.SelectItem,{value:e.id,children:e.name},e.id))})]})}],38465);var g=e.i(31278);let p=(0,t.default)("maximize-2",[["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"}]]),w=(0,t.default)("minimize-2",[["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"}]]);var x=e.i(67240),f=e.i(16715),y=e.i(27612),b=e.i(19455),v=e.i(94114);let C=null,k=["setcoordsystem","setaxesvisible","setgridvisible","setcolor","setlinethickness","setlinestyle","setpointsize","setpointstyle","setlabelvisible","setcaption","setvisible","setfilling","setvalue","setfixed","setbackgroundcolor"];function D(e,t){for(let r of t)try{if(function(e){let t=e.toLowerCase().trim();return k.some(e=>t.startsWith(e+"("))}(r)){let t=function(e){let t=e.match(/^(\w+)\(([\s\S]+)\)$/);if(!t)return null;try{let e=t[2].trim();if(e.startsWith("[")&&e.endsWith("]"))return{m:t[1],a:JSON.parse(e)};if(/^-?\d+(\.\d+)?$/.test(e))return{m:t[1],a:[Number(e)]};if("true"===e||"false"===e)return{m:t[1],a:["true"===e]};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{m:t[1],a:[e.slice(1,-1)]};let r=e.split(",").map(e=>e.trim()).map(e=>/^-?\d+(\.\d+)?$/.test(e)?Number(e):"true"===e||"false"===e?"true"===e:e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e);return{m:t[1],a:r}}catch{return null}}(r);t&&"function"==typeof e[t.m]&&e[t.m](...t.a)}else{let t=r.trim();t&&!/[<>'"]/.test(t)?e.evalCommand(t):console.warn(`[GGB] Blocked potentially unsafe command: ${r.substring(0,50)}`)}}catch(e){console.warn(`[GGB] Failed: ${r}`,e)}}e.s(["GeogebraDemo",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:a=!1,showMenuBar:s=!1,className:o="",onRegenerate:l,onDelete:d}){let{t:c}=(0,h.useLanguage)(),u=(0,n.useRef)(null),m=(0,n.useRef)(null),k=(0,n.useRef)(`ggb-${Math.random().toString(36).slice(2,9)}`),[j,N]=(0,n.useState)(!0),[M,R]=(0,n.useState)(null),[S,E]=(0,n.useState)(!0),[$,B]=(0,n.useState)(!1),[P,_]=(0,n.useState)(!1),L=(0,n.useMemo)(()=>(function(e){if(!e?.trim())return[];let t=e.trim();if(t.startsWith("["))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&""!==e.trim())}catch{}return t.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//"))})(e),[e]);(0,n.useEffect)(()=>{if(0===L.length)return;let e=!1,i=k.current;return(C||(C=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=()=>{C=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let n=window.GGBApplet;if(!n){R("GeoGebra 未正确加载"),N(!1);return}let o=u.current;if(o){o.innerHTML=`<div id="${i}" style="width:100%;height:${t}px"></div>`;try{new n({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:a,showMenuBar:s,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{if(e)return;m.current=r;let i=u.current?.firstElementChild;if(i){i.style.width="100%";let e=u.current?.offsetWidth||i.offsetWidth||800;r.setSize(e,t)}D(r,L),N(!1)}},!0).inject(i)}catch(t){console.error("[GGB] Init failed:",t),e||(R("GeoGebra 初始化失败"),N(!1))}}}).catch(t=>{console.error("[GGB] Script load failed:",t),e||(R("无法加载 GeoGebra 组件"),N(!1))}),()=>{e=!0;try{let e=m.current;e&&"function"==typeof e.remove&&e.remove()}catch(e){console.warn("[GGB] Cleanup failed:",e)}m.current=null,u.current&&(u.current.innerHTML="")}},[L,r,a,s]),(0,n.useEffect)(()=>{let e=u.current?.firstElementChild;if(!e)return;let r=S?700:t;e.style.width="100%",e.style.height=`${r}px`;let i=m.current;if(i?.setSize){let t=u.current?.offsetWidth||e.offsetWidth||800;i.setSize(t,r)}},[S,t]);let I=(0,n.useCallback)(()=>{let e=m.current;if(e)try{e.resetConstruction(),setTimeout(()=>{m.current&&D(m.current,L)},300)}catch(e){console.warn("[GGB] Reset failed",e)}},[L]),H=(0,n.useCallback)(async()=>{if(l&&!$){B(!0);try{await l()}finally{B(!1)}}},[l,$]),A=(0,n.useCallback)(async()=>{if(d&&!P&&await (0,v.confirmDialog)(c.geogebra.confirmDelete,{destructive:!0})){_(!0);try{await d()}catch{v.toast.error(c.geogebra.deleteFailed)}finally{_(!1)}}},[d,P,c]);return 0===L.length?null:(0,i.jsxs)("div",{className:`relative rounded-lg border bg-card ${o}`,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"GeoGebra 动态演示"}),j&&(0,i.jsx)(g.Loader2,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[l&&(0,i.jsxs)(b.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:H,title:"重新生成",disabled:$||j,children:[$?(0,i.jsx)(g.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(f.RefreshCw,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:"重新生成"})]}),d&&(0,i.jsxs)(b.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:A,title:c.geogebra.delete,disabled:P||$,children:[P?(0,i.jsx)(g.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(y.Trash2,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:c.geogebra.delete})]}),(0,i.jsx)(b.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:I,title:"重置",disabled:j,children:(0,i.jsx)(x.RotateCcw,{className:"h-3.5 w-3.5"})}),(0,i.jsx)(b.Button,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>E(e=>!e),title:S?"缩小":"放大",children:S?(0,i.jsx)(w,{className:"h-3.5 w-3.5"}):(0,i.jsx)(p,{className:"h-3.5 w-3.5"})})]})]}),(0,i.jsx)("div",{ref:u,style:{width:"100%"}}),j&&(0,i.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,i.jsx)(g.Loader2,{className:"h-6 w-6 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm text-muted-foreground",children:"加载 GeoGebra..."})]})}),M&&(0,i.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:M})]})}],3198)},83086,e=>{"use strict";let t=(0,e.i(75254).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],83086)},69937,e=>{"use strict";var t=e.i(18050);let r=(0,e.i(75254).default)("star",[["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"}]]);var i=e.i(11110),n=e.i(75157);let a=[1,2,3,4,5];e.s(["DifficultyStars",0,function({value:e,onChange:s,disabled:o,size:l="sm",showUnrated:h=!0,className:d}){let{t:c}=(0,i.useLanguage)(),u=e??0,m="sm"===l?"h-3.5 w-3.5":"h-5 w-5",g=u?c.difficulty.starsLabel.replace("{n}",String(u)):c.difficulty.unrated;return s?(0,t.jsxs)("span",{className:(0,n.cn)("inline-flex items-center gap-0.5",d),role:"group","aria-label":`${c.difficulty.label}:${g}`,title:c.difficulty.clearHint,children:[a.map(e=>(0,t.jsx)("button",{type:"button",disabled:o,onClick:()=>s(e===u?null:e),"aria-label":c.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,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,{className:(0,n.cn)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&h&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:c.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,n.cn)("inline-flex items-center",d),role:"img","aria-label":`${c.difficulty.label}:${g}`,title:g,children:a.map(e=>(0,t.jsx)(r,{className:(0,n.cn)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):h?(0,t.jsx)("span",{className:(0,n.cn)("text-xs text-muted-foreground",d),children:c.difficulty.unrated}):null}],69937)},12130,28928,e=>{"use strict";var t=e.i(18050),r=e.i(71645),i=r,n=Object.defineProperty,a=(e,t,r)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?n(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r};let s={x:0,y:0,width:0,height:0,unit:"px"},o=(e,t,r)=>Math.min(Math.max(e,t),r),l=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function h(e,t,r){return"%"===e.unit?{...s,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function d(e,t,r){return e.unit?"px"===e.unit?{...s,...e,unit:"px"}:{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...s,...e,unit:"px"}}function c(e,t,r,i,n,a=0,s=0,o=i,l=n){let h={...e},d=Math.min(a,i),u=Math.min(s,n),m=Math.min(o,i),g=Math.min(l,n);t&&(t>1?(u=(d=s?s*t:d)/t,m=o*t):(d=(u=a?a/t:u)*t,g=l/t)),h.y<0&&(h.height=Math.max(h.height+h.y,u),h.y=0),h.x<0&&(h.width=Math.max(h.width+h.x,d),h.x=0);let p=i-(h.x+h.width);p<0&&(h.x=Math.min(h.x,i-d),h.width+=p);let w=n-(h.y+h.height);if(w<0&&(h.y=Math.min(h.y,n-u),h.height+=w),h.width<d&&(("sw"===r||"nw"==r)&&(h.x-=d-h.width),h.width=d),h.height<u&&(("nw"===r||"ne"==r)&&(h.y-=u-h.height),h.height=u),h.width>m&&(("sw"===r||"nw"==r)&&(h.x-=m-h.width),h.width=m),h.height>g&&(("nw"===r||"ne"==r)&&(h.y-=g-h.height),h.height=g),t){let e=h.width/h.height;if(e<t){let e=Math.max(h.width/t,u);("nw"===r||"ne"==r)&&(h.y-=e-h.height),h.height=e}else if(e>t){let e=Math.max(h.height*t,d);("sw"===r||"nw"==r)&&(h.x-=e-h.width),h.width=e}}return h}let u={capture:!0,passive:!1},m=0,g=class e extends i.PureComponent{constructor(){super(...arguments),a(this,"docMoveBound",!1),a(this,"mouseDownOnCrop",!1),a(this,"dragStarted",!1),a(this,"evData",{startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0}),a(this,"componentRef",(0,i.createRef)()),a(this,"mediaRef",(0,i.createRef)()),a(this,"resizeObserver"),a(this,"initChangeCalled",!1),a(this,"instanceId",`rc-${m++}`),a(this,"state",{cropIsActive:!1,newCropIsBeingDrawn:!1}),a(this,"onCropPointerDown",e=>{let{crop:t,disabled:r}=this.props,i=this.getBox();if(!t)return;let n=d(t,i.width,i.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,s=e.clientX,o=e.clientY,l=n.x,h=n.y;if(a){let t=e.clientX-i.x,r=e.clientY-i.y,d=0,c=0;"ne"===a||"e"==a?(d=t-(n.x+n.width),c=r-n.y,l=n.x,h=n.y+n.height):"se"===a||"s"===a?(d=t-(n.x+n.width),c=r-(n.y+n.height),l=n.x,h=n.y):"sw"===a||"w"==a?(d=t-n.x,c=r-(n.y+n.height),l=n.x+n.width,h=n.y):("nw"===a||"n"==a)&&(d=t-n.x,c=r-n.y,l=n.x+n.width,h=n.y+n.height),s=l+i.x+d,o=h+i.y+c}this.evData={startClientX:s,startClientY:o,startCropX:l,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})}),a(this,"onComponentPointerDown",e=>{let{crop:t,disabled:r,locked:i,keepSelection:n,onChange:a}=this.props,s=this.getBox();if(r||i||n&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let o=e.clientX-s.x,l=e.clientY-s.y,c={unit:"px",x:o,y:l,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:o,startCropY:l,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(d(c,s.width,s.height),h(c,s.width,s.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})}),a(this,"onDocPointerMove",e=>{let t,{crop:r,disabled:i,onChange:n,onDragStart:a}=this.props,s=this.getBox();if(i||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));let{evData:o}=this;o.clientX=e.clientX,o.clientY=e.clientY,l(r,t=o.isResize?this.resizeCrop():this.dragCrop())||n(d(t,s.width,s.height),h(t,s.width,s.height))}),a(this,"onComponentKeyDown",t=>{let{crop:r,disabled:i,onChange:n,onComplete:a}=this.props;if(i)return;let s=t.key,l=!1;if(!r)return;let c=this.getBox(),u=this.makePixelCrop(c),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===s?(u.x-=m,l=!0):"ArrowRight"===s?(u.x+=m,l=!0):"ArrowUp"===s?(u.y-=m,l=!0):"ArrowDown"===s&&(u.y+=m,l=!0),l){t.cancelable&&t.preventDefault(),u.x=o(u.x,0,c.width-u.width),u.y=o(u.y,0,c.height-u.height);let e=d(u,c.width,c.height),r=h(u,c.width,c.height);n(e,r),a&&a(e,r)}}),a(this,"onHandlerKeyDown",(t,r)=>{var i,n;let a,{aspect:s=0,crop:o,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:w,onChange:x,onComplete:f}=this.props,y=this.getBox();if(u||!o||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=c((i=d(o,y.width,y.height),n=t.key,a={...i},"ArrowLeft"===n?"nw"===r?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"w"===r?(a.x-=b,a.width+=b):"sw"===r?(a.x-=b,a.width+=b,a.height+=b):"ne"===r?(a.y+=b,a.width-=b,a.height-=b):"e"===r?a.width-=b:"se"===r&&(a.width-=b,a.height-=b):"ArrowRight"===n&&("nw"===r?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"w"===r?(a.x+=b,a.width-=b):"sw"===r?(a.x+=b,a.width-=b,a.height-=b):"ne"===r?(a.y-=b,a.width+=b,a.height+=b):"e"===r?a.width+=b:"se"===r&&(a.width+=b,a.height+=b)),"ArrowUp"===n?"nw"===r?(a.x-=b,a.y-=b,a.width+=b,a.height+=b):"n"===r?(a.y-=b,a.height+=b):"ne"===r?(a.y-=b,a.width+=b,a.height+=b):"sw"===r?(a.x+=b,a.width-=b,a.height-=b):"s"===r?a.height-=b:"se"===r&&(a.width-=b,a.height-=b):"ArrowDown"===n&&("nw"===r?(a.x+=b,a.y+=b,a.width-=b,a.height-=b):"n"===r?(a.y+=b,a.height-=b):"ne"===r?(a.y+=b,a.width-=b,a.height-=b):"sw"===r?(a.x-=b,a.width+=b,a.height+=b):"s"===r?a.height+=b:"se"===r&&(a.width+=b,a.height+=b)),a),s,r,y.width,y.height,m,g,p,w);if(!l(o,v)){let e=h(v,y.width,y.height);x(v,e),f&&f(v,e)}}),a(this,"onDocPointerDone",e=>{let{crop:t,disabled:r,onComplete:i,onDragEnd:n}=this.props,a=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,n&&n(e),i&&i(d(t,a.width,a.height),h(t,a.width,a.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))}),a(this,"onDragFocus",()=>{var e;null==(e=this.componentRef.current)||e.scrollTo(0,0)})}get document(){return document}getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:r,width:i,height:n}=e.getBoundingClientRect();return{x:t,y:r,width:i,height:n}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:i}=this.getBox();e&&i&&r(d(t,e,i),h(t,e,i))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,u),this.document.addEventListener("pointerup",this.onDocPointerDone,u),this.document.addEventListener("pointercancel",this.onDocPointerDone,u),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,u),this.document.removeEventListener("pointerup",this.onDocPointerDone,u),this.document.removeEventListener("pointercancel",this.onDocPointerDone,u),this.docMoveBound=!1)}getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),i=e.clientX-e.startClientX,n=e.clientY-e.startClientY;return r.x=o(e.startCropX+i,0,t.width-r.width),r.y=o(e.startCropY+n,0,t.height-r.height),r}getPointRegion(e,t,r,i){let n,{evData:a}=this,s=a.clientX-e.x,o=a.clientY-e.y;return n=i&&t?"nw"===t||"n"===t||"ne"===t:o<a.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:s<a.startCropX)?n?"nw":"sw":n?"ne":"se"}resolveMinDimensions(e,t,r=0,i=0){let n=Math.min(r,e.width),a=Math.min(i,e.height);return t&&(n||a)?t>1?n?[n,n/t]:[a*t,a]:a?[a*t,a]:[n,n/t]:[n,a]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:i,maxHeight:n}=this.props,a=this.getBox(),[s,l]=this.resolveMinDimensions(a,r,this.props.minWidth,this.props.minHeight),h=this.makePixelCrop(a),d=this.getPointRegion(a,t.ord,s,l),u=t.ord||d,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(s&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-s)),(l&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-l));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===d?(p.x=t.startCropX,p.width=m,r?p.height=p.width/r:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===d?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,r?p.height=p.width/r:p.height=g):"sw"===d?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),r?p.height=p.width/r:p.height=g):"nw"===d&&(p.x=t.startCropX+m,p.width=Math.abs(m),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let w=c(p,r,d,a.width,a.height,s,l,i,n);return r||e.xyOrds.indexOf(u)>-1?h=w:e.xOrds.indexOf(u)>-1?(h.x=w.x,h.width=w.width):e.yOrds.indexOf(u)>-1&&(h.y=w.y,h.height=w.height),h.x=o(h.x,0,a.width-h.width),h.y=o(h.y,0,a.height-h.height),h}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:n,renderSelectionAddon:a,ruleOfThirds:s,crop:o}=this.props,l=this.getCropStyle();if(o)return i.default.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!n&&i.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},i.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&i.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),s&&i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return d({...s,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:n,crop:a,disabled:s,locked:o,style:l,ruleOfThirds:h}=this.props,{cropIsActive:d,newCropIsBeingDrawn:c}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",n,d&&"ReactCrop--active",s&&"ReactCrop--disabled",o&&"ReactCrop--locked",c&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&r&&"ReactCrop--circular-crop",a&&h&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",r&&"ReactCrop--no-animate");return i.default.createElement("div",{ref:this.componentRef,className:m,style:l},i.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?i.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},i.default.createElement("defs",null,i.default.createElement("mask",{id:`hole-${this.instanceId}`},i.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),r?i.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):i.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),i.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};a(g,"xOrds",["e","w"]),a(g,"yOrds",["n","s"]),a(g,"xyOrds",["nw","ne","se","sw"]),a(g,"nudgeStep",1),a(g,"nudgeStepMedium",10),a(g,"nudgeStepLarge",100),a(g,"defaultProps",{ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}});var p=e.i(19455),w=e.i(76639),x=e.i(37727),f=e.i(11110);async function y(e,t){let{naturalWidth:r,naturalHeight:i}=e;return Promise.all(t.map(t=>new Promise((n,a)=>{let s=document.createElement("canvas"),o=Math.round(t.x*r),l=Math.round(t.y*i);s.width=Math.max(1,Math.round(t.width*r)),s.height=Math.max(1,Math.round(t.height*i));let h=s.getContext("2d");h?(h.drawImage(e,o,l,s.width,s.height,0,0,s.width,s.height),s.toBlob(e=>e?n(e):a(Error("Canvas is empty")),"image/jpeg",.95)):a(Error("Canvas is not supported"))})))}let b=(0,r.forwardRef)(function({imageSrc:e,regions:i,onChange:n},a){let{t:s}=(0,f.useLanguage)(),o=(0,r.useRef)(null),l=(0,r.useRef)(null),[h,d]=(0,r.useState)(null),c=e=>{let t=o.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},u=()=>{h&&h.width>=.02&&h.height>=.02&&n([...i,h]),l.current=null,d(null)},m=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:a,src:e,alt:"",draggable:!1,style:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},className:"block"}),(0,t.jsxs)("div",{ref:o,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(o.current?.setPointerCapture(e.pointerId),l.current=c(e),d(null))},onPointerMove:e=>{var t,r,i,n;let a,s,o;if(!l.current)return;let h=c(e);d((t=l.current.x,r=l.current.y,i=h.x,n=h.y,s=(a=e=>Math.min(1,Math.max(0,e)))(Math.min(t,i)),o=a(Math.min(r,n)),{x:s,y:o,width:a(Math.max(t,i))-s,height:a(Math.max(r,n))-o}))},onPointerUp:u,onPointerCancel:u,children:[i.map((e,r)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:m(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:r+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":s.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>n(i.filter((e,t)=>t!==r)),children:(0,t.jsx)(x.X,{className:"h-3 w-3"})})]},r)),h&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:m(h)})]})]})});async function v(e,t=1,r=1920,i=.8){return new Promise((n,a)=>{let s=new FileReader;s.onload=s=>{let o=new Image;o.onload=()=>{let s=document.createElement("canvas"),l=s.getContext("2d");if(!l)return void a(Error("无法获取 Canvas 上下文"));let h=o.width,d=o.height;h>r&&(d=d*r/h,h=r),s.width=h,s.height=d,l.drawImage(o,0,0,h,d);let c=i,u=s.toDataURL("image/jpeg",c),m=3*u.length/4/1024/1024;for(;m>t&&c>.1;){c-=.1;let e=3*(u=s.toDataURL("image/jpeg",c)).length/4/1024/1024;if(console.log(`压缩质量: ${c.toFixed(1)}, 大小: ${e.toFixed(2)}MB`),e<=t)break}console.log(`原始文件: ${(e.size/1024/1024).toFixed(2)}MB, 压缩后: ${(3*u.length/4/1024/1024).toFixed(2)}MB`),n(u)},o.onerror=()=>a(Error("图片加载失败")),o.src=s.target?.result},s.onerror=()=>a(Error("文件读取失败")),s.readAsDataURL(e)})}async function C(e){let t=e.size/1024/1024;return(console.log(`文件大小: ${t.toFixed(2)}MB`),t>1)?(console.log("文件超过阈值,开始压缩..."),await v(e,1)):(console.log("文件大小合适,无需压缩"),new Promise((t,r)=>{let i=new FileReader;i.onload=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)}))}e.s(["ImageCropper",0,function({imageSrc:e,open:i,onClose:n,onCropComplete:a,onMultiCropComplete:s}){let{t:o}=(0,f.useLanguage)(),[l,h]=(0,r.useState)(),[d,c]=(0,r.useState)(),u=(0,r.useRef)(null),[m,x]=(0,r.useState)("single"),[v,C]=(0,r.useState)({src:e,regions:[]}),k=v.src===e?v.regions:[],D=t=>C({src:e,regions:t}),j=(0,r.useRef)(null),N=async()=>{if(j.current&&0!==k.length&&s)try{s(await y(j.current,k)),D([])}catch(e){console.error(e)}},M=async(e,t)=>{let r=document.createElement("canvas"),i=e.naturalWidth/e.width,n=e.naturalHeight/e.height;r.width=t.width*i,r.height=t.height*n;let a=r.getContext("2d");return a?(a.drawImage(e,t.x*i,t.y*n,t.width*i,t.height*n,0,0,t.width*i,t.height*n),new Promise((e,t)=>{r.toBlob(r=>{r?e(r):t(Error("Canvas is empty"))},"image/jpeg")})):null},R=async()=>{if(d&&u.current)try{let e=await M(u.current,d);e&&a(e)}catch(e){console.error(e)}else if(!d&&e)try{let t=await fetch(e),r=await t.blob();a(r)}catch(e){console.error(e)}};return(0,t.jsx)(w.Dialog,{open:i,onOpenChange:e=>!e&&n(),children:(0,t.jsxs)(w.DialogContent,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(w.DialogHeader,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(w.DialogTitle,{children:o.common.cropper?.title||"Crop Image"})}),(0,t.jsx)("div",{className:"flex-1 bg-black w-full overflow-auto flex items-center justify-center p-4",children:"multi"===m?(0,t.jsx)(b,{ref:j,imageSrc:e,regions:k,onChange:D}):(0,t.jsx)(g,{crop:l,onChange:(e,t)=>h(t),onComplete:e=>c(e),className:"max-h-full",children:(0,t.jsx)("img",{ref:u,alt:"Crop me",src:e,onLoad:function(e){let{width:t,height:r}=e.currentTarget;h({unit:"%",x:0,y:0,width:100,height:100}),c({unit:"px",x:0,y:0,width:t,height:r})},style:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"}})})}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[s&&(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:w-80",children:["single","multi"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>x(e),className:`rounded px-3 py-1.5 text-sm font-medium transition-colors ${m===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:"single"===e?o.batchImport.singleMode:o.batchImport.multiMode},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===m?`${o.batchImport.hint} ${o.batchImport.regionCount.replace("{count}",String(k.length))}`:o.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===m&&k.length>0&&(0,t.jsx)(p.Button,{variant:"ghost",onClick:()=>D([]),children:o.batchImport.clear}),(0,t.jsx)(p.Button,{variant:"outline",onClick:n,children:o.common.cancel||"Cancel"}),"multi"===m?(0,t.jsx)(p.Button,{onClick:N,disabled:0===k.length,children:o.batchImport.start.replace("{count}",String(k.length))}):(0,t.jsx)(p.Button,{onClick:R,children:o.common.confirm||"Confirm"})]})]})]})]})})}],12130),e.s(["processImageFile",0,C],28928)},88218,e=>{"use strict";var t=e.i(18050),r=e.i(71645),i=e.i(37727),n=e.i(87486),a=e.i(93479),s=e.i(41931);e.s(["TagInput",0,function({value:e=[],onChange:o,placeholder:l="Enter tags...",className:h="",enterHint:d,subject:c,gradeStage:u}){let[m,g]=(0,r.useState)(""),[p,w]=(0,r.useState)([]),[x,f]=(0,r.useState)(!1),[y,b]=(0,r.useState)(0),v=(0,r.useRef)(null),C=(0,r.useRef)(null);(0,r.useEffect)(()=>{m.trim()?k(m):(w([]),f(!1))},[m,c,u]);let k=async t=>{try{let r=new URLSearchParams({q:t});c&&r.append("subject",c),u&&r.append("stage",u);let i=((await s.apiClient.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(i.slice(0,20)),f(i.length>0),b(0)}catch(e){console.error("Failed to fetch suggestions:",e)}},D=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),w([]),f(!1),b(0))},j=t=>{o(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!C.current||C.current.contains(e.target)||v.current?.contains(e.target)||f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${h}`,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)(n.Badge,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>j(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(i.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(a.Input,{ref:v,type:"text",value:m,onChange:e=>g(e.target.value),onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),y>=0&&p[y]?D(p[y]):m.trim()&&D(m)):"ArrowDown"===t.key?(t.preventDefault(),b(e=>Math.min(e+1,p.length-1))):"ArrowUp"===t.key?(t.preventDefault(),b(e=>Math.max(e-1,0))):"Escape"===t.key?(f(!1),b(0)):"Backspace"===t.key&&!m&&e.length>0&&j(e[e.length-1])},onFocus:()=>{p.length>0&&f(!0)},placeholder:0===e.length?l:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&p.length>0&&(0,t.jsx)("div",{ref:C,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===y?"bg-accent":""}`,onClick:()=>D(e),onMouseEnter:()=>b(r),children:e},e))}),m&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:d?`${d} "${m}"`:`Press Enter to create "${m}"`})]})}])},52122,e=>{"use strict";e.i(30691),e.s(["inferSubjectFromName",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=>{"use strict";function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["getMistakeStatusLabel",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)]},"normalizeMistakeStatusForSave",0,function(e,r){return(r||"").trim()?"wrong_attempt":t(e)}])},43710,e=>{"use strict";e.s(["getDefaultPaperLevel",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<1||e>5?null:e<=3?"a":"b"}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71689,e=>{"use strict";let t=(0,e.i(75254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],71689)},63209,e=>{"use strict";let t=(0,e.i(75254).default)("circle-alert",[["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"}]]);e.s(["AlertCircle",0,t],63209)},3116,e=>{"use strict";let t=(0,e.i(75254).default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Clock",0,t],3116)},41966,52008,e=>{"use strict";var t=e.i(75254);let s=(0,t.default)("pen-tool",[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]);e.s(["PenTool",0,s],41966);let a=(0,t.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);e.s(["Layers",0,a],52008)},25652,e=>{"use strict";let t=(0,e.i(75254).default)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);e.s(["TrendingUp",0,t],25652)},72906,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(17255),r=e.i(18566),d=e.i(11110),i=e.i(35209),l=e.i(15519),n=e.i(30691),c=e.i(41931),o=e.i(31278);let m=(0,e.i(75254).default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var x=e.i(10980),u=e.i(41966),h=e.i(52008),g=e.i(25652),j=e.i(69638),b=e.i(3116),p=e.i(63209),f=e.i(64659),N=e.i(55900),v=e.i(86536),y=e.i(17923),C=e.i(19455),w=e.i(93842),k=e.i(15288),T=e.i(87486);function D({data:e,t:s}){let a=[{title:s.admin?.dashboard?.totalUsers||"总用户数",value:e.overview.totalUsers,icon:m,color:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-950/30"},{title:s.admin?.dashboard?.totalErrors||"总错题数",value:e.overview.totalErrorItems,icon:x.BookOpen,color:"text-red-500",bgColor:"bg-red-50 dark:bg-red-950/30"},{title:s.admin?.dashboard?.totalPractice||"总练习数",value:e.overview.totalPracticeRecords,icon:u.PenTool,color:"text-green-500",bgColor:"bg-green-50 dark:bg-green-950/30"},{title:s.admin?.dashboard?.totalNotebooks||"总错题本数",value:e.overview.totalSubjects,icon:h.Layers,color:"text-purple-500",bgColor:"bg-purple-50 dark:bg-purple-950/30"}];return(0,t.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:a.map(e=>(0,t.jsx)(k.Card,{className:"border-0 shadow-sm",children:(0,t.jsxs)(k.CardContent,{className:"p-4 flex items-center gap-4",children:[(0,t.jsx)("div",{className:`p-3 rounded-xl ${e.bgColor}`,children:(0,t.jsx)(e.icon,{className:`h-6 w-6 ${e.color}`})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.title}),(0,t.jsx)("p",{className:"text-2xl font-bold",children:e.value})]})]})},e.title))})}function M({data:e,t:s}){let a=Math.max(...e.dailyTrend.map(e=>e.count),1);return(0,t.jsxs)(k.Card,{className:"border-0 shadow-sm",children:[(0,t.jsx)(k.CardHeader,{className:"pb-2",children:(0,t.jsxs)(k.CardTitle,{className:"text-base flex items-center gap-2",children:[(0,t.jsx)(g.TrendingUp,{className:"h-4 w-4 text-orange-500"}),s.admin?.dashboard?.recentTrend||"最近 7 天录入趋势"]})}),(0,t.jsx)(k.CardContent,{children:(0,t.jsx)("div",{className:"flex items-end gap-2 h-40",children:e.dailyTrend.map(e=>{let s=a>0?e.count/a*100:0,r=e.date.slice(5).replace("-","/");return(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center gap-1",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.count>0?e.count:""}),(0,t.jsx)("div",{className:"w-full relative",style:{height:"100px"},children:(0,t.jsx)("div",{className:"absolute bottom-0 w-full bg-gradient-to-t from-orange-500 to-orange-400 rounded-t-md transition-all duration-500 min-h-[4px]",style:{height:`${Math.max(s,4)}%`}})}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:r})]},e.date)})})})]})}function A({data:e,t:s}){let a=e.subjectDistribution.reduce((e,t)=>e+t.count,0),r=["bg-blue-500","bg-green-500","bg-orange-500","bg-purple-500","bg-red-500","bg-cyan-500","bg-yellow-500","bg-pink-500","bg-indigo-500"];return(0,t.jsxs)(k.Card,{className:"border-0 shadow-sm",children:[(0,t.jsx)(k.CardHeader,{className:"pb-2",children:(0,t.jsxs)(k.CardTitle,{className:"text-base flex items-center gap-2",children:[(0,t.jsx)(y.BarChart3,{className:"h-4 w-4 text-blue-500"}),s.admin?.dashboard?.subjectDistribution||"学科错题分布"]})}),(0,t.jsx)(k.CardContent,{children:0===a?(0,t.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:s.admin?.dashboard?.noData||"暂无数据"}):(0,t.jsx)("div",{className:"space-y-3",children:e.subjectDistribution.map((e,s)=>{let d=a>0?Math.round(e.count/a*100):0;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,t.jsx)("span",{className:"font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e.count," (",d,"%)"]})]}),(0,t.jsx)("div",{className:"w-full bg-muted rounded-full h-2.5",children:(0,t.jsx)("div",{className:`h-2.5 rounded-full ${r[s%r.length]} transition-all duration-500`,style:{width:`${d}%`}})})]},e.name)})})})]})}function B({data:e,t:s}){let a=e.masteryDistribution.new+e.masteryDistribution.reviewing+e.masteryDistribution.mastered,r=[{key:"new",label:s.admin?.dashboard?.masteryNew||"待复习",count:e.masteryDistribution.new,icon:p.AlertCircle,color:"text-red-500",bg:"bg-red-500"},{key:"reviewing",label:s.admin?.dashboard?.masteryReviewing||"复习中",count:e.masteryDistribution.reviewing,icon:b.Clock,color:"text-yellow-500",bg:"bg-yellow-500"},{key:"mastered",label:s.admin?.dashboard?.masteryMastered||"已掌握",count:e.masteryDistribution.mastered,icon:j.CheckCircle,color:"text-green-500",bg:"bg-green-500"}];return(0,t.jsxs)(k.Card,{className:"border-0 shadow-sm",children:[(0,t.jsx)(k.CardHeader,{className:"pb-2",children:(0,t.jsxs)(k.CardTitle,{className:"text-base flex items-center gap-2",children:[(0,t.jsx)(j.CheckCircle,{className:"h-4 w-4 text-green-500"}),s.admin?.dashboard?.masteryDistribution||"掌握度分布"]})}),(0,t.jsx)(k.CardContent,{children:0===a?(0,t.jsx)("p",{className:"text-sm text-muted-foreground py-8 text-center",children:s.admin?.dashboard?.noData||"暂无数据"}):(0,t.jsx)("div",{className:"space-y-3",children:r.map(e=>{let s=a>0?Math.round(e.count/a*100):0;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex justify-between text-sm items-center",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 font-medium",children:[(0,t.jsx)(e.icon,{className:`h-4 w-4 ${e.color}`}),e.label]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:[e.count," (",s,"%)"]})]}),(0,t.jsx)("div",{className:"w-full bg-muted rounded-full h-2.5",children:(0,t.jsx)("div",{className:`h-2.5 rounded-full ${e.bg} transition-all duration-500`,style:{width:`${s}%`}})})]},e.key)})})})]})}function L({users:e,onViewDetail:a}){let{timeZone:r}=(0,l.useTimeZone)(),{t:i}=(0,d.useLanguage)(),[c,o]=(0,s.useState)(null);return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"hidden md:block border rounded-lg overflow-hidden",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{className:"bg-muted/50",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"text-left p-3 font-medium",children:i.admin?.dashboard?.userName||"用户名"}),(0,t.jsx)("th",{className:"text-left p-3 font-medium",children:i.admin?.dashboard?.email||"邮箱"}),(0,t.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.notebooks||"错题本"}),(0,t.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.errors||"错题"}),(0,t.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.practice||"练习"}),(0,t.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.status||"状态"}),(0,t.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.registeredAt||"注册时间"}),(0,t.jsx)("th",{className:"text-center p-3 font-medium",children:i.admin?.dashboard?.actions||"操作"})]})}),(0,t.jsx)("tbody",{children:e.map(e=>(0,t.jsxs)("tr",{className:"border-t hover:bg-muted/30 transition-colors",children:[(0,t.jsx)("td",{className:"p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.name||"N/A"}),"admin"===e.role&&(0,t.jsx)(T.Badge,{variant:"default",className:"text-xs",children:i.admin?.admin||"管理员"})]})}),(0,t.jsx)("td",{className:"p-3 text-muted-foreground",children:e.email}),(0,t.jsx)("td",{className:"p-3 text-center",children:e.notebookCount}),(0,t.jsx)("td",{className:"p-3 text-center font-medium",children:e.errorCount}),(0,t.jsx)("td",{className:"p-3 text-center",children:e.practiceCount}),(0,t.jsx)("td",{className:"p-3 text-center",children:(0,t.jsx)(T.Badge,{variant:e.isActive?"default":"destructive",className:"text-xs",children:e.isActive?i.admin?.active||"启用":i.admin?.disabled||"禁用"})}),(0,t.jsx)("td",{className:"p-3 text-center text-muted-foreground text-xs",children:(0,n.formatDateTime)(e.createdAt,"yyyy-MM-dd",r)}),(0,t.jsx)("td",{className:"p-3 text-center",children:(0,t.jsx)(C.Button,{variant:"ghost",size:"sm",onClick:()=>a(e.id),title:i.admin?.dashboard?.viewDetail||"查看详情",children:(0,t.jsx)(v.Eye,{className:"h-4 w-4"})})})]},e.id))})]})}),(0,t.jsx)("div",{className:"md:hidden space-y-3",children:e.map(e=>(0,t.jsx)(k.Card,{className:"border-0 shadow-sm",children:(0,t.jsxs)(k.CardContent,{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start cursor-pointer",onClick:()=>o(c===e.id?null:e.id),children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.name||"N/A"}),"admin"===e.role&&(0,t.jsx)(T.Badge,{variant:"default",className:"text-xs",children:i.admin?.admin||"管理员"})]}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:e.email})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(T.Badge,{variant:e.isActive?"default":"destructive",className:"text-xs",children:e.isActive?i.admin?.active||"启用":i.admin?.disabled||"禁用"}),c===e.id?(0,t.jsx)(N.ChevronUp,{className:"h-4 w-4 text-muted-foreground"}):(0,t.jsx)(f.ChevronDown,{className:"h-4 w-4 text-muted-foreground"})]})]}),c===e.id&&(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t grid grid-cols-3 gap-3 text-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-lg font-bold",children:e.notebookCount}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:i.admin?.dashboard?.notebooks||"错题本"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-lg font-bold text-red-500",children:e.errorCount}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:i.admin?.dashboard?.errors||"错题"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-lg font-bold text-green-500",children:e.practiceCount}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:i.admin?.dashboard?.practice||"练习"})]})]}),c===e.id&&(0,t.jsxs)("div",{className:"mt-3 pt-3 border-t flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,n.formatDateTime)(e.createdAt,"yyyy-MM-dd",r)}),(0,t.jsxs)(C.Button,{variant:"ghost",size:"sm",onClick:()=>a(e.id),children:[(0,t.jsx)(v.Eye,{className:"h-4 w-4 mr-1"}),i.admin?.dashboard?.viewDetail||"查看详情"]})]})]})},e.id))})]})}e.s(["default",0,function(){let{data:e,status:l}=(0,a.useSession)(),n=(0,r.useRouter)(),{t:x}=(0,d.useLanguage)(),[u,h]=(0,s.useState)(null);(0,i.usePageTitle)(x.admin.dashboard.title);let[g,j]=(0,s.useState)(!0),b=(0,s.useCallback)(async()=>{j(!0);try{let e=await c.apiClient.get("/api/admin/dashboard");h(e)}catch(e){console.error("Failed to fetch dashboard data",e)}finally{j(!1)}},[]);return((0,s.useEffect)(()=>{if("loading"!==l){if(!e?.user||"admin"!==e.user.role)return void n.push("/");b()}},[e,l,n,b]),"loading"===l||g)?(0,t.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,t.jsx)(o.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):u?(0,t.jsxs)("div",{className:"max-w-6xl mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(w.PageHeader,{title:x.admin?.dashboard?.title||"管理员仪表盘",description:x.admin?.dashboard?.subtitle||"查看全站用户和错题统计"}),(0,t.jsx)(D,{data:u,t:x}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsx)(M,{data:u,t:x}),(0,t.jsx)(B,{data:u,t:x})]}),(0,t.jsx)(A,{data:u,t:x}),(0,t.jsxs)(k.Card,{className:"border-0 shadow-sm",children:[(0,t.jsxs)(k.CardHeader,{className:"pb-2",children:[(0,t.jsxs)(k.CardTitle,{className:"text-lg flex items-center gap-2",children:[(0,t.jsx)(m,{className:"h-5 w-5 text-blue-500"}),x.admin?.dashboard?.userList||"用户列表"]}),(0,t.jsx)(k.CardDescription,{children:x.admin?.dashboard?.userListDesc||"所有注册用户的错题录入情况"})]}),(0,t.jsx)(k.CardContent,{children:(0,t.jsx)(L,{users:u.userStats,onViewDetail:e=>n.push(`/admin/user/${e}`)})})]})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[60vh] gap-4",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:x.common?.error||"加载失败"}),(0,t.jsx)(C.Button,{onClick:b,children:x.admin?.dashboard?.retry||"重试"})]})}],72906)},90546,e=>{"use strict";var t=e.i(18050),s=e.i(18566),a=e.i(19455),r=e.i(71689);e.s(["BackButton",0,function({fallbackUrl:e,className:d}){let i=(0,s.useRouter)();return(0,t.jsx)(a.Button,{variant:"ghost",size:"icon",onClick:()=>{i.push(e)},className:d,children:(0,t.jsx)(r.ArrowLeft,{className:"h-5 w-5"})})}])},15288,e=>{"use strict";var t=e.i(18050),s=e.i(75157);e.s(["Card",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,s.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-6",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-muted-foreground text-sm",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("leading-none font-semibold",e),...a})}])},93842,e=>{"use strict";var t=e.i(18050),s=e.i(90546),a=e.i(75157);e.s(["PageHeader",0,function({title:e,description:r,backHref:d,actions:i,titleAddon:l,className:n}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex items-start gap-3",n),children:[d&&(0,t.jsx)(s.BackButton,{fallbackUrl:d,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]}),r&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:r})]}),i&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:i})]})}])},35209,e=>{"use strict";var t=e.i(71645),s=e.i(11110);e.s(["usePageTitle",0,function(...e){let{t:a}=(0,s.useLanguage)(),r=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=r},[r])}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,71689,e=>{"use strict";let t=(0,e.i(75254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],71689)},63059,e=>{"use strict";let t=(0,e.i(75254).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],63059)},88699,e=>{"use strict";let t=(0,e.i(75254).default)("pencil",[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],88699)},66776,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(18566),o=e.i(19455),i=e.i(12505),n=e.i(93842),r=e.i(86963),l=e.i(31278),c=e.i(75254);let d=(0,c.default)("locate-fixed",[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var u=e.i(93479),m=e.i(11110),h=e.i(33547),g=e.i(47279);function x(){let{t:e}=(0,m.useLanguage)(),i=(0,s.useRouter)(),[n,r]=(0,a.useState)(""),[c,x]=(0,a.useState)(null),[p,b]=(0,a.useState)(!1),y=async t=>{t.preventDefault();let a=n.trim();if(!(0,g.isShortId)(a))return void x(e.shortId.invalid);b(!0),x(null);let s=await (0,h.locateByShortId)(a);b(!1),s?i.push(`/error-items/${s}`):x(e.shortId.notFound)};return(0,t.jsxs)("form",{onSubmit:y,className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.Input,{value:n,onChange:e=>{r(e.target.value),x(null)},placeholder:e.shortId.locatePlaceholder,maxLength:6,className:"font-mono sm:max-w-xs","aria-label":e.shortId.locateTitle}),(0,t.jsxs)(o.Button,{type:"submit",variant:"outline",disabled:p||!n.trim(),children:[p?(0,t.jsx)(l.Loader2,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(d,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"ml-2",children:e.shortId.locate})]})]}),c&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:c})]})}var p=e.i(10980),b=e.i(7233);let y=(0,c.default)("atom",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]]),k=(0,c.default)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]);var j=e.i(63059);let f=(0,c.default)("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]),v=(0,c.default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),N=(0,c.default)("landmark",[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]]);var S=e.i(63639);let w=(0,c.default)("leaf",[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]]);var C=e.i(88699);let E=(0,c.default)("scale",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]]),T=(0,c.default)("sigma",[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]]);var L=e.i(27612),B=e.i(9830),D=e.i(76824);let M={math:{icon:T,className:"bg-blue-100 text-blue-600 dark:bg-blue-500/15 dark:text-blue-300"},english:{icon:S.Languages,className:"bg-emerald-100 text-emerald-600 dark:bg-emerald-500/15 dark:text-emerald-300"},chinese:{icon:k,className:"bg-rose-100 text-rose-600 dark:bg-rose-500/15 dark:text-rose-300"},physics:{icon:y,className:"bg-amber-100 text-amber-600 dark:bg-amber-500/15 dark:text-amber-300"},chemistry:{icon:f,className:"bg-teal-100 text-teal-600 dark:bg-teal-500/15 dark:text-teal-300"},biology:{icon:w,className:"bg-lime-100 text-lime-700 dark:bg-lime-500/15 dark:text-lime-300"},history:{icon:N,className:"bg-orange-100 text-orange-600 dark:bg-orange-500/15 dark:text-orange-300"},geography:{icon:v,className:"bg-cyan-100 text-cyan-600 dark:bg-cyan-500/15 dark:text-cyan-300"},politics:{icon:E,className:"bg-red-100 text-red-600 dark:bg-red-500/15 dark:text-red-300"}},A={icon:p.BookOpen,className:"bg-accent text-accent-foreground"};function O({id:e,name:a,stage:s,subjectKey:i,errorCount:n,onClick:r,onRename:l,onDelete:c,itemLabel:d="items"}){let u=(0,D.resolveNotebookScope)({name:a,stage:s,subjectKey:i}),{icon:m,className:h}=u.subject?M[u.subject]:A;return(0,t.jsxs)("div",{role:"link",tabIndex:0,className:"group relative flex cursor-pointer items-center gap-4 rounded-2xl border bg-card p-4 shadow-sm transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:r,onKeyDown:e=>{"Enter"===e.key&&r()},children:[(0,t.jsx)("div",{className:`flex h-12 w-12 shrink-0 items-center justify-center rounded-xl ${h}`,children:(0,t.jsx)(m,{className:"h-6 w-6"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"truncate font-semibold",children:a}),(0,t.jsxs)("p",{className:"mt-0.5 flex items-center gap-1.5 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium tabular-nums text-foreground",children:n}),d,(0,t.jsx)("span",{className:"text-border",children:"|"}),(0,t.jsx)(B.NotebookScopeLabel,{notebook:{name:a,stage:s,subjectKey:i},className:"truncate"})]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100",children:[l&&(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:e=>{e.stopPropagation(),l()},children:(0,t.jsx)(C.Pencil,{className:"h-4 w-4"})}),c&&(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:t=>{t.stopPropagation(),c(e)},children:(0,t.jsx)(L.Trash2,{className:`h-4 w-4 ${n>0?"text-muted-foreground":"text-destructive"}`})})]}),(0,t.jsx)(j.ChevronRight,{className:"hidden h-4 w-4 shrink-0 text-muted-foreground sm:block"})]})}var _=e.i(76639),P=e.i(10204),I=e.i(67489),F=e.i(94114);function R({open:e,onOpenChange:s,onCreate:i}){let[n,r]=(0,a.useState)(""),[l,c]=(0,a.useState)(D.DEFAULT_NOTEBOOK_STAGE),[d,h]=(0,a.useState)(D.STAGE_SUBJECTS[D.DEFAULT_NOTEBOOK_STAGE][0]),[g,x]=(0,a.useState)(!1),{t:p}=(0,m.useLanguage)(),{stageLabel:b,subjectLabel:y}=(0,B.useNotebookScopeLabels)(),k=async()=>{if(!n.trim())return void F.toast.warning(p.notebooks?.dialog?.enterName||"Please enter notebook name");x(!0);try{await i({name:n.trim(),stage:l,subjectKey:d}),r(""),s(!1)}catch(e){console.error(e)}finally{x(!1)}};return(0,t.jsx)(_.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(_.DialogContent,{children:[(0,t.jsxs)(_.DialogHeader,{children:[(0,t.jsx)(_.DialogTitle,{children:p.notebooks?.dialog?.title||"Create New Notebook"}),(0,t.jsx)(_.DialogDescription,{children:p.notebooks?.dialog?.desc||"Create separate notebooks for different subjects or chapters"})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(P.Label,{htmlFor:"notebook-stage",children:p.notebooks.dialog.stageLabel}),(0,t.jsxs)(I.Select,{value:l,onValueChange:e=>{c(e),D.STAGE_SUBJECTS[e].includes(d)||h(D.STAGE_SUBJECTS[e][0])},children:[(0,t.jsx)(I.SelectTrigger,{id:"notebook-stage",children:(0,t.jsx)(I.SelectValue,{})}),(0,t.jsx)(I.SelectContent,{children:D.NOTEBOOK_STAGES.map(e=>(0,t.jsx)(I.SelectItem,{value:e,children:b(e)},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(P.Label,{htmlFor:"notebook-subject",children:p.notebooks.dialog.subjectLabel}),(0,t.jsxs)(I.Select,{value:d,onValueChange:e=>h(e),children:[(0,t.jsx)(I.SelectTrigger,{id:"notebook-subject",children:(0,t.jsx)(I.SelectValue,{})}),(0,t.jsx)(I.SelectContent,{children:D.STAGE_SUBJECTS[l].map(e=>(0,t.jsx)(I.SelectItem,{value:e,children:y(e)},e))})]})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p.notebooks.dialog.scopeHint}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(P.Label,{htmlFor:"name",children:p.notebooks?.dialog?.nameLabel||"Notebook Name"}),(0,t.jsx)(u.Input,{id:"name",placeholder:p.notebooks?.dialog?.placeholder||"e.g. Math, Physics, Chemistry...",value:n,onChange:e=>r(e.target.value),onKeyDown:e=>"Enter"===e.key&&k()})]})]}),(0,t.jsxs)(_.DialogFooter,{children:[(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>s(!1),children:p.common.cancel}),(0,t.jsx)(o.Button,{onClick:k,disabled:g||!n.trim(),children:g?p.notebooks?.dialog?.creating||"Creating...":p.notebooks?.dialog?.create||"Create"})]})]})})}var z=e.i(67153),H=e.i(41931),K=e.i(35209);e.s(["default",0,function(){let e=(0,s.useRouter)(),{t:l}=(0,m.useLanguage)();(0,K.usePageTitle)(l.notebooks.title);let[c,d]=(0,a.useState)([]),[u,h]=(0,a.useState)(!0),[g,y]=(0,a.useState)(!1),[k,j]=(0,a.useState)(null);(0,a.useEffect)(()=>{f()},[]);let f=async()=>{try{let e=await H.apiClient.get("/api/notebooks");d(e)}catch(e){console.error("Failed to fetch notebooks:",e)}finally{h(!1)}},v=async e=>{try{await H.apiClient.post("/api/notebooks",e),await f()}catch(t){console.error(t);let e=t.data?.message||l.notebooks?.createError||"Failed to create";F.toast.error(e)}},N=async e=>{k&&(await H.apiClient.put(`/api/notebooks/${k.id}`,{name:e}),j(null),await f())},S=async(e,t,a)=>{if(t>0)return void F.toast.warning(l.notebooks?.deleteNotEmpty||"Please clear all items in this notebook first.");if(await (0,F.confirmDialog)((l.notebooks?.deleteConfirm||"Are you sure?").replace("{name}",a),{destructive:!0}))try{await H.apiClient.delete(`/api/notebooks/${e}`),await f()}catch(t){console.error(t);let e=t.data?.message||l.notebooks?.deleteError||"Failed to delete";F.toast.error(e)}};return u?(0,t.jsx)(r.PageLoading,{label:l.common.loading}):(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)(n.PageHeader,{title:l.notebooks?.title||"My Notebooks",description:l.notebooks?.subtitle||"Manage your mistakes by subject",actions:(0,t.jsxs)(o.Button,{onClick:()=>y(!0),"aria-label":l.notebooks?.create||"New Notebook",children:[(0,t.jsx)(b.Plus,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:l.notebooks?.create||"New Notebook"})]})}),(0,t.jsx)(x,{}),0===c.length?(0,t.jsx)(i.EmptyState,{icon:p.BookOpen,title:l.notebooks?.empty||"No notebooks yet.",action:(0,t.jsxs)(o.Button,{onClick:()=>y(!0),children:[(0,t.jsx)(b.Plus,{className:"h-4 w-4"}),l.notebooks?.createFirst||"Create Notebook"]})}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:c.map(a=>(0,t.jsx)(O,{id:a.id,name:a.name,stage:a.stage,subjectKey:a.subjectKey,errorCount:a._count?.errorItems||0,onClick:()=>{var t;return t=a.id,void e.push(`/notebooks/${t}`)},onRename:()=>j(a),onDelete:()=>S(a.id,a._count?.errorItems||0,a.name),itemLabel:l.notebooks?.items||"items"},a.id))}),(0,t.jsx)(R,{open:g,onOpenChange:y,onCreate:v},l.common.loading),(0,t.jsx)(z.RenameNotebookDialog,{open:!!k,onOpenChange:e=>{e||j(null)},currentName:k?.name||"",onRename:N})]})})}],66776)},9830,76824,e=>{"use strict";var t=e.i(18050),a=e.i(11110),s=e.i(52122);let o=["primary","junior_high","senior_high"],i="primary",n=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function r(e){return"string"==typeof e&&n.includes(e)}function l(e){var t;let a=r(e.subjectKey)?e.subjectKey:(0,s.inferSubjectFromName)(e.name);return{stage:"string"==typeof(t=e.stage)&&o.includes(t)?e.stage:i,subject:a&&r(a)?a:null}}function c(){let{t:e}=(0,a.useLanguage)();return{stageLabel:t=>({primary:e.auth.primary,junior_high:e.auth.juniorHigh,senior_high:e.auth.seniorHigh})[t],subjectLabel:t=>e.tags.subjects[t]}}e.s(["DEFAULT_NOTEBOOK_STAGE",0,i,"NOTEBOOK_STAGES",0,o,"STAGE_SUBJECTS",0,{primary:["math","english"],junior_high:n,senior_high:n},"resolveNotebookScope",0,l],76824),e.s(["NotebookScopeLabel",0,function({notebook:e,className:a}){let{stageLabel:s,subjectLabel:o}=c(),i=l(e);return(0,t.jsxs)("span",{className:a,children:[s(i.stage),i.subject?` \xb7 ${o(i.subject)}`:""]})},"useNotebookScopeLabels",0,c],9830)},67153,e=>{"use strict";var t=e.i(18050),a=e.i(71645),s=e.i(76639),o=e.i(19455),i=e.i(93479),n=e.i(10204),r=e.i(11110),l=e.i(94114);e.s(["RenameNotebookDialog",0,function({open:e,onOpenChange:c,currentName:d,onRename:u}){let[m,h]=(0,a.useState)(d),[g,x]=(0,a.useState)(!1),{t:p}=(0,r.useLanguage)();(0,a.useEffect)(()=>{h(d)},[d]);let b=async()=>{if(!m.trim())return void l.toast.warning(p.notebooks?.renameDialog?.enterName||"Please enter notebook name");x(!0);try{await u(m.trim()),c(!1)}catch(e){console.error(e)}finally{x(!1)}};return(0,t.jsx)(s.Dialog,{open:e,onOpenChange:c,children:(0,t.jsxs)(s.DialogContent,{children:[(0,t.jsx)(s.DialogHeader,{children:(0,t.jsx)(s.DialogTitle,{children:p.notebooks?.renameDialog?.title||"Rename Notebook"})}),(0,t.jsx)("div",{className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(n.Label,{htmlFor:"rename-name",children:p.notebooks?.renameDialog?.nameLabel||"New Name"}),(0,t.jsx)(i.Input,{id:"rename-name",placeholder:p.notebooks?.renameDialog?.placeholder||"Enter new notebook name",value:m,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&b()})]})}),(0,t.jsxs)(s.DialogFooter,{children:[(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>c(!1),children:p.common.cancel}),(0,t.jsx)(o.Button,{onClick:b,disabled:g||!m.trim(),children:g?p.notebooks?.renameDialog?.renaming||"Renaming...":p.notebooks?.renameDialog?.rename||"Rename"})]})]})})}])},90546,e=>{"use strict";var t=e.i(18050),a=e.i(18566),s=e.i(19455),o=e.i(71689);e.s(["BackButton",0,function({fallbackUrl:e,className:i}){let n=(0,a.useRouter)();return(0,t.jsx)(s.Button,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:i,children:(0,t.jsx)(o.ArrowLeft,{className:"h-5 w-5"})})}])},12505,e=>{"use strict";var t=e.i(18050),a=e.i(75157);e.s(["EmptyState",0,function({icon:e,title:s,description:o,action:i,className:n}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",n),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}),o&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:o}),i&&(0,t.jsx)("div",{className:"mt-5",children:i})]})}])},93842,e=>{"use strict";var t=e.i(18050),a=e.i(90546),s=e.i(75157);e.s(["PageHeader",0,function({title:e,description:o,backHref:i,actions:n,titleAddon:r,className:l}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex items-start gap-3",l),children:[i&&(0,t.jsx)(a.BackButton,{fallbackUrl:i,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}),r]}),o&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:o})]}),n&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}])},86963,e=>{"use strict";var t=e.i(18050),a=e.i(31278);e.s(["PageLoading",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)(a.Loader2,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},52122,e=>{"use strict";e.i(30691),e.s(["inferSubjectFromName",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}])},35209,e=>{"use strict";var t=e.i(71645),a=e.i(11110);e.s(["usePageTitle",0,function(...e){let{t:s}=(0,a.useLanguage)(),o=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=o},[o])}])},33547,e=>{"use strict";var t=e.i(41931);async function a(e){try{return(await t.apiClient.get(`/api/error-items/short/${encodeURIComponent(e)}`)).id}catch{return null}}e.s(["locateByShortId",0,a])},47279,e=>{"use strict";let t=RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{6}$");e.s(["isShortId",0,function(e){return"string"==typeof e&&t.test(e)}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,63804,e=>{"use strict";let t=(0,e.i(75254).default)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]);e.s(["ListChecks",0,t],63804)},20278,e=>{"use strict";let t=(0,e.i(75254).default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);e.s(["Target",0,t],20278)},52683,e=>{"use strict";var t=e.i(18050),s=e.i(71645),a=e.i(18566),n=e.i(98469),r=e.i(78197),i=e.i(12130),o=e.i(22016),l=e.i(17255),d=e.i(10980),c=e.i(63804),m=e.i(20278),u=e.i(11110);let g=()=>()=>{};function x({notebookCount:e,itemCount:a,targetNotebook:n}){let{t:r,language:i}=(0,u.useLanguage)(),{data:p}=(0,l.useSession)(),h=(0,s.useSyncExternalStore)(g,()=>new Date().getHours(),()=>null),f=null===h?r.common.welcome.replace(/[,,\s]+$/,""):h<12?r.home.greetingMorning:h<18?r.home.greetingAfternoon:r.home.greetingEvening,y=p?.user?.name||p?.user?.email||"";return(0,t.jsxs)("section",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-indigo-600 via-indigo-500 to-violet-500 p-5 text-white shadow-lg shadow-indigo-500/20 md:p-7",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute -right-10 -top-12 h-44 w-44 rounded-full bg-white/10 blur-2xl"}),(0,t.jsx)("div",{className:"pointer-events-none absolute -bottom-16 right-24 h-40 w-40 rounded-full bg-fuchsia-300/20 blur-2xl"}),(0,t.jsxs)("div",{className:"relative flex flex-col gap-5 md:flex-row md:items-end md:justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsxs)("h1",{className:"text-xl font-bold tracking-tight md:text-2xl",children:[f,y&&`${"zh"===i?",":", "}${y}`]}),(0,t.jsx)("p",{className:"max-w-md text-sm text-white/80",children:r.home.heroSubtitle}),n&&(0,t.jsxs)("p",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/15 px-3 py-1 text-xs font-medium",children:[(0,t.jsx)(m.Target,{className:"h-3.5 w-3.5"}),r.home.targetNotebook.replace("{name}",n)]})]}),(0,t.jsxs)(o.default,{href:"/notebooks",className:"grid grid-cols-2 gap-3 md:w-72",children:[(0,t.jsxs)("div",{className:"rounded-xl bg-white/15 px-4 py-3 backdrop-blur-sm transition-colors hover:bg-white/20",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-white/75",children:[(0,t.jsx)(d.BookOpen,{className:"h-3.5 w-3.5"}),r.home.notebookCount]}),(0,t.jsx)("div",{className:"mt-1 text-2xl font-bold tabular-nums",children:e})]}),(0,t.jsxs)("div",{className:"rounded-xl bg-white/15 px-4 py-3 backdrop-blur-sm transition-colors hover:bg-white/20",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-white/75",children:[(0,t.jsx)(c.ListChecks,{className:"h-3.5 w-3.5"}),r.home.itemCount]}),(0,t.jsx)("div",{className:"mt-1 text-2xl font-bold tabular-nums",children:a})]})]})]})]})}var p=e.i(41931),h=e.i(35209),f=e.i(28928),y=e.i(68553),v=e.i(74558),j=e.i(83086),w=e.i(86963),b=e.i(56738),S=e.i(4843),k=e.i(1276),N=e.i(17448),L=e.i(30634),A=e.i(47819),I=e.i(64002),C=e.i(15288),T=e.i(19455),H=e.i(24687),z=e.i(10204),P=e.i(56909),D=e.i(31278),$=e.i(86536),F=e.i(85873),F=F,E=e.i(67240),q=e.i(11445),R=e.i(88218),U=e.i(38465),B=e.i(67489),M=e.i(52122),O=e.i(94114);function K({onSubmit:e,defaultNotebookId:a,defaultNotebookName:n,isSaving:r}){let{t:i}=(0,u.useLanguage)(),[o,l]=(0,s.useState)(null),[d,c]=(0,s.useState)(""),[m,g]=(0,s.useState)(""),[x,p]=(0,s.useState)(""),[h,f]=(0,s.useState)(""),[y,j]=(0,s.useState)(""),[w,b]=(0,s.useState)("unknown"),[S,k]=(0,s.useState)([]),[N,L]=(0,s.useState)(a||""),[A,I]=(0,s.useState)(""),[V,_]=(0,s.useState)("a"),Q=async()=>{if(d.trim()){if(!N)return void O.toast.warning(i.editor.messages?.selectNotebook||"请选择错题本");await e({questionText:d.trim(),answerText:m.trim(),analysis:x.trim(),wrongAnswerText:h.trim(),mistakeAnalysis:y.trim(),mistakeStatus:w,knowledgePoints:S,subjectId:N,gradeSemester:A||void 0,paperLevel:V})}},X=e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),d.trim()&&N&&!r&&Q())},Z=[{key:"question",label:i.editor?.question||"题目内容",value:d,setter:c,placeholder:"输入题目内容...\n支持 Markdown 和 LaTeX 公式\n\n示例:\n# 题目一\n\n已知 $f(x) = x^2 + 2x + 1$,求 $f(3)$ 的值。\n\n**解题要求:**\n1. 写出解题步骤\n2. 给出最终答案",minHeight:"min-h-[180px]",required:!0},{key:"answer",label:i.editor?.answer||"参考答案",value:m,setter:g,placeholder:"输入参考答案...\n\n示例:\n$f(3) = 3^2 + 2 \\times 3 + 1 = 9 + 6 + 1 = 16$",minHeight:"min-h-[120px]"},{key:"analysis",label:i.editor?.analysis||"解题分析",value:x,setter:p,placeholder:"输入解题分析...\n\n示例:\n这是一个**一元二次函数**求值问题。\n\n将 $x=3$ 代入函数表达式:\n$$f(3) = 3^2 + 2 \\times 3 + 1 = 16$$",minHeight:"min-h-[150px]"},{key:"wrongAnswer",label:i.editor?.wrongAnswerText||"错误解答原文",value:h,setter:f,placeholder:"如果有错误解答可以粘贴在这里,没有可留空",minHeight:"min-h-[100px]"},{key:"mistakeAnalysis",label:i.editor?.mistakeAnalysis||"错因分析",value:y,setter:j,placeholder:"分析错误可能发生在哪一步、为什么错...",minHeight:"min-h-[100px]"}];return(0,t.jsx)(C.Card,{className:"rounded-2xl",children:(0,t.jsxs)(C.CardContent,{className:"p-6 space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(v.PenLine,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:"直接录入错题内容(支持 Markdown + LaTeX)"})]}),(0,t.jsxs)(T.Button,{variant:"ghost",size:"sm",onClick:()=>{c(""),g(""),p(""),f(""),j(""),b("unknown"),k([]),I(""),_("a")},disabled:r,className:"text-muted-foreground hover:text-destructive",children:[(0,t.jsx)(E.RotateCcw,{className:"h-4 w-4 mr-1"}),"重置"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(z.Label,{children:[i.editor?.selectNotebook||"选择错题本"," *"]}),(0,t.jsx)(U.NotebookSelector,{value:N,onChange:L})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(z.Label,{children:i.editor?.gradeSemester||"年级/学期"}),(0,t.jsx)("input",{type:"text",value:A,onChange:e=>I(e.target.value),placeholder:"如:初二上学期",className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(z.Label,{children:i.editor?.paperLevel||"试卷难度"}),(0,t.jsxs)(B.Select,{value:V,onValueChange:_,children:[(0,t.jsx)(B.SelectTrigger,{children:(0,t.jsx)(B.SelectValue,{})}),(0,t.jsxs)(B.SelectContent,{children:[(0,t.jsx)(B.SelectItem,{value:"a",children:i.editor?.paperLevels?.a||"A卷/基础"}),(0,t.jsx)(B.SelectItem,{value:"b",children:i.editor?.paperLevels?.b||"B卷/提高"}),(0,t.jsx)(B.SelectItem,{value:"other",children:i.editor?.paperLevels?.other||"其他"})]})]})]})]}),Z.map(e=>(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(z.Label,{className:e.required?"text-primary font-semibold":"",children:[e.label," ",e.required&&"*"]}),(0,t.jsx)(T.Button,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>l(o===e.key?null:e.key),disabled:!e.value,children:o===e.key?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(F.default,{className:"h-3 w-3 mr-1"}),"编辑"]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)($.Eye,{className:"h-3 w-3 mr-1"}),"预览"]})})]}),o===e.key?(0,t.jsx)("div",{className:`rounded-md border bg-muted/30 p-4 ${e.minHeight} overflow-auto cursor-pointer`,onClick:()=>l(null),children:(0,t.jsx)(q.MarkdownRenderer,{content:e.value})}):(0,t.jsx)(H.Textarea,{value:e.value,onChange:t=>e.setter(t.target.value),onKeyDown:X,placeholder:e.placeholder,className:`${e.minHeight} font-mono text-sm resize-y`,disabled:r})]},e.key)),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(z.Label,{children:i.editor?.mistakeStatus||"作答状态"}),(0,t.jsxs)(B.Select,{value:w,onValueChange:e=>b(e),children:[(0,t.jsx)(B.SelectTrigger,{className:"w-[200px]",children:(0,t.jsx)(B.SelectValue,{})}),(0,t.jsxs)(B.SelectContent,{children:[(0,t.jsx)(B.SelectItem,{value:"not_attempted",children:i.editor?.mistakeStatuses?.notAttempted||"不会做"}),(0,t.jsx)(B.SelectItem,{value:"wrong_attempt",children:i.editor?.mistakeStatuses?.wrongAttempt||"做错了"}),(0,t.jsx)(B.SelectItem,{value:"unknown",children:i.editor?.mistakeStatuses?.unknown||"未判断"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(z.Label,{children:i.editor?.tags||"知识点标签"}),(0,t.jsx)(R.TagInput,{value:S,onChange:k,placeholder:i.editor?.tagsPlaceholder||"输入知识点标签...",enterHint:i.editor?.createTagHint,subject:(0,M.inferSubjectFromName)(n||null)||void 0}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i.editor?.tagsHint||"💡 输入时会自动匹配已有标签"})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 pt-2",children:[(0,t.jsx)(T.Button,{onClick:Q,disabled:!d.trim()||!N||r,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",size:"lg",children:r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"保存中..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.Save,{className:"mr-2 h-4 w-4"}),"直接保存"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:"填写题目和答案后直接保存,无需 AI 分析 · Ctrl+Enter 快捷保存"})]})]})})}function V(){let[e,o]=(0,s.useState)("upload"),[l,d]=(0,s.useState)("idle"),[c,m]=(0,s.useState)(null),[g,w]=(0,s.useState)(null),{t:C,language:T}=(0,u.useLanguage)();(0,h.usePageTitle)(C.pageTitle.home);let H=(0,a.useSearchParams)(),z=(0,a.useRouter)(),P=H.get("notebook"),[D,$]=(0,s.useState)([]),[F,E]=(0,s.useState)(null),[q,R]=(0,s.useState)(null),[U,B]=(0,s.useState)("image"),[M,V]=(0,s.useState)(null),[_,Q]=(0,s.useState)(!1),[X,Z]=(0,s.useState)(!1),[J,G]=(0,s.useState)(null),[W,Y]=(0,s.useState)(null),ee=q?.timeouts?.analyze||18e4,et=ee+1e4;(0,s.useEffect)(()=>()=>{M&&URL.revokeObjectURL(M)},[M]),(0,s.useEffect)(()=>{p.apiClient.get("/api/notebooks").then(e=>$(e)).catch(e=>console.error("Failed to fetch notebooks:",e)),(0,I.fetchConfirmBeforeImport)().then(Z),p.apiClient.get("/api/settings").then(e=>{R(e),e.timeouts?.analyze&&k.frontendLogger.info("[Config]","Loaded timeout settings",{analyze:e.timeouts.analyze})}).catch(e=>console.error("Failed to fetch config:",e))},[]),(0,s.useEffect)(()=>{if("idle"===l)return;let e=setTimeout(()=>{k.frontendLogger.warn("[Progress]","处理超时,关闭进度提示",{analysisStep:l,safetyTimeout:et}),d("idle")},et);return()=>clearTimeout(e)},[l,et]);let es=async e=>{Q(!1),ea(new File([e],"cropped-image.jpg",{type:"image/jpeg"}))},ea=async e=>{let t=Date.now();k.frontendLogger.info("[HomeAnalyze]","Starting analysis flow",{timeoutSettings:{apiTimeout:ee,safetyTimeout:et}});try{k.frontendLogger.info("[HomeAnalyze]","Step 1/5: Compressing image"),d("compressing");let s=await (0,f.processImageFile)(e);w(s),k.frontendLogger.info("[HomeAnalyze]","Image compressed successfully",{size:s.length}),k.frontendLogger.info("[HomeAnalyze]","Step 2/5: Calling API endpoint /api/analyze"),d("analyzing");let a=Date.now(),n=await p.apiClient.post("/api/analyze",{imageBase64:s,language:T,subjectId:P||F||void 0},{timeout:ee}),r=Date.now()-a;if(k.frontendLogger.info("[HomeAnalyze]","API response received, validating data",{apiDuration:r}),!n||"object"!=typeof n)throw k.frontendLogger.error("[HomeAnalyze]","Validation failed - invalid response data",{data:n}),Error("Invalid API response: data is null or not an object");if(k.frontendLogger.info("[HomeAnalyze]","Response data validated successfully"),k.frontendLogger.info("[HomeAnalyze]","开始处理 AI 返回结果"),d("processing"),!X){d("saving");let e=await (0,I.saveParsedQuestion)(n,{subjectId:P,imageUrl:s});G(e),w(null),k.frontendLogger.info("[HomeAnalyze]","Imported without review",{id:e.id});return}k.frontendLogger.info("[HomeAnalyze]","Step 4/5: Setting parsed data and auto-selecting notebook");let i=JSON.stringify(n).length;if(n.subject){let e=D.find(e=>e.name.includes(n.subject)||n.subject.includes(e.name));e&&(E(e.id),k.frontendLogger.info("[HomeAnalyze]","Auto-selected notebook",{notebook:e.name,subject:n.subject}))}let l=Date.now();m(n);let c=Date.now()-l;k.frontendLogger.info("[HomeAnalyze]","Parsed data set successfully",{dataSize:i,setDataDuration:c}),k.frontendLogger.info("[HomeAnalyze]","Step 5/5: Switching to review page");let u=Date.now();o("review");let g=Date.now()-u;k.frontendLogger.info("[HomeAnalyze]","Step switched to review",{setStepDuration:g});let x=Date.now()-t;k.frontendLogger.info("[HomeAnalyze]","Analysis completed successfully",{totalDuration:x})}catch(s){let e=Date.now()-t;k.frontendLogger.error("[HomeError]","Analysis failed",{errorDuration:e,error:s.message||String(s)});try{let e=C.common?.messages?.analysisFailed||"Analysis failed, please try again",t=s?.data?.message;if(t&&"string"==typeof t)if(C.errors&&"object"==typeof C.errors&&t in C.errors){let s=C.errors[t];"string"==typeof s&&(e=s,k.frontendLogger.info("[HomeError]",`Matched error type: ${t}`,{errorMessage:e}))}else e=t,k.frontendLogger.info("[HomeError]","Using backend error message",{errorMessage:e});else s?.message&&(s.message.includes("fetch")||s.message.includes("network")?e=C.errors?.AI_CONNECTION_FAILED||"网络连接失败":"string"==typeof s.data&&(k.frontendLogger.info("[HomeError]","Raw error data",{errorDataPreview:s.data.substring(0,100)}),e+=` (${s.status||"Error"})`));O.toast.error(e)}catch(e){k.frontendLogger.error("[HomeError]","Failed to process error message",{innerError:String(e)}),O.toast.error("Analysis failed. Please try again.")}}finally{k.frontendLogger.info("[HomeAnalyze]","Finally: Resetting analysis state to idle"),d("idle"),k.frontendLogger.info("[HomeAnalyze]","Analysis state reset complete")}},en=async e=>{k.frontendLogger.info("[HomeSave]","Starting save process",{hasQuestionText:!!e.questionText,hasAnswerText:!!e.answerText,subjectId:e.subjectId,knowledgePointsCount:e.knowledgePoints?.length||0,hasImage:!!g,imageSize:g?.length||0});try{let t=await p.apiClient.post("/api/error-items",{...e,originalImageUrl:g||""});t.duplicate&&k.frontendLogger.info("[HomeSave]","Duplicate submission detected, using existing record"),k.frontendLogger.info("[HomeSave]","Save successful"),o("upload"),m(null),w(null),O.toast.success(t.duplicate?C.importFlow.duplicate:C.common.messages.saveSuccess),t.duplicate?z.push(`/error-items/${t.id}`):e.subjectId&&z.push(`/notebooks/${e.subjectId}`)}catch(e){k.frontendLogger.error("[HomeSave]","Save failed",{errorStatus:e?.status,errorMessage:e?.data?.message||e?.message||String(e),errorData:e?.data}),O.toast.error(C.common?.messages?.saveFailed||"Failed to save")}},er=async e=>{let t=Date.now();k.frontendLogger.info("[HomeTextSubmit]","Starting text-based analysis",{textLength:e.length});try{d("analyzing");let s=P||F,a=s?D.find(e=>e.id===s):void 0,n=await p.apiClient.post("/api/reanswer",{questionText:e,language:T,subject:a?.name||void 0,subjectId:a?.id},{timeout:ee});d("processing");let r={questionText:e,answerText:n.answerText,analysis:n.analysis,knowledgePoints:n.knowledgePoints||[],wrongAnswerText:n.wrongAnswerText||"",mistakeAnalysis:n.mistakeAnalysis||"",mistakeStatus:n.mistakeStatus||"unknown",subject:n.subject||"其他",requiresImage:!1,difficultyStars:n.difficultyStars??null};if(!X){d("saving");let e=await (0,I.saveParsedQuestion)(r,{subjectId:P,imageUrl:null});G(e);return}w(null),m(r),o("review");let i=Date.now()-t;k.frontendLogger.info("[HomeTextSubmit]","Text analysis completed",{totalDuration:i})}catch(s){let e=Date.now()-t;k.frontendLogger.error("[HomeTextSubmit]","Analysis failed",{errorDuration:e,error:s.message||String(s)});try{let e=C.common?.messages?.analysisFailed||"Analysis failed, please try again",t=s?.data?.message;if(t&&"string"==typeof t)if(C.errors&&"object"==typeof C.errors&&t in C.errors){let s=C.errors[t];"string"==typeof s&&(e=s)}else e=t;O.toast.error(e)}catch{O.toast.error("Analysis failed. Please try again.")}}finally{d("idle")}},ei=async e=>{k.frontendLogger.info("[HomeDirectSave]","Starting direct save",{hasQuestionText:!!e.questionText,hasAnswerText:!!e.answerText,subjectId:e.subjectId});try{d("saving");let t=await p.apiClient.post("/api/error-items",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis,wrongAnswerText:e.wrongAnswerText||null,mistakeAnalysis:e.mistakeAnalysis||null,mistakeStatus:e.mistakeStatus||"unknown",knowledgePoints:e.knowledgePoints,subjectId:e.subjectId,gradeSemester:e.gradeSemester,paperLevel:e.paperLevel,originalImageUrl:""});t.duplicate&&k.frontendLogger.info("[HomeDirectSave]","Duplicate detected"),k.frontendLogger.info("[HomeDirectSave]","Save successful"),d("idle"),O.toast.success(t.duplicate?C.importFlow.duplicate:C.common.messages.saveSuccess),t.duplicate?z.push(`/error-items/${t.id}`):e.subjectId&&z.push(`/notebooks/${e.subjectId}`)}catch(e){k.frontendLogger.error("[HomeDirectSave]","Save failed",{errorStatus:e?.status,errorMessage:e?.data?.message||e?.message||String(e)}),d("idle"),O.toast.error(C.common?.messages?.saveFailed||"Failed to save")}},eo=P||F,el=eo?D.find(e=>e.id===eo)?.name:void 0,ed=D.reduce((e,t)=>e+(t._count?.errorItems||0),0),ec=[{value:"image",icon:y.Camera,label:C.app?.uploadImage||"拍照上传"},{value:"text",icon:j.Sparkles,label:C.app?.manualInput||"AI解题"},{value:"direct",icon:v.PenLine,label:C.app?.directInput||"直接录入"}];return(0,t.jsxs)("main",{className:"min-h-screen",children:[(0,t.jsx)(b.ProgressFeedback,{status:l}),(0,t.jsxs)("div",{className:`mx-auto space-y-6 px-4 py-6 md:px-8 md:py-8 ${"review"===e?"max-w-6xl":"max-w-4xl"}`,children:["upload"===e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x,{notebookCount:D.length,itemCount:ed,targetNotebook:P?el:void 0}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(S.SegmentedControl,{options:ec,value:U,onChange:B}),J&&(0,t.jsx)(L.ImportResultBanner,{imported:J,onDismiss:()=>G(null)}),W?(0,t.jsx)(A.BatchImportPanel,{blobs:W,subjectId:P,timeout:ee,onClose:()=>Y(null)}):"image"===U?(0,t.jsx)(n.UploadZone,{onImageSelect:e=>{G(null),V(URL.createObjectURL(e)),Q(!0)},isAnalyzing:"idle"!==l}):"text"===U?(0,t.jsx)(N.TextInputZone,{onSubmit:er,isAnalyzing:"idle"!==l,defaultNotebookName:el}):(0,t.jsx)(K,{onSubmit:ei,defaultNotebookId:eo||void 0,defaultNotebookName:el,isSaving:"saving"===l})]})]}),M&&(0,t.jsx)(i.ImageCropper,{imageSrc:M,open:_,onClose:()=>Q(!1),onCropComplete:es,onMultiCropComplete:e=>{Q(!1),G(null),Y(e)}}),"review"===e&&c&&(0,t.jsx)(r.CorrectionEditor,{initialData:c,onSave:en,onCancel:()=>o("upload"),imagePreview:g,initialSubjectId:P||F||void 0,aiTimeout:ee})]})]})}e.s(["default",0,function(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)(w.PageLoading,{}),children:(0,t.jsx)(V,{})})}],52683)},86963,e=>{"use strict";var t=e.i(18050),s=e.i(31278);e.s(["PageLoading",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)(s.Loader2,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])}]);