wrong-notebook 2026.10.25 → 2026.10.29-1

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 (448) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +2 -0
  3. package/.next/build-manifest.json +54 -43
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +12 -0
  6. package/.next/server/app/_global-error/page/build-manifest.json +3 -3
  7. package/.next/server/app/_global-error.html +1 -1
  8. package/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found/page/build-manifest.json +3 -3
  13. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/admin/page/build-manifest.json +3 -3
  16. package/.next/server/app/admin/page.js.nft.json +1 -1
  17. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/admin/user/[id]/page/build-manifest.json +3 -3
  19. package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
  20. package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/admin/dashboard/route.js +3 -3
  22. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  23. package/.next/server/app/api/admin/migrate-tags/route.js +1 -1
  24. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  25. package/.next/server/app/api/admin/system-reset/route.js +1 -1
  26. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  27. package/.next/server/app/api/admin/users/[id]/detail/route.js +3 -3
  28. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  29. package/.next/server/app/api/admin/users/[id]/route.js +1 -1
  30. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  31. package/.next/server/app/api/admin/users/route.js +1 -1
  32. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  33. package/.next/server/app/api/ai/models/route.js +2 -2
  34. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  35. package/.next/server/app/api/ai/test/route.js +3 -3
  36. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  37. package/.next/server/app/api/analytics/route.js +12 -3
  38. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  39. package/.next/server/app/api/analyze/route.js +3 -3
  40. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  41. package/.next/server/app/api/auth/[...nextauth]/route.js +1 -1
  42. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  43. package/.next/server/app/api/error-items/[id]/delete/route.js +1 -1
  44. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  45. package/.next/server/app/api/error-items/[id]/figure/route.js +3 -3
  46. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  47. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +3 -3
  48. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  49. package/.next/server/app/api/error-items/[id]/geogebra/route.js +3 -3
  50. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  51. package/.next/server/app/api/error-items/[id]/image/route.js +1 -1
  52. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  53. package/.next/server/app/api/error-items/[id]/notes/route.js +1 -1
  54. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  55. package/.next/server/app/api/error-items/[id]/practice-records/route.js +1 -1
  56. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  57. package/.next/server/app/api/error-items/[id]/reanswer/route.js +3 -3
  58. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  59. package/.next/server/app/api/error-items/[id]/retag/route.js +3 -3
  60. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  61. package/.next/server/app/api/error-items/[id]/route.js +1 -1
  62. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  63. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +3 -3
  64. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  65. package/.next/server/app/api/error-items/batch-delete/route.js +1 -1
  66. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  67. package/.next/server/app/api/error-items/clear/route.js +1 -1
  68. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  69. package/.next/server/app/api/error-items/list/route.js +2 -2
  70. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  71. package/.next/server/app/api/error-items/route.js +4 -4
  72. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  73. package/.next/server/app/api/error-items/short/[shortId]/route.js +1 -1
  74. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  75. package/.next/server/app/api/error-items/similarity/route.js +1 -1
  76. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  77. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +14 -13
  78. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  79. package/.next/server/app/api/exams/[id]/results/route.js +6 -6
  80. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  81. package/.next/server/app/api/exams/[id]/retry/route.js +14 -13
  82. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  83. package/.next/server/app/api/exams/[id]/route.js +12 -11
  84. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  85. package/.next/server/app/api/exams/route.js +10 -9
  86. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  87. package/.next/server/app/api/export/route.js +1 -1
  88. package/.next/server/app/api/export/route.js.nft.json +1 -1
  89. package/.next/server/app/api/geogebra-analyze/route.js +3 -3
  90. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  91. package/.next/server/app/api/health/route.js.nft.json +1 -1
  92. package/.next/server/app/api/import/route.js +9 -9
  93. package/.next/server/app/api/import/route.js.nft.json +1 -1
  94. package/.next/server/app/api/logs/frontend/route.js +1 -1
  95. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  96. package/.next/server/app/api/minimax-code/checkin/route.js +1 -1
  97. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  98. package/.next/server/app/api/minimax-code/login/route.js +1 -1
  99. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  100. package/.next/server/app/api/minimax-code/route.js +1 -1
  101. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  102. package/.next/server/app/api/notebooks/[id]/retag/route.js +3 -3
  103. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  104. package/.next/server/app/api/notebooks/[id]/route.js +1 -1
  105. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  106. package/.next/server/app/api/notebooks/route.js +1 -1
  107. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  108. package/.next/server/app/api/openclaw/batch-upload/route.js +9 -9
  109. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  110. package/.next/server/app/api/practice/generate/route.js +3 -3
  111. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  112. package/.next/server/app/api/practice/grade/route.js +3 -3
  113. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  114. package/.next/server/app/api/practice/record/[id]/route.js +3 -3
  115. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  116. package/.next/server/app/api/practice/record/route.js +3 -3
  117. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  118. package/.next/server/app/api/reanswer/route.js +3 -3
  119. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  120. package/.next/server/app/api/register/route.js.nft.json +1 -1
  121. package/.next/server/app/api/review/due/route.js +15 -6
  122. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  123. package/.next/server/app/api/settings/route.js +1 -1
  124. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  125. package/.next/server/app/api/setup/route/app-paths-manifest.json +3 -0
  126. package/.next/server/app/api/setup/route/build-manifest.json +12 -0
  127. package/.next/server/app/api/setup/route/server-reference-manifest.json +4 -0
  128. package/.next/server/app/api/setup/route.js +13 -0
  129. package/.next/server/app/api/setup/route.js.map +5 -0
  130. package/.next/server/app/api/setup/route.js.nft.json +1 -0
  131. package/.next/server/app/api/setup/route_client-reference-manifest.js +3 -0
  132. package/.next/server/app/api/stats/practice/clear/route.js +1 -1
  133. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  134. package/.next/server/app/api/stats/practice/route.js +1 -1
  135. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  136. package/.next/server/app/api/tags/route.js +1 -1
  137. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  138. package/.next/server/app/api/tags/stats/route.js +1 -1
  139. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  140. package/.next/server/app/api/tags/suggestions/route.js +1 -1
  141. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  142. package/.next/server/app/api/tasks/route.js +1 -1
  143. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  144. package/.next/server/app/api/user/route.js +14 -4
  145. package/.next/server/app/api/user/route.js.nft.json +1 -1
  146. package/.next/server/app/error-items/[id]/page/build-manifest.json +3 -3
  147. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  148. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  149. package/.next/server/app/exams/[id]/page/build-manifest.json +3 -3
  150. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  151. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  152. package/.next/server/app/exams/[id]/print/page/build-manifest.json +3 -3
  153. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  154. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  155. package/.next/server/app/exams/page/build-manifest.json +3 -3
  156. package/.next/server/app/exams/page.js.nft.json +1 -1
  157. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  158. package/.next/server/app/login/page/build-manifest.json +3 -3
  159. package/.next/server/app/login/page.js.nft.json +1 -1
  160. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  161. package/.next/server/app/notebooks/[id]/add/page/build-manifest.json +3 -3
  162. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  163. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  164. package/.next/server/app/notebooks/[id]/page/build-manifest.json +3 -3
  165. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  166. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  167. package/.next/server/app/notebooks/page/build-manifest.json +3 -3
  168. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  169. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  170. package/.next/server/app/page/build-manifest.json +3 -3
  171. package/.next/server/app/page.js.nft.json +1 -1
  172. package/.next/server/app/page_client-reference-manifest.js +1 -1
  173. package/.next/server/app/practice/page/build-manifest.json +3 -3
  174. package/.next/server/app/practice/page.js.nft.json +1 -1
  175. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  176. package/.next/server/app/print-preview/page/build-manifest.json +3 -3
  177. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  178. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  179. package/.next/server/app/register/page/build-manifest.json +3 -3
  180. package/.next/server/app/register/page.js.nft.json +1 -1
  181. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  182. package/.next/server/app/review/page/build-manifest.json +3 -3
  183. package/.next/server/app/review/page.js.nft.json +1 -1
  184. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  185. package/.next/server/app/setup/page/app-paths-manifest.json +3 -0
  186. package/.next/server/app/setup/page/build-manifest.json +22 -0
  187. package/.next/server/app/setup/page/next-font-manifest.json +11 -0
  188. package/.next/server/app/setup/page/react-loadable-manifest.json +1 -0
  189. package/.next/server/app/setup/page/server-reference-manifest.json +4 -0
  190. package/.next/server/app/setup/page.js +14 -0
  191. package/.next/server/app/setup/page.js.map +5 -0
  192. package/.next/server/app/setup/page.js.nft.json +1 -0
  193. package/.next/server/app/setup/page_client-reference-manifest.js +3 -0
  194. package/.next/server/app/stats/page/build-manifest.json +3 -3
  195. package/.next/server/app/stats/page.js.nft.json +1 -1
  196. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  197. package/.next/server/app/tags/page/build-manifest.json +3 -3
  198. package/.next/server/app/tags/page.js +2 -1
  199. package/.next/server/app/tags/page.js.nft.json +1 -1
  200. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  201. package/.next/server/app-paths-manifest.json +2 -0
  202. package/.next/server/chunks/{[root-of-the-server]__0-12_rul4y06m._.js → [root-of-the-server]__0-je7m4evwez4._.js} +1 -1
  203. package/.next/server/chunks/{[root-of-the-server]__05-dvjb11wbvo._.js → [root-of-the-server]__015ejcb8twm6c._.js} +1 -1
  204. package/.next/server/chunks/{[root-of-the-server]__0rbh_oqaajxmo._.js → [root-of-the-server]__03g_n15zojhn2._.js} +2 -2
  205. package/.next/server/chunks/{[root-of-the-server]__0-lanxvfyc5w7._.js → [root-of-the-server]__04jqbxsugsx8b._.js} +1 -1
  206. package/.next/server/chunks/{[root-of-the-server]__1g2qwf_mnzqly._.js → [root-of-the-server]__04vkejt7399qm._.js} +2 -2
  207. package/.next/server/chunks/{[root-of-the-server]__0jb_3-yu-o6ms._.js → [root-of-the-server]__05d1rfm7p02tv._.js} +2 -2
  208. package/.next/server/chunks/{[root-of-the-server]__0b3ss-8ztcftu._.js → [root-of-the-server]__067bnq3j3z-3_._.js} +1 -1
  209. package/.next/server/chunks/[root-of-the-server]__09944y8f_7dhf._.js +3 -0
  210. package/.next/server/chunks/{[root-of-the-server]__023qntqk9nbma._.js → [root-of-the-server]__0a62guogezjl6._.js} +2 -2
  211. package/.next/server/chunks/[root-of-the-server]__0aequ2pnoemzu._.js +3 -0
  212. package/.next/server/chunks/[root-of-the-server]__0axigtqmxeqri._.js +3 -0
  213. package/.next/server/chunks/[root-of-the-server]__0e7_0-o90esy-._.js +3 -0
  214. package/.next/server/chunks/{[root-of-the-server]__0nj600_104dqn._.js → [root-of-the-server]__0f505ene-6a0j._.js} +2 -2
  215. package/.next/server/chunks/{[root-of-the-server]__0zr9l7lnr1i0l._.js → [root-of-the-server]__0gql12o_mf7e8._.js} +2 -2
  216. package/.next/server/chunks/{[root-of-the-server]__0-jhvuvprdrmu._.js → [root-of-the-server]__0lt6zgk4xq6fk._.js} +2 -2
  217. package/.next/server/chunks/[root-of-the-server]__0msiy_bvtvaqo._.js +3 -0
  218. package/.next/server/chunks/{[root-of-the-server]__1-9hu4j35d9ao._.js → [root-of-the-server]__0of1031_q21po._.js} +1 -1
  219. package/.next/server/chunks/[root-of-the-server]__0p6a773hclr9v._.js +3 -0
  220. package/.next/server/chunks/{[root-of-the-server]__0zjg773epx4r_._.js → [root-of-the-server]__0qo744v4hy8lp._.js} +1 -1
  221. package/.next/server/chunks/[root-of-the-server]__0ugdj4xtzfkaa._.js +3 -0
  222. package/.next/server/chunks/[root-of-the-server]__0ul_64h5yov45._.js +3 -0
  223. package/.next/server/chunks/[root-of-the-server]__0uwpcliduox5r._.js +3 -0
  224. package/.next/server/chunks/{[root-of-the-server]__0ayraoa4xz-qt._.js → [root-of-the-server]__0uzkv_2-76muc._.js} +2 -2
  225. package/.next/server/chunks/{[root-of-the-server]__1imiyrtb6t6zp._.js → [root-of-the-server]__0v0mt3v8gyonn._.js} +2 -2
  226. package/.next/server/chunks/[root-of-the-server]__0vqoda1k-uvtz._.js +3 -0
  227. package/.next/server/chunks/{[root-of-the-server]__20i0-g_8_okaf._.js → [root-of-the-server]__0vqtidz1lisc6._.js} +2 -2
  228. package/.next/server/chunks/{[root-of-the-server]__0q_db5a74evdw._.js → [root-of-the-server]__0wm4qw5cu0956._.js} +1 -1
  229. package/.next/server/chunks/{[root-of-the-server]__1ya630gfyks-f._.js → [root-of-the-server]__0y48od_b_qxct._.js} +2 -2
  230. package/.next/server/chunks/[root-of-the-server]__0zxrtk19v5vnf._.js +3 -0
  231. package/.next/server/chunks/[root-of-the-server]__0zxxkvf-ns40a._.js +3 -0
  232. package/.next/server/chunks/[root-of-the-server]__1-i5zhzxr_18g._.js +3 -0
  233. package/.next/server/chunks/[root-of-the-server]__10_vi76_sexvg._.js +3 -0
  234. package/.next/server/chunks/[root-of-the-server]__10lamgabz68ix._.js +3 -0
  235. package/.next/server/chunks/[root-of-the-server]__10ncpx-zqhwkz._.js +3 -0
  236. package/.next/server/chunks/{[root-of-the-server]__03nsgjsm70ted._.js → [root-of-the-server]__118rtr0shk1ii._.js} +2 -2
  237. package/.next/server/chunks/[root-of-the-server]__11nevdba2vhtt._.js +3 -0
  238. package/.next/server/chunks/[root-of-the-server]__120v9prxhhv-r._.js +3 -0
  239. package/.next/server/chunks/{[root-of-the-server]__03rln5n_21ad0._.js → [root-of-the-server]__17aiova74blq9._.js} +2 -2
  240. package/.next/server/chunks/[root-of-the-server]__18afyxml-gm3x._.js +3 -0
  241. package/.next/server/chunks/{[root-of-the-server]__0my6t3vz24mmo._.js → [root-of-the-server]__1930xo407ogqu._.js} +2 -2
  242. package/.next/server/chunks/{[root-of-the-server]__1jhz19cuxjpmb._.js → [root-of-the-server]__1_8btngjew64q._.js} +1 -1
  243. package/.next/server/chunks/[root-of-the-server]__1bvjyahgm4s-0._.js +1 -1
  244. package/.next/server/chunks/[root-of-the-server]__1d39wr4nvawz9._.js +3 -0
  245. package/.next/server/chunks/[root-of-the-server]__1d69wiqapuvpg._.js +3 -0
  246. package/.next/server/chunks/[root-of-the-server]__1e5_zprqk0ss2._.js +3 -0
  247. package/.next/server/chunks/[root-of-the-server]__1exrwdj9xu3yd._.js +3 -0
  248. package/.next/server/chunks/[root-of-the-server]__1gyn69y2kixvz._.js +3 -0
  249. package/.next/server/chunks/{[root-of-the-server]__12tt2pf5nuueu._.js → [root-of-the-server]__1hrdz_-5s3775._.js} +2 -2
  250. package/.next/server/chunks/[root-of-the-server]__1lbtlpnl59fx4._.js +3 -0
  251. package/.next/server/chunks/[root-of-the-server]__1lkrb23gahy9p._.js +3 -0
  252. package/.next/server/chunks/{[root-of-the-server]__0qb8n1h-am-es._.js → [root-of-the-server]__1mw7gimyq75e7._.js} +2 -2
  253. package/.next/server/chunks/[root-of-the-server]__1nrc0f_1unz0b._.js +3 -0
  254. package/.next/server/chunks/{[root-of-the-server]__1-302_px1h0qz._.js → [root-of-the-server]__1pfiautl3zc2f._.js} +2 -2
  255. package/.next/server/chunks/[root-of-the-server]__1q-qp9_6drnjc._.js +3 -0
  256. package/.next/server/chunks/[root-of-the-server]__1uamx3r_5niri._.js +3 -0
  257. package/.next/server/chunks/[root-of-the-server]__1ubqs9ptth-gi._.js +3 -0
  258. package/.next/server/chunks/{[root-of-the-server]__0icc6dvauvb15._.js → [root-of-the-server]__1wjrhbs_gcrzx._.js} +2 -2
  259. package/.next/server/chunks/[root-of-the-server]__1wvpsikw739ko._.js +3 -0
  260. package/.next/server/chunks/[root-of-the-server]__1yribihoxvucv._.js +3 -0
  261. package/.next/server/chunks/[root-of-the-server]__1zir6sprvzk4t._.js +3 -0
  262. package/.next/server/chunks/[root-of-the-server]__1zt-23c4kv6ca._.js +3 -0
  263. package/.next/server/chunks/{[root-of-the-server]__0brc9a9ftklux._.js → [root-of-the-server]__20qx2tzclhhfh._.js} +1 -1
  264. package/.next/server/chunks/_0-ne-bwuvd_6w._.js +1 -1
  265. package/.next/server/chunks/_09o9zamz75n5d._.js +3 -0
  266. package/.next/server/chunks/_0_rhee7wb6tcg._.js +3 -0
  267. package/.next/server/chunks/_0gxi3zrkhyvx_._.js +1 -1
  268. package/.next/server/chunks/{_0ekrwj-qx_6uh._.js → _0q-x4ftphyse4._.js} +2 -2
  269. package/.next/server/chunks/_0tz5wpjdgntj3._.js +1 -1
  270. package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
  271. package/.next/server/chunks/_1_273cgnpyl9j._.js +1 -1
  272. package/.next/server/chunks/_1_ns7o3cqznv6._.js +1 -1
  273. package/.next/server/chunks/{_0x3ltk09eli_f._.js → _1btq785jvvco6._.js} +2 -2
  274. package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
  275. package/.next/server/chunks/_next-internal_server_app_api_setup_route_actions_0txsuev7wlgqs.js +3 -0
  276. package/.next/server/chunks/src_lib_15kwif87cuv22._.js +1 -1
  277. package/.next/server/chunks/src_lib_1k0xki4wmn54_._.js +1 -1
  278. package/.next/server/chunks/src_lib_1wm8ay-jqxakc._.js +1 -1
  279. package/.next/server/chunks/src_lib_exam_ts_0d3a4q4r41hcf._.js +1 -1
  280. package/.next/server/chunks/src_lib_mastery_ts_0ybi94uxn8ut6._.js +1 -1
  281. package/.next/server/chunks/ssr/[root-of-the-server]__05d1gc-h-sk6z._.js +3 -0
  282. package/.next/server/chunks/ssr/[root-of-the-server]__06cr_rl6w07mf._.js +3 -0
  283. package/.next/server/chunks/ssr/[root-of-the-server]__0d-q1qjhzf_nt._.js +3 -0
  284. package/.next/server/chunks/ssr/{[root-of-the-server]__1b9f3v7g4ocyf._.js → [root-of-the-server]__0wbg4fz5qe7h-._.js} +1 -1
  285. package/.next/server/chunks/ssr/[root-of-the-server]__14c291vzuew0p._.js +3 -0
  286. package/.next/server/chunks/ssr/[root-of-the-server]__1_zton0k4t3va._.js +3 -0
  287. package/.next/server/chunks/ssr/[root-of-the-server]__1kh02fdj3kar7._.js +3 -0
  288. package/.next/server/chunks/ssr/{[root-of-the-server]__1xfc5gf4weasu._.js → [root-of-the-server]__1zh2txrawxztj._.js} +1 -1
  289. package/.next/server/chunks/ssr/_00np6xqvkg6u-._.js +1 -1
  290. package/.next/server/chunks/ssr/_04ziy8_ak_olr._.js +3 -0
  291. package/.next/server/chunks/ssr/_05alwt3w7oor-._.js +3 -0
  292. package/.next/server/chunks/ssr/_06k5kn4q-1k90._.js +3 -0
  293. package/.next/server/chunks/ssr/_0h6qsip9mphaq._.js +1 -1
  294. package/.next/server/chunks/ssr/_0iy-5lwc8jb9d._.js +3 -0
  295. package/.next/server/chunks/ssr/_0lpyto7r47jl8._.js +3 -0
  296. package/.next/server/chunks/ssr/_0ms6yihjxbuy1._.js +3 -0
  297. package/.next/server/chunks/ssr/_0oksf3a6pbj88._.js +3 -0
  298. package/.next/server/chunks/ssr/{_110r17vqu8gol._.js → _0p61m7hr-1evu._.js} +1 -1
  299. package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
  300. package/.next/server/chunks/ssr/_0trykmkw0cncr._.js +32 -0
  301. package/.next/server/chunks/ssr/{_1-bq77e5afl30._.js → _0vq069p6upfdb._.js} +1 -1
  302. package/.next/server/chunks/ssr/{_1f1l6ubybak3a._.js → _0z-gzl29_yrkq._.js} +2 -2
  303. package/.next/server/chunks/ssr/{_1prnv9r-jt4dy._.js → _10gxtgntt3mjd._.js} +1 -1
  304. package/.next/server/chunks/ssr/_11xqn1cgzpe6k._.js +3 -0
  305. package/.next/server/chunks/ssr/_1g8mzz6qxv2mr._.js +1 -1
  306. package/.next/server/chunks/ssr/_1gjb-bqi25yci._.js +3 -0
  307. package/.next/server/chunks/ssr/_1mw-oovvzrn8_._.js +3 -0
  308. package/.next/server/chunks/ssr/_1tg3c_6clbzhd._.js +3 -0
  309. package/.next/server/chunks/ssr/_next-internal_server_app_setup_page_actions_0u1sm0sllb5ji.js +3 -0
  310. package/.next/server/chunks/ssr/node_modules_004qzwkmt-_w5._.js +3 -0
  311. package/.next/server/chunks/ssr/{node_modules_@radix-ui_0jungqz8-8rpt._.js → node_modules_00hekemtvh207._.js} +2 -2
  312. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0th0mlz3ys-17._.js +3 -0
  313. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1tz6jn4lbq7wr._.js +3 -0
  314. package/.next/server/chunks/ssr/{node_modules_next_dist_0ufsi7bhcumza._.js → node_modules_next_dist_0rsvep-qefr2x._.js} +2 -2
  315. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1a9z9hjfg293y.js +3 -0
  316. package/.next/server/chunks/ssr/src_0_rgx1hl-1b6i._.js +3 -0
  317. package/.next/server/chunks/ssr/src_0av4wv_56wg9j._.js +3 -0
  318. package/.next/server/chunks/ssr/src_0wxvmqdi_0uno._.js +3 -0
  319. package/.next/server/chunks/ssr/src_13u20tdu4gmgj._.js +1 -1
  320. package/.next/server/chunks/ssr/src_1jhctayt9gxoc._.js +3 -0
  321. package/.next/server/chunks/ssr/src_app_exams_[id]_page_tsx_0xcjflkgkwzgd._.js +1 -1
  322. package/.next/server/chunks/ssr/src_app_exams_page_tsx_17_d4_gy2i1ds._.js +1 -1
  323. package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
  324. package/.next/server/chunks/ssr/src_app_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
  325. package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
  326. package/.next/server/chunks/ssr/src_app_setup_page_tsx_0szlnxow_9skp._.js +3 -0
  327. package/.next/server/chunks/ssr/src_components_04xv7f-d7_fyc._.js +3 -0
  328. package/.next/server/chunks/ssr/src_components_1lbiuzxejiwvf._.js +3 -0
  329. package/.next/server/chunks/ssr/src_components_create-notebook-dialog_tsx_0c5teagim70r7._.js +3 -0
  330. package/.next/server/chunks/ssr/src_components_error-list_error-item-card_tsx_1zsiqsrj-jjd7._.js +1 -1
  331. package/.next/server/chunks/ssr/src_components_mastery-panel_tsx_1--j5c7mhomdp._.js +1 -1
  332. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +10 -10
  333. package/.next/server/edge/chunks/node_modules_0um8zwzayafzq._.js +1 -1
  334. package/.next/server/middleware-build-manifest.js +54 -43
  335. package/.next/server/middleware-manifest.json +5 -5
  336. package/.next/server/next-font-manifest.js +1 -1
  337. package/.next/server/next-font-manifest.json +4 -0
  338. package/.next/server/pages/500.html +1 -1
  339. package/.next/server/preview-props.json +3 -3
  340. package/.next/server/server-reference-manifest.js +1 -1
  341. package/.next/server/server-reference-manifest.json +1 -1
  342. package/.next/static/chunks/02bal925qbinj.js +1 -0
  343. package/.next/static/chunks/0bie9b-vo6ccs.js +1 -0
  344. package/.next/static/chunks/0g5r7y3bbmc-b.js +1 -0
  345. package/.next/static/chunks/{0aqlzwgn78ncm.js → 0p-3zwi9dqdk8.js} +1 -1
  346. package/.next/static/chunks/0r7n8__w9jr5w.js +1 -0
  347. package/.next/static/chunks/0t58h5wfgi75w.js +3 -0
  348. package/.next/static/chunks/0znojfm3iv2d7.js +1 -0
  349. package/.next/static/chunks/{3mb_v650fie_i.js → 1fkaya2t7r343.js} +1 -1
  350. package/.next/static/chunks/1kx-lcqi4aref.js +191 -0
  351. package/.next/static/chunks/1qa6rlj01hnl5.js +1 -0
  352. package/.next/static/chunks/{093w4w_19h9qh.js → 263d57goy87o4.js} +2 -2
  353. package/.next/static/chunks/29cafv3hz5hzj.js +1 -0
  354. package/.next/static/chunks/2h685ie6ojjd6.js +1 -0
  355. package/.next/static/chunks/2q9n-d4_9bhp2.js +1 -0
  356. package/.next/static/chunks/2rgflf9-3s4ud.js +1 -0
  357. package/.next/static/chunks/{2l-1t8-pfq4ph.js → 2t6ygiu56xwkx.js} +1 -1
  358. package/.next/static/chunks/2ucdm1a-llop_.js +1 -0
  359. package/.next/static/chunks/314x1g250-zss.js +1 -0
  360. package/.next/static/chunks/{29m8r4g8_em2g.js → 3icoc8gklzn52.js} +1 -1
  361. package/.next/static/chunks/3jb_u6u63wui6.js +1 -0
  362. package/.next/static/chunks/3tc0l--v631lz.js +1 -0
  363. package/.next/static/chunks/3wxogk-dqqw8w.js +1 -0
  364. package/.next/static/chunks/3zt-rwod7li6h.js +1 -0
  365. package/.next/static/chunks/40q-bbhsqichn.js +1 -0
  366. package/.next/static/chunks/43xs7yzz06q0y.css +3 -0
  367. package/README.md +1 -1
  368. package/bin/wrong-notebook.js +1 -1
  369. package/launcher.js +1 -1
  370. package/package.json +1 -1
  371. package/prisma/migrations/20261029000000_add_mastery_threshold/migration.sql +2 -0
  372. package/prisma/schema.prisma +1 -0
  373. package/prisma/seed.db +0 -0
  374. package/.next/server/chunks/[root-of-the-server]__00l2rz_disfkg._.js +0 -3
  375. package/.next/server/chunks/[root-of-the-server]__0dmllzem7rfag._.js +0 -3
  376. package/.next/server/chunks/[root-of-the-server]__0gx76tnihfcyv._.js +0 -3
  377. package/.next/server/chunks/[root-of-the-server]__0h7igxq4ub38i._.js +0 -3
  378. package/.next/server/chunks/[root-of-the-server]__0jjisfje72sqz._.js +0 -3
  379. package/.next/server/chunks/[root-of-the-server]__0kskkg4ve55lv._.js +0 -3
  380. package/.next/server/chunks/[root-of-the-server]__0mbd9_76yhyaf._.js +0 -3
  381. package/.next/server/chunks/[root-of-the-server]__0q4s9a9wy51vm._.js +0 -3
  382. package/.next/server/chunks/[root-of-the-server]__0u2_q8y9hl1u-._.js +0 -3
  383. package/.next/server/chunks/[root-of-the-server]__0v3k8_i3f2v13._.js +0 -3
  384. package/.next/server/chunks/[root-of-the-server]__0vu6_38lbzxar._.js +0 -3
  385. package/.next/server/chunks/[root-of-the-server]__0wcet8-wl-oad._.js +0 -3
  386. package/.next/server/chunks/[root-of-the-server]__13z5coff9j0sa._.js +0 -3
  387. package/.next/server/chunks/[root-of-the-server]__14n5uude1fj4h._.js +0 -3
  388. package/.next/server/chunks/[root-of-the-server]__17pktht8hd051._.js +0 -3
  389. package/.next/server/chunks/[root-of-the-server]__18lmdddgrhac8._.js +0 -3
  390. package/.next/server/chunks/[root-of-the-server]__199tod2f3vhny._.js +0 -3
  391. package/.next/server/chunks/[root-of-the-server]__1bep0vcwbtlfu._.js +0 -3
  392. package/.next/server/chunks/[root-of-the-server]__1esyxu40fpnyx._.js +0 -3
  393. package/.next/server/chunks/[root-of-the-server]__1iux__qytdtm5._.js +0 -3
  394. package/.next/server/chunks/[root-of-the-server]__1jthkkelxfeb0._.js +0 -3
  395. package/.next/server/chunks/[root-of-the-server]__1k7cmt02s_syx._.js +0 -3
  396. package/.next/server/chunks/[root-of-the-server]__1kvcjw9quzr0w._.js +0 -3
  397. package/.next/server/chunks/[root-of-the-server]__1p08ff3pxle05._.js +0 -3
  398. package/.next/server/chunks/[root-of-the-server]__1rfqipe89aq-u._.js +0 -3
  399. package/.next/server/chunks/[root-of-the-server]__1uscfmw0q-en5._.js +0 -3
  400. package/.next/server/chunks/[root-of-the-server]__1ve3j8ooyhjgv._.js +0 -3
  401. package/.next/server/chunks/[root-of-the-server]__1yslrvk_y61kt._.js +0 -3
  402. package/.next/server/chunks/[root-of-the-server]__1zyka21s1ahtj._.js +0 -3
  403. package/.next/server/chunks/[root-of-the-server]__20sulb1y6n1b8._.js +0 -3
  404. package/.next/server/chunks/_0c25unp5_llaq._.js +0 -3
  405. package/.next/server/chunks/node_modules_zod_v4_classic_external_19886v847zvfd.js +0 -3
  406. package/.next/server/chunks/ssr/[root-of-the-server]__0i73t4kmj3-mp._.js +0 -3
  407. package/.next/server/chunks/ssr/[root-of-the-server]__18i084ru7sq9w._.js +0 -3
  408. package/.next/server/chunks/ssr/[root-of-the-server]__1i2zrji0j2c3l._.js +0 -3
  409. package/.next/server/chunks/ssr/[root-of-the-server]__1upv9f0hlagx7._.js +0 -3
  410. package/.next/server/chunks/ssr/[root-of-the-server]__1urwx866fvhi4._.js +0 -3
  411. package/.next/server/chunks/ssr/_0bsjhzelppbjh._.js +0 -3
  412. package/.next/server/chunks/ssr/_0di9wj37_9zhf._.js +0 -3
  413. package/.next/server/chunks/ssr/_0ng735s0jio00._.js +0 -3
  414. package/.next/server/chunks/ssr/_0t2jed64ec8vu._.js +0 -3
  415. package/.next/server/chunks/ssr/_0uvml2k65e53w._.js +0 -3
  416. package/.next/server/chunks/ssr/_1-sbpqghw1pn7._.js +0 -3
  417. package/.next/server/chunks/ssr/_14d3enlxi54zl._.js +0 -3
  418. package/.next/server/chunks/ssr/_1b9b1aq5b_1sj._.js +0 -3
  419. package/.next/server/chunks/ssr/_1g12ubvpxwe-j._.js +0 -3
  420. package/.next/server/chunks/ssr/_1i0mdte5du0e1._.js +0 -3
  421. package/.next/server/chunks/ssr/node_modules_@radix-ui_0im69oqv_i2ki._.js +0 -3
  422. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1_p6srzucwl-s._.js +0 -3
  423. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1g_su6v6_1gmz._.js +0 -3
  424. package/.next/server/chunks/ssr/src_app_tags_page_tsx_1h2vkk4hv_zlp._.js +0 -3
  425. package/.next/static/chunks/08wadcj8wbdsy.js +0 -1
  426. package/.next/static/chunks/0e7mao0hn_nw4.js +0 -1
  427. package/.next/static/chunks/0pdeh9usti0bj.js +0 -3
  428. package/.next/static/chunks/14a1tth-1ddn-.js +0 -1
  429. package/.next/static/chunks/15e5p9740moee.js +0 -1
  430. package/.next/static/chunks/181--wh89vylg.js +0 -1
  431. package/.next/static/chunks/1_h2h09t_394a.js +0 -1
  432. package/.next/static/chunks/1enxsrqonvvxr.js +0 -1
  433. package/.next/static/chunks/1m3ompn8ev8gr.js +0 -1
  434. package/.next/static/chunks/1nimjc5xqpgag.js +0 -191
  435. package/.next/static/chunks/1v_ioerabkr4s.js +0 -1
  436. package/.next/static/chunks/1wqqkfg03tuu1.js +0 -1
  437. package/.next/static/chunks/2ir3p1tlsazez.js +0 -1
  438. package/.next/static/chunks/2tayqxc443yyh.js +0 -1
  439. package/.next/static/chunks/2v3rvsf6-bnfs.js +0 -1
  440. package/.next/static/chunks/30eew6y-03vg8.js +0 -1
  441. package/.next/static/chunks/32oh815gi42ey.js +0 -1
  442. package/.next/static/chunks/3gvzs1nxarb0s.js +0 -1
  443. package/.next/static/chunks/3r4z_6i5z0hd5.js +0 -1
  444. package/.next/static/chunks/3wm2jhitfeeue.js +0 -1
  445. package/.next/static/chunks/43gsd2ww2f2iy.css +0 -3
  446. /package/.next/static/{5uNP139l0DCSagwPDMOvD → xoHWvK4hz8MHVRTlw1P-_}/_buildManifest.js +0 -0
  447. /package/.next/static/{5uNP139l0DCSagwPDMOvD → xoHWvK4hz8MHVRTlw1P-_}/_clientMiddlewareManifest.js +0 -0
  448. /package/.next/static/{5uNP139l0DCSagwPDMOvD → xoHWvK4hz8MHVRTlw1P-_}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ module.exports=[975766,a=>{"use strict";var b=a.i(612948),c=a.i(167436),d=a.i(594331);a.i(670408);let e=(0,b.instrumentModuleGetter)(()=>a.r(68611)),f=(0,b.instrumentModuleGetter)(()=>a.r(650645)),g=(0,b.instrumentModuleGetter)(()=>a.r(43619)),h=(0,b.instrumentModuleGetter)(()=>a.r(13718)),i=(0,b.instrumentModuleGetter)(()=>a.r(118198)),j=(0,b.instrumentModuleGetter)(()=>a.r(262212)),k=["",{children:["setup",{children:["__PAGE__",{},{metadata:{},page:[(0,b.instrumentModuleGetter)(()=>a.r(359681)),"[project]/src/app/setup/page.tsx"]},[]]},{metadata:{}},[]]},{metadata:{icon:[async()=>{let a=(0,d.interopDefault)(await e());return[{url:`/favicon.ico?${a.src.split("/").splice(-1)[0]}`,sizes:`${a.width}x${a.height}`,type:"image/x-icon"}]}],manifest:"/manifest.webmanifest"},layout:[f,"[project]/src/app/layout.tsx"],"not-found":[g,"[project]/node_modules/next/dist/client/components/builtin/not-found.js"],forbidden:[h,"[project]/node_modules/next/dist/client/components/builtin/forbidden.js"],unauthorized:[i,"[project]/node_modules/next/dist/client/components/builtin/unauthorized.js"],"global-error":[j,"[project]/node_modules/next/dist/client/components/builtin/global-error.js"]},[]],l=a.r.bind(a),m=a.l.bind(a),n=(0,c.f)({tree:k,page:"/setup/page",pathname:"/setup",require:l,loadChunk:m,interopDefault:d.interopDefault}),o=n.__next_app__,p=n.routeModule,q=n.handler;var r=a.i(722922);a.s(["ClientPageRoot",()=>r.ClientPageRoot,"ClientSegmentRoot",()=>r.ClientSegmentRoot,"Fragment",()=>r.Fragment,"HTTPAccessFallbackBoundary",()=>r.HTTPAccessFallbackBoundary,"InstantValidation",()=>r.InstantValidation,"LayoutRouter",()=>r.LayoutRouter,"LoadingBoundaryProvider",()=>r.LoadingBoundaryProvider,"RenderFromTemplateContext",()=>r.RenderFromTemplateContext,"RootLayoutBoundary",()=>r.RootLayoutBoundary,"SegmentViewNode",()=>r.SegmentViewNode,"SegmentViewStateNode",()=>r.SegmentViewStateNode,"__next_app__",0,o,"captureOwnerStack",()=>r.captureOwnerStack,"collectPrefetchHints",()=>r.collectPrefetchHints,"collectSegmentData",()=>r.collectSegmentData,"createElement",()=>r.createElement,"createMetadataComponents",()=>r.createMetadataComponents,"createPrerenderParamsForClientSegment",()=>r.createPrerenderParamsForClientSegment,"createPrerenderSearchParamsForClientPage",()=>r.createPrerenderSearchParamsForClientPage,"createServerParamsForServerSegment",()=>r.createServerParamsForServerSegment,"createServerSearchParamsForServerPage",()=>r.createServerSearchParamsForServerPage,"createTemporaryReferenceSet",()=>r.createTemporaryReferenceSet,"decodeAction",()=>r.decodeAction,"decodeFormState",()=>r.decodeFormState,"decodeReply",()=>r.decodeReply,"handler",0,q,"isEmptyHTMLPrelude",()=>r.isEmptyHTMLPrelude,"patchFetch",()=>r.patchFetch,"preconnect",()=>r.preconnect,"preloadFont",()=>r.preloadFont,"preloadStyle",()=>r.preloadStyle,"prerender",()=>r.prerender,"prerenderToNodeStream",()=>r.prerenderToNodeStream,"renderToPipeableStream",()=>r.renderToPipeableStream,"renderToReadableStream",()=>r.renderToReadableStream,"routeModule",0,p,"serverHooks",()=>r.serverHooks,"taintObjectReference",()=>r.taintObjectReference],975766)}];
2
+
3
+ //# sourceMappingURL=node_modules_next_dist_esm_build_templates_app-page_1a9z9hjfg293y.js.map
@@ -0,0 +1,3 @@
1
+ (()=>{"use strict";module.exports=[468368,723222,a=>{var b=a.i(187924),c=a.i(550194),d=a.i(957292);let e=["primary","junior_high","senior_high"],f="primary",g=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function h(a){return"string"==typeof a&&g.includes(a)}function i(a){var b;let c=h(a.subjectKey)?a.subjectKey:(0,d.f)(a.name);return{stage:"string"==typeof(b=a.stage)&&e.includes(b)?a.stage:f,subject:c&&h(c)?c:null}}function j(){let{t:a}=(0,c.b)();return{stageLabel:b=>({primary:a.auth.primary,junior_high:a.auth.juniorHigh,senior_high:a.auth.seniorHigh})[b],subjectLabel:b=>a.tags.subjects[b]}}a.s(["j",0,f,"c",0,e,"W",0,{primary:["math","english"],junior_high:g,senior_high:g},"v",0,i],723222),a.s(["E",0,function({notebook:a,className:c}){let{stageLabel:d,subjectLabel:e}=j(),f=i(a);return(0,b.jsxs)("span",{className:c,children:[d(f.stage),f.subject?` \xb7 ${e(f.subject)}`:""]})},"O",0,j],468368)},579834,a=>{var b=a.i(187924),c=a.i(368114);a.s(["f",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",g),children:[(0,b.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,b.jsx)(a,{className:"h-7 w-7"})}),(0,b.jsx)("p",{className:"font-medium",children:d}),e&&(0,b.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:e}),f&&(0,b.jsx)("div",{className:"mt-5",children:f})]})}])},506376,a=>{var b=a.i(187924),c=a.i(596221);a.s(["f",0,function({label:a}){return(0,b.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,b.jsx)(c.f,{className:"h-7 w-7 animate-spin text-primary"}),a&&(0,b.jsx)("p",{className:"text-sm",children:a})]})}])},879188,83715,a=>{var b=a.i(291938);async function c(a){try{return(await b.f.get(`/api/error-items/short/${encodeURIComponent(a)}`)).id}catch{return null}}a.s(["f",0,c],879188);let d=RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{6}$");a.s(["f",0,function(a){return"string"==typeof a&&d.test(a)}],83715)}]})();
2
+
3
+ //# sourceMappingURL=src_0_rgx1hl-1b6i._.js.map
@@ -0,0 +1,3 @@
1
+ (()=>{"use strict";module.exports=[591119,a=>{var b=a.i(187924),c=a.i(368114);a.s(["N",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card",className:(0,c.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",a),...d})},"O",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-content",className:(0,c.f)("px-6",a),...d})},"u",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-description",className:(0,c.f)("text-muted-foreground text-sm",a),...d})},"Y",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-header",className:(0,c.f)("@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",a),...d})},"v",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-title",className:(0,c.f)("leading-none font-semibold",a),...d})}])},957292,a=>{a.i(986705),a.s(["f",0,function(a){if(!a)return null;let b=a.toLowerCase();return b.includes("math")||b.includes("数学")?"math":b.includes("physics")||b.includes("物理")?"physics":b.includes("chemistry")||b.includes("化学")?"chemistry":b.includes("biology")||b.includes("生物")?"biology":b.includes("english")||b.includes("英语")?"english":b.includes("chinese")||b.includes("语文")?"chinese":b.includes("history")||b.includes("历史")?"history":b.includes("geography")||b.includes("地理")?"geography":b.includes("politics")||b.includes("政治")?"politics":null}])},557999,a=>{var b=a.i(572131),c=a.i(550194);a.s(["f",0,function(...a){let{t:d}=(0,c.b)(),e=[d.pageTitle.base,...a.map(a=>"string"==typeof a?a.trim():"").filter(a=>a.length>0)].join("-");(0,b.useEffect)(()=>{document.title=e},[e])}])}]})();
2
+
3
+ //# sourceMappingURL=src_0av4wv_56wg9j._.js.map
@@ -0,0 +1,3 @@
1
+ (()=>{"use strict";module.exports=[579834,a=>{var b=a.i(187924),c=a.i(368114);a.s(["f",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",g),children:[(0,b.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,b.jsx)(a,{className:"h-7 w-7"})}),(0,b.jsx)("p",{className:"font-medium",children:d}),e&&(0,b.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:e}),f&&(0,b.jsx)("div",{className:"mt-5",children:f})]})}])},506376,a=>{var b=a.i(187924),c=a.i(596221);a.s(["f",0,function({label:a}){return(0,b.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,b.jsx)(c.f,{className:"h-7 w-7 animate-spin text-primary"}),a&&(0,b.jsx)("p",{className:"text-sm",children:a})]})}])},957292,a=>{a.i(986705),a.s(["f",0,function(a){if(!a)return null;let b=a.toLowerCase();return b.includes("math")||b.includes("数学")?"math":b.includes("physics")||b.includes("物理")?"physics":b.includes("chemistry")||b.includes("化学")?"chemistry":b.includes("biology")||b.includes("生物")?"biology":b.includes("english")||b.includes("英语")?"english":b.includes("chinese")||b.includes("语文")?"chinese":b.includes("history")||b.includes("历史")?"history":b.includes("geography")||b.includes("地理")?"geography":b.includes("politics")||b.includes("政治")?"politics":null}])}]})();
2
+
3
+ //# sourceMappingURL=src_0wxvmqdi_0uno._.js.map
@@ -1,3 +1,3 @@
1
- (()=>{"use strict";module.exports=[293530,a=>{var b=a.i(187924),c=a.i(16644),d=a.i(550194);a.s(["f",0,function({children:a}){let{t:e}=(0,d.b)();return(0,b.jsxs)("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[(0,b.jsx)("div",{className:"pointer-events-none absolute -left-32 -top-32 h-96 w-96 rounded-full bg-indigo-400/25 blur-3xl"}),(0,b.jsx)("div",{className:"pointer-events-none absolute -bottom-40 -right-24 h-[28rem] w-[28rem] rounded-full bg-violet-400/20 blur-3xl"}),(0,b.jsxs)("div",{className:"relative w-full max-w-md space-y-6 py-8",children:[(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,b.jsx)(c.default,{src:"/icons/icon.png",alt:"",width:64,height:64,className:"rounded-2xl shadow-lg shadow-indigo-500/30",priority:!0,unoptimized:!0}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xl font-bold tracking-tight",children:e.pageTitle.base}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:e.app.subtitle})]})]}),a]})]})}])},591119,a=>{var b=a.i(187924),c=a.i(368114);a.s(["N",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card",className:(0,c.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",a),...d})},"O",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-content",className:(0,c.f)("px-6",a),...d})},"u",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-description",className:(0,c.f)("text-muted-foreground text-sm",a),...d})},"Y",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-header",className:(0,c.f)("@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",a),...d})},"v",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-title",className:(0,c.f)("leading-none font-semibold",a),...d})}])},557999,a=>{var b=a.i(572131),c=a.i(550194);a.s(["f",0,function(...a){let{t:d}=(0,c.b)(),e=[d.pageTitle.base,...a.map(a=>"string"==typeof a?a.trim():"").filter(a=>a.length>0)].join("-");(0,b.useEffect)(()=>{document.title=e},[e])}])}]})();
1
+ (()=>{"use strict";module.exports=[293530,a=>{var b=a.i(187924),c=a.i(16644),d=a.i(550194);a.s(["f",0,function({children:a,wide:e=!1}){let{t:f}=(0,d.b)();return(0,b.jsxs)("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[(0,b.jsx)("div",{className:"pointer-events-none absolute -left-32 -top-32 h-96 w-96 rounded-full bg-indigo-400/25 blur-3xl"}),(0,b.jsx)("div",{className:"pointer-events-none absolute -bottom-40 -right-24 h-[28rem] w-[28rem] rounded-full bg-violet-400/20 blur-3xl"}),(0,b.jsxs)("div",{className:`relative w-full space-y-6 py-8 ${e?"max-w-xl":"max-w-md"}`,children:[(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,b.jsx)(c.default,{src:"/icons/icon.png",alt:"",width:64,height:64,className:"rounded-2xl shadow-lg shadow-indigo-500/30",priority:!0,unoptimized:!0}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xl font-bold tracking-tight",children:f.pageTitle.base}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f.app.subtitle})]})]}),a]})]})}])},591119,a=>{var b=a.i(187924),c=a.i(368114);a.s(["N",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card",className:(0,c.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",a),...d})},"O",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-content",className:(0,c.f)("px-6",a),...d})},"u",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-description",className:(0,c.f)("text-muted-foreground text-sm",a),...d})},"Y",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-header",className:(0,c.f)("@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",a),...d})},"v",0,function({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-title",className:(0,c.f)("leading-none font-semibold",a),...d})}])},557999,a=>{var b=a.i(572131),c=a.i(550194);a.s(["f",0,function(...a){let{t:d}=(0,c.b)(),e=[d.pageTitle.base,...a.map(a=>"string"==typeof a?a.trim():"").filter(a=>a.length>0)].join("-");(0,b.useEffect)(()=>{document.title=e},[e])}])}]})();
2
2
 
3
3
  //# sourceMappingURL=src_13u20tdu4gmgj._.js.map
@@ -0,0 +1,3 @@
1
+ (()=>{"use strict";module.exports=[468368,723222,a=>{var b=a.i(187924),c=a.i(550194),d=a.i(957292);let e=["primary","junior_high","senior_high"],f="primary",g=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function h(a){return"string"==typeof a&&g.includes(a)}function i(a){var b;let c=h(a.subjectKey)?a.subjectKey:(0,d.f)(a.name);return{stage:"string"==typeof(b=a.stage)&&e.includes(b)?a.stage:f,subject:c&&h(c)?c:null}}function j(){let{t:a}=(0,c.b)();return{stageLabel:b=>({primary:a.auth.primary,junior_high:a.auth.juniorHigh,senior_high:a.auth.seniorHigh})[b],subjectLabel:b=>a.tags.subjects[b]}}a.s(["j",0,f,"c",0,e,"W",0,{primary:["math","english"],junior_high:g,senior_high:g},"v",0,i],723222),a.s(["E",0,function({notebook:a,className:c}){let{stageLabel:d,subjectLabel:e}=j(),f=i(a);return(0,b.jsxs)("span",{className:c,children:[d(f.stage),f.subject?` \xb7 ${e(f.subject)}`:""]})},"O",0,j],468368)},957292,a=>{a.i(986705),a.s(["f",0,function(a){if(!a)return null;let b=a.toLowerCase();return b.includes("math")||b.includes("数学")?"math":b.includes("physics")||b.includes("物理")?"physics":b.includes("chemistry")||b.includes("化学")?"chemistry":b.includes("biology")||b.includes("生物")?"biology":b.includes("english")||b.includes("英语")?"english":b.includes("chinese")||b.includes("语文")?"chinese":b.includes("history")||b.includes("历史")?"history":b.includes("geography")||b.includes("地理")?"geography":b.includes("politics")||b.includes("政治")?"politics":null}])}]})();
2
+
3
+ //# sourceMappingURL=src_1jhctayt9gxoc._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[108561,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(238246),e=a.i(50944),f=a.i(529759),g=a.i(986705);let h=(0,a.i(170106).f)("clipboard-check",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);var i=a.i(596221),j=a.i(771931),k=a.i(787654),l=a.i(114548),m=a.i(781560),n=a.i(699570),o=a.i(866718),p=a.i(695001),q=a.i(506376),r=a.i(405784),s=a.i(767552),t=a.i(633508),u=a.i(786304),v=a.i(591119),w=a.i(93907),x=a.i(946862),y=a.i(226897),z=a.i(418943),A=a.i(669520),B=a.i(214491),C=a.i(550194),D=a.i(291938),E=a.i(630534),F=a.i(710302);function G({paperId:a,question:d,onDone:e}){let{t:f,language:g}=(0,C.b)(),[h,j]=(0,c.useState)(null),k=0===d.attempts.length&&!!d.errorItemId&&"pending"!==d.status,l="ready"===d.status&&!!d.questionText?.trim();if(!k&&!l)return null;let m=async b=>{let c="question"===b?f.exam.regenerateQuestionConfirm:f.exam.regenerateAnswerConfirm;if(await (0,F.u)(c)){j(b);try{let c=await D.f.post(`/api/exams/${a}/questions/${d.id}/regenerate`,{mode:b,language:g},{timeout:6e5});e(c)}catch(d){let a=d?.data?.message||"",c=f.errors[a];E.f.error("[ExamRegenerate]","Failed to regenerate exam question",{mode:b,code:a}),F.c.error("HAS_RESULTS"===a?f.exam.regenerateHasResults:"string"==typeof c?c:f.exam.regenerateFailed)}finally{j(null)}}};return(0,b.jsxs)("div",{className:"flex flex-wrap gap-1",children:[k&&(0,b.jsxs)(n.f,{variant:"ghost",size:"sm",onClick:()=>m("question"),disabled:null!==h,children:["question"===h?(0,b.jsx)(i.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,b.jsx)(A.f,{className:"mr-1 h-4 w-4"}),"question"===h?f.exam.regenerating:f.exam.regenerateQuestion]}),l&&(0,b.jsxs)(n.f,{variant:"ghost",size:"sm",onClick:()=>m("answer"),disabled:null!==h,children:["answer"===h?(0,b.jsx)(i.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,b.jsx)(B.f,{className:"mr-1 h-4 w-4"}),"answer"===h?f.exam.regenerating:f.exam.regenerateAnswer]})]})}function H({paperId:a,question:e,editingResult:h,onResultChange:j,onDeleteAttempt:k,onRegenerated:l}){let{t:m}=(0,C.b)(),{timeZone:n}=(0,f.M)(),[o,p]=(0,c.useState)(!1),q=void 0!==h,A=(()=>{if(!e.error)return"";if("SOURCE_DELETED"===e.error)return m.exam.sourceDeleted;let a=e.error.split(":")[0].trim(),b=m.errors[a];return"string"==typeof b?b:e.error})();return(0,b.jsx)(v.N,{children:(0,b.jsxs)(v.O,{className:"space-y-3 pt-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,b.jsxs)("span",{className:"font-semibold",children:[e.order,"."]}),e.errorItemId?(0,b.jsxs)(d.default,{href:`/error-items/${e.errorItemId}`,className:"font-mono text-xs text-primary hover:underline",children:[m.exam.source," ",e.sourceShortId]}):(0,b.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[e.sourceShortId," · ",m.exam.sourceDeleted]}),e.notebookName&&(0,b.jsx)(u.f,{variant:"secondary",children:e.notebookName})]}),e.attempts.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:e.attempts.map((a,c)=>(0,b.jsxs)(u.f,{variant:"outline",className:`gap-1 font-normal ${x.x[a.result]||""}`,children:[(0,b.jsx)("span",{children:m.exam.attemptLabel.replace("{n}",String(c+1))}),(0,b.jsx)("span",{className:"tabular-nums",children:(0,g.r)(a.createdAt,"MM-dd",n)}),(0,b.jsx)("span",{className:"font-semibold",children:m.mastery.results[a.result]}),q&&k&&(0,b.jsx)("button",{type:"button","aria-label":m.mastery.deleteRecord,className:"-mr-1 rounded hover:bg-black/10",onClick:()=>k(a.id),children:(0,b.jsx)(t.X,{className:"h-3 w-3"})})]},a.id))}),"pending"===e.status&&(0,b.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(i.f,{className:"h-4 w-4 animate-spin"}),m.exam.questionPending]}),"failed"===e.status&&(0,b.jsxs)("p",{className:"text-sm text-destructive",children:[m.exam.questionFailed,A?`:${A}`:""]}),"ready"===e.status&&e.questionText&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(w.f,{content:e.questionText}),(0,b.jsx)(z.f,{svg:e.figureSvg}),(0,b.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>p(!o),children:[o?(0,b.jsx)(s.f,{className:"h-3 w-3"}):(0,b.jsx)(r.f,{className:"h-3 w-3"}),m.exam.showAnswer]}),o&&(0,b.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[e.answerText&&(0,b.jsx)(w.f,{content:e.answerText,className:"font-semibold"}),e.analysis&&(0,b.jsx)(w.f,{content:e.analysis})]})]}),!q&&l&&(0,b.jsx)(G,{paperId:a,question:e,onDone:l}),q&&"ready"===e.status&&e.errorItemId&&j&&(0,b.jsx)(y.f,{value:h,onChange:j,size:"sm"})]})})}var I=a.i(726319),J=a.i(557999);a.s(["default",0,function(){let{timeZone:a}=(0,f.M)(),r=(0,e.useParams)(),s=(0,e.useRouter)(),{t,language:u}=(0,C.b)(),v=r.id,[w,x]=(0,c.useState)(null);(0,J.f)(t.exam.title,w?.title);let[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(null),[E,G]=(0,c.useState)((0,g.r)(new Date,"yyyy-MM-dd",a)),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)(null),O=(0,c.useCallback)(async()=>{try{x(await D.f.get(`/api/exams/${v}`))}catch{z(!0)}},[v]);if((0,c.useEffect)(()=>{O()},[O]),(0,c.useEffect)(()=>{if(w?.status!=="generating")return;let a=setTimeout(O,3e3);return()=>clearTimeout(a)},[w,O]),y)return(0,b.jsx)("div",{className:"p-8 text-center",children:t.exam.notFound});if(!w)return(0,b.jsx)(q.f,{label:t.common.loading});let P=w.questions.filter(a=>"ready"===a.status).length,Q=w.questions.some(a=>"failed"===a.status),R=w.questions.filter(a=>"ready"===a.status&&a.errorItemId),S=A?R.filter(a=>A[a.id]).length:0,T=async()=>{if(A&&0!==S){L(!0),N(null);try{await D.f.post(`/api/exams/${w.id}/results`,{takenAt:(0,g.$)(E,a),results:R.filter(a=>A[a.id]).map(a=>({questionId:a.id,result:A[a.id]}))}),B(null),N(t.exam.resultsSaved),await O()}catch{N(t.exam.resultsSaveFailed)}finally{L(!1)}}},U=async a=>{if(await (0,F.u)(t.mastery.deleteRecordConfirm,{destructive:!0}))try{await D.f.delete(`/api/practice/record/${a}`),await O()}catch{N(t.mastery.deleteRecordFailed)}},V=async()=>{await D.f.post(`/api/exams/${w.id}/retry`,{language:u}),await O()},W=async()=>{await (0,F.u)(t.exam.deleteConfirm,{destructive:!0})&&(await D.f.delete(`/api/exams/${w.id}`),s.push("/exams"))};return(0,b.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,b.jsxs)("div",{className:"space-y-6 pb-24",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)(p.f,{fallbackUrl:"/exams",className:"-ml-2 shrink-0"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,b.jsx)("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight break-words",children:w.title}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(I.f,{status:w.status}),(0,b.jsx)("span",{children:t.exam.progress.replace("{ready}",String(P)).replace("{total}",String(w.questions.length))}),(0,b.jsx)("span",{children:(0,g.r)(w.createdAt,"yyyy-MM-dd HH:mm",a)})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(d.default,{href:`/exams/${w.id}/print`,children:(0,b.jsxs)(n.f,{variant:"outline",size:"sm",disabled:0===P,children:[(0,b.jsx)(j.f,{className:"mr-2 h-4 w-4"}),t.exam.print]})}),!A&&R.length>0&&(0,b.jsxs)(n.f,{size:"sm",onClick:()=>{N(null),B({}),G((0,g.r)(new Date,"yyyy-MM-dd",a))},children:[(0,b.jsx)(h,{className:"mr-2 h-4 w-4"}),t.exam.recordResults]}),Q&&"generating"!==w.status&&(0,b.jsxs)(n.f,{variant:"outline",size:"sm",onClick:V,children:[(0,b.jsx)(k.f,{className:"mr-2 h-4 w-4"}),t.exam.retryFailed]}),(0,b.jsxs)(n.f,{variant:"ghost",size:"sm",onClick:W,className:"text-red-600 hover:text-red-700 hover:bg-red-50 sm:ml-auto",children:[(0,b.jsx)(m.f,{className:"mr-2 h-4 w-4"}),t.exam.delete]})]}),w.questions.length<w.requestedCount&&(0,b.jsx)("p",{className:"rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800",children:t.exam.fewerThanRequested.replaceAll("{actual}",String(w.questions.length))}),M&&(0,b.jsx)("p",{className:"rounded-md border p-3 text-sm",children:M}),A&&(0,b.jsxs)("div",{className:"space-y-2 rounded-md border bg-muted/30 p-3",children:[(0,b.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,b.jsx)("label",{htmlFor:"exam-taken-at",className:"text-sm font-medium",children:t.exam.takenAt}),(0,b.jsx)(o.f,{id:"exam-taken-at",type:"date",value:E,onChange:a=>G(a.target.value),className:"sm:w-48"})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:t.exam.recordHint})]}),(0,b.jsx)("div",{className:"space-y-3",children:w.questions.map(a=>(0,b.jsx)(H,{paperId:w.id,question:a,editingResult:A?A[a.id]??null:void 0,onResultChange:b=>B(c=>c?{...c,[a.id]:b}:c),onDeleteAttempt:U,onRegenerated:O},a.id))}),A&&(0,b.jsx)("div",{className:"fixed inset-x-0 bottom-16 z-30 border-t bg-background/95 p-3 backdrop-blur md:bottom-0",children:(0,b.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-end gap-2",children:[0===S&&(0,b.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:t.exam.noResultSelected}),(0,b.jsx)(n.f,{variant:"outline",onClick:()=>B(null),disabled:K,children:t.exam.cancel}),(0,b.jsxs)(n.f,{onClick:T,disabled:K||!E||0===S,children:[K?(0,b.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(l.f,{className:"mr-2 h-4 w-4"}),t.exam.saveResults]})]})})]})})}],108561)}];
1
+ module.exports=[108561,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(238246),e=a.i(50944),f=a.i(529759),g=a.i(986705);let h=(0,a.i(170106).f)("clipboard-check",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);var i=a.i(596221),j=a.i(771931),k=a.i(787654),l=a.i(114548),m=a.i(781560),n=a.i(699570),o=a.i(866718),p=a.i(695001),q=a.i(506376),r=a.i(405784),s=a.i(767552),t=a.i(633508),u=a.i(786304),v=a.i(591119),w=a.i(93907),x=a.i(946862),y=a.i(226897),z=a.i(418943),A=a.i(669520),B=a.i(214491),C=a.i(550194),D=a.i(291938),E=a.i(630534),F=a.i(710302);function G({paperId:a,question:d,onDone:e}){let{t:f,language:g}=(0,C.b)(),[h,j]=(0,c.useState)(null),k=0===d.attempts.length&&!!d.errorItemId&&"pending"!==d.status,l="ready"===d.status&&!!d.questionText?.trim();if(!k&&!l)return null;let m=async b=>{let c="question"===b?f.exam.regenerateQuestionConfirm:f.exam.regenerateAnswerConfirm;if(await (0,F.u)(c)){j(b);try{let c=await D.f.post(`/api/exams/${a}/questions/${d.id}/regenerate`,{mode:b,language:g},{timeout:6e5});e(c)}catch(d){let a=d?.data?.message||"",c=f.errors[a];E.f.error("[ExamRegenerate]","Failed to regenerate exam question",{mode:b,code:a}),F.c.error("HAS_RESULTS"===a?f.exam.regenerateHasResults:"string"==typeof c?c:f.exam.regenerateFailed)}finally{j(null)}}};return(0,b.jsxs)("div",{className:"flex flex-wrap gap-1",children:[k&&(0,b.jsxs)(n.f,{variant:"ghost",size:"sm",onClick:()=>m("question"),disabled:null!==h,children:["question"===h?(0,b.jsx)(i.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,b.jsx)(A.f,{className:"mr-1 h-4 w-4"}),"question"===h?f.exam.regenerating:f.exam.regenerateQuestion]}),l&&(0,b.jsxs)(n.f,{variant:"ghost",size:"sm",onClick:()=>m("answer"),disabled:null!==h,children:["answer"===h?(0,b.jsx)(i.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,b.jsx)(B.f,{className:"mr-1 h-4 w-4"}),"answer"===h?f.exam.regenerating:f.exam.regenerateAnswer]})]})}function H({paperId:a,question:e,editingResult:h,onResultChange:j,onDeleteAttempt:k,onRegenerated:l}){let{t:m}=(0,C.b)(),{timeZone:n}=(0,f.M)(),[o,p]=(0,c.useState)(!1),q=void 0!==h,A=(()=>{if(!e.error)return"";if("SOURCE_DELETED"===e.error)return m.exam.sourceDeleted;let a=e.error.split(":")[0].trim(),b=m.errors[a];return"string"==typeof b?b:e.error})();return(0,b.jsx)(v.N,{children:(0,b.jsxs)(v.O,{className:"space-y-3 pt-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,b.jsxs)("span",{className:"font-semibold",children:[e.order,"."]}),e.errorItemId?(0,b.jsxs)(d.default,{href:`/error-items/${e.errorItemId}`,className:"font-mono text-xs text-primary hover:underline",children:[m.exam.source," ",e.sourceShortId]}):(0,b.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[e.sourceShortId," · ",m.exam.sourceDeleted]}),e.notebookName&&(0,b.jsx)(u.f,{variant:"secondary",children:e.notebookName})]}),e.attempts.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:e.attempts.map((a,c)=>(0,b.jsxs)(u.f,{variant:"outline",className:`gap-1 font-normal ${x.x[a.result]||""}`,children:[(0,b.jsx)("span",{children:m.exam.attemptLabel.replace("{n}",String(c+1))}),(0,b.jsx)("span",{className:"tabular-nums",children:(0,g.r)(a.createdAt,"MM-dd",n)}),(0,b.jsx)("span",{className:"font-semibold",children:m.mastery.results[a.result]}),q&&k&&(0,b.jsx)("button",{type:"button","aria-label":m.mastery.deleteRecord,className:"-mr-1 rounded hover:bg-black/10",onClick:()=>k(a.id),children:(0,b.jsx)(t.X,{className:"h-3 w-3"})})]},a.id))}),"pending"===e.status&&(0,b.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(i.f,{className:"h-4 w-4 animate-spin"}),m.exam.questionPending]}),"failed"===e.status&&(0,b.jsxs)("p",{className:"text-sm text-destructive",children:[m.exam.questionFailed,A?`:${A}`:""]}),"ready"===e.status&&e.questionText&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(w.f,{content:e.questionText}),(0,b.jsx)(z.f,{svg:e.figureSvg}),(0,b.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>p(!o),children:[o?(0,b.jsx)(s.f,{className:"h-3 w-3"}):(0,b.jsx)(r.f,{className:"h-3 w-3"}),m.exam.showAnswer]}),o&&(0,b.jsxs)("div",{className:"space-y-2 rounded-md bg-muted/40 p-3",children:[e.answerText&&(0,b.jsx)(w.f,{content:e.answerText,className:"font-semibold"}),e.analysis&&(0,b.jsx)(w.f,{content:e.analysis})]})]}),!q&&l&&(0,b.jsx)(G,{paperId:a,question:e,onDone:l}),q&&"ready"===e.status&&e.errorItemId&&j&&(0,b.jsx)(y.f,{value:h,onChange:j,size:"sm"})]})})}var I=a.i(726319),J=a.i(557999);a.s(["default",0,function(){let{timeZone:a}=(0,f.M)(),r=(0,e.useParams)(),s=(0,e.useRouter)(),{t,language:u}=(0,C.b)(),v=r.id,[w,x]=(0,c.useState)(null);(0,J.f)(t.exam.title,w?.title);let[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(null),[E,G]=(0,c.useState)((0,g.r)(new Date,"yyyy-MM-dd",a)),[K,L]=(0,c.useState)(!1),[M,N]=(0,c.useState)(null),O=(0,c.useCallback)(async()=>{try{x(await D.f.get(`/api/exams/${v}`))}catch{z(!0)}},[v]);if((0,c.useEffect)(()=>{O()},[O]),(0,c.useEffect)(()=>{if(w?.status!=="generating")return;let a=setTimeout(O,3e3);return()=>clearTimeout(a)},[w,O]),y)return(0,b.jsx)("div",{className:"p-8 text-center",children:t.exam.notFound});if(!w)return(0,b.jsx)(q.f,{label:t.common.loading});let P=w.questions.filter(a=>"ready"===a.status).length,Q=w.questions.some(a=>a.attempts.length>0),R=w.questions.some(a=>"failed"===a.status),S=w.questions.filter(a=>"ready"===a.status&&a.errorItemId),T=A?S.filter(a=>A[a.id]).length:0,U=async()=>{if(A&&0!==T){L(!0),N(null);try{await D.f.post(`/api/exams/${w.id}/results`,{takenAt:(0,g.$)(E,a),results:S.filter(a=>A[a.id]).map(a=>({questionId:a.id,result:A[a.id]}))}),B(null),N(t.exam.resultsSaved),await O()}catch{N(t.exam.resultsSaveFailed)}finally{L(!1)}}},V=async a=>{if(await (0,F.u)(t.mastery.deleteRecordConfirm,{destructive:!0}))try{await D.f.delete(`/api/practice/record/${a}`),await O()}catch{N(t.mastery.deleteRecordFailed)}},W=async()=>{await D.f.post(`/api/exams/${w.id}/retry`,{language:u}),await O()},X=async()=>{await (0,F.u)(t.exam.deleteConfirm,{destructive:!0})&&(await D.f.delete(`/api/exams/${w.id}`),s.push("/exams"))};return(0,b.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,b.jsxs)("div",{className:"space-y-6 pb-24",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)(p.f,{fallbackUrl:"/exams",className:"-ml-2 shrink-0"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,b.jsx)("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight break-words",children:w.title}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(I.f,{status:w.status,recorded:Q}),(0,b.jsx)("span",{children:t.exam.progress.replace("{ready}",String(P)).replace("{total}",String(w.questions.length))}),(0,b.jsx)("span",{children:(0,g.r)(w.createdAt,"yyyy-MM-dd HH:mm",a)})]})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(d.default,{href:`/exams/${w.id}/print`,children:(0,b.jsxs)(n.f,{variant:"outline",size:"sm",disabled:0===P,children:[(0,b.jsx)(j.f,{className:"mr-2 h-4 w-4"}),t.exam.print]})}),!A&&S.length>0&&(0,b.jsxs)(n.f,{size:"sm",onClick:()=>{N(null),B({}),G((0,g.r)(new Date,"yyyy-MM-dd",a))},children:[(0,b.jsx)(h,{className:"mr-2 h-4 w-4"}),t.exam.recordResults]}),R&&"generating"!==w.status&&(0,b.jsxs)(n.f,{variant:"outline",size:"sm",onClick:W,children:[(0,b.jsx)(k.f,{className:"mr-2 h-4 w-4"}),t.exam.retryFailed]}),(0,b.jsxs)(n.f,{variant:"ghost",size:"sm",onClick:X,className:"text-red-600 hover:text-red-700 hover:bg-red-50 sm:ml-auto",children:[(0,b.jsx)(m.f,{className:"mr-2 h-4 w-4"}),t.exam.delete]})]}),w.questions.length<w.requestedCount&&(0,b.jsx)("p",{className:"rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800",children:t.exam.fewerThanRequested.replaceAll("{actual}",String(w.questions.length))}),M&&(0,b.jsx)("p",{className:"rounded-md border p-3 text-sm",children:M}),A&&(0,b.jsxs)("div",{className:"space-y-2 rounded-md border bg-muted/30 p-3",children:[(0,b.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,b.jsx)("label",{htmlFor:"exam-taken-at",className:"text-sm font-medium",children:t.exam.takenAt}),(0,b.jsx)(o.f,{id:"exam-taken-at",type:"date",value:E,onChange:a=>G(a.target.value),className:"sm:w-48"})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:t.exam.recordHint})]}),(0,b.jsx)("div",{className:"space-y-3",children:w.questions.map(a=>(0,b.jsx)(H,{paperId:w.id,question:a,editingResult:A?A[a.id]??null:void 0,onResultChange:b=>B(c=>c?{...c,[a.id]:b}:c),onDeleteAttempt:V,onRegenerated:O},a.id))}),A&&(0,b.jsx)("div",{className:"fixed inset-x-0 bottom-16 z-30 border-t bg-background/95 p-3 backdrop-blur md:bottom-0",children:(0,b.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-end gap-2",children:[0===T&&(0,b.jsx)("span",{className:"mr-auto text-xs text-muted-foreground",children:t.exam.noResultSelected}),(0,b.jsx)(n.f,{variant:"outline",onClick:()=>B(null),disabled:K,children:t.exam.cancel}),(0,b.jsxs)(n.f,{onClick:U,disabled:K||!E||0===T,children:[K?(0,b.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(l.f,{className:"mr-2 h-4 w-4"}),t.exam.saveResults]})]})})]})})}],108561)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_exams_%5Bid%5D_page_tsx_0xcjflkgkwzgd._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[790861,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(238246),e=a.i(529759),f=a.i(986705),g=a.i(104720),h=a.i(915618),i=a.i(699570),j=a.i(591119),k=a.i(579834),l=a.i(251538),m=a.i(506376),n=a.i(50944),o=a.i(596221),p=a.i(367295),p=p,q=a.i(315055),r=a.i(866718),s=a.i(870430),t=a.i(699814),u=a.i(550194),v=a.i(291938);let w=["unmastered","mastered","all"],x=["least_practiced","random"],y=["easy","medium","hard","harder"];function z(){let{t:a,language:d}=(0,u.b)(),e=(0,n.useRouter)(),[f,g]=(0,c.useState)([]),[h,k]=(0,c.useState)([]),[l,m]=(0,c.useState)([]),[z,A]=(0,c.useState)("unmastered"),[B,C]=(0,c.useState)("least_practiced"),[D,E]=(0,c.useState)(10),[F,G]=(0,c.useState)("medium"),[H,I]=(0,c.useState)(""),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(null);(0,c.useEffect)(()=>{v.f.get("/api/notebooks").then(a=>{g(a),1===a.length&&k([a[0].id])}).catch(()=>g([]))},[]);let N=async b=>{if(b.preventDefault(),0===h.length)return void M(a.exam.noNotebook);K(!0),M(null);try{let a=await v.f.post("/api/exams",{subjectIds:h,tagNames:l,scope:z,pickRule:B,count:D,difficulty:F,title:H.trim()||void 0,language:d});e.push(`/exams/${a.id}`)}catch(b){M("NO_SOURCE_ITEMS"===b?.data?.message?a.exam.noSource:a.common.messages?.saveFailed||"Failed"),K(!1)}},O=a.practice.difficulty;return(0,b.jsxs)(j.N,{children:[(0,b.jsx)(j.Y,{children:(0,b.jsx)(j.v,{className:"text-lg",children:a.exam.createTitle})}),(0,b.jsx)(j.O,{children:(0,b.jsxs)("form",{onSubmit:N,className:"space-y-5",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(s.f,{children:a.exam.notebooks}),f.length>1&&(0,b.jsx)("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>k(h.length===f.length?[]:f.map(a=>a.id)),children:a.exam.selectAll})]}),(0,b.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:f.map(a=>(0,b.jsxs)("label",{className:"flex items-center gap-2 rounded-md border p-2 text-sm cursor-pointer hover:bg-muted/50",children:[(0,b.jsx)(q.f,{checked:h.includes(a.id),onCheckedChange:()=>{var b;return b=a.id,void k(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])}}),(0,b.jsx)("span",{className:"truncate",children:a.name}),(0,b.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:a._count?.errorItems??""})]},a.id))})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:a.exam.tags}),(0,b.jsx)(t.f,{value:l,onChange:m,placeholder:a.exam.tagsPlaceholder})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:a.exam.scope}),(0,b.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-md bg-muted p-1",children:w.map(c=>(0,b.jsx)("button",{type:"button",onClick:()=>A(c),className:`rounded px-2 py-1.5 text-sm transition-colors ${z===c?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:a.exam.scopes[c]},c))})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{htmlFor:"exam-count",children:a.exam.count}),(0,b.jsx)(r.f,{id:"exam-count",type:"number",min:1,max:50,value:D,onChange:a=>E(Math.min(50,Math.max(1,parseInt(a.target.value,10)||1)))})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{htmlFor:"exam-difficulty",children:a.exam.difficulty}),(0,b.jsx)("select",{id:"exam-difficulty",value:F,onChange:a=>G(a.target.value),className:"h-9 w-full rounded-md border bg-background px-3 text-sm",children:y.map(a=>(0,b.jsx)("option",{value:a,children:O[a]},a))})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:a.exam.pickRule}),(0,b.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",children:x.map(c=>(0,b.jsx)("button",{type:"button",onClick:()=>C(c),className:`rounded px-2 py-1.5 text-sm transition-colors ${B===c?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:a.exam.pickRules[c]},c))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a.exam.pickRuleHints[B]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{htmlFor:"exam-title",children:a.exam.titleLabel}),(0,b.jsx)(r.f,{id:"exam-title",value:H,maxLength:100,onChange:a=>I(a.target.value)})]}),L&&(0,b.jsx)("p",{className:"text-sm text-destructive",children:L}),(0,b.jsxs)(i.f,{type:"submit",disabled:J,className:"w-full sm:w-auto",children:[J?(0,b.jsx)(o.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(p.f,{className:"mr-2 h-4 w-4"}),J?a.exam.creating:a.exam.generate]})]})})]})}var A=a.i(726319),B=a.i(557999);a.s(["default",0,function(){let{timeZone:a}=(0,e.M)(),{t:n}=(0,u.b)();(0,B.f)(n.exam.title);let[o,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(!1);(0,c.useEffect)(()=>{v.f.get("/api/exams").then(a=>{p(a),0===a.length&&r(!0)}).catch(()=>p([]))},[]);let s=n.practice.difficulty;return(0,b.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(l.f,{title:n.exam.title,description:n.exam.subtitle,actions:!q&&(0,b.jsxs)(i.f,{onClick:()=>r(!0),"aria-label":n.exam.create,children:[(0,b.jsx)(h.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:n.exam.create})]})}),q&&(0,b.jsx)(z,{}),(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:n.exam.list}),null===o?(0,b.jsx)(m.f,{}):0===o.length?(0,b.jsx)(k.f,{icon:g.f,title:n.exam.empty,className:"py-10"}):(0,b.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:o.map(c=>(0,b.jsx)(d.default,{href:`/exams/${c.id}`,children:(0,b.jsx)(j.N,{className:"h-full rounded-2xl transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md",children:(0,b.jsxs)(j.O,{className:"space-y-2 pt-4",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,b.jsx)(g.f,{className:"h-4 w-4 shrink-0 text-primary"}),c.title]}),(0,b.jsx)(A.f,{status:c.status})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:(0,f.r)(c.createdAt,"yyyy-MM-dd HH:mm",a)}),(0,b.jsx)("span",{children:n.exam.questionCount.replace("{count}",String(c.questionCount))}),(0,b.jsx)("span",{children:n.exam.scopes[c.scope]}),(0,b.jsx)("span",{children:s[c.difficulty]||c.difficulty}),(0,b.jsx)("span",{children:c.recordedCount>0?n.exam.recorded:n.exam.notRecorded})]})]})})},c.id))})]})]})})}],790861)}];
1
+ module.exports=[790861,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(238246),e=a.i(529759),f=a.i(986705),g=a.i(104720),h=a.i(915618),i=a.i(699570),j=a.i(591119),k=a.i(579834),l=a.i(251538),m=a.i(506376),n=a.i(50944),o=a.i(596221),p=a.i(154933),q=a.i(315055),r=a.i(866718),s=a.i(870430),t=a.i(699814),u=a.i(550194),v=a.i(291938);let w=["unmastered","mastered","all"],x=["least_practiced","random"],y=["easy","medium","hard","harder"];function z(){let{t:a,language:d}=(0,u.b)(),e=(0,n.useRouter)(),[f,g]=(0,c.useState)([]),[h,k]=(0,c.useState)([]),[l,m]=(0,c.useState)([]),[z,A]=(0,c.useState)("unmastered"),[B,C]=(0,c.useState)("least_practiced"),[D,E]=(0,c.useState)(10),[F,G]=(0,c.useState)("medium"),[H,I]=(0,c.useState)(""),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(null);(0,c.useEffect)(()=>{v.f.get("/api/notebooks").then(a=>{g(a),1===a.length&&k([a[0].id])}).catch(()=>g([]))},[]);let N=async b=>{if(b.preventDefault(),0===h.length)return void M(a.exam.noNotebook);K(!0),M(null);try{let a=await v.f.post("/api/exams",{subjectIds:h,tagNames:l,scope:z,pickRule:B,count:D,difficulty:F,title:H.trim()||void 0,language:d});e.push(`/exams/${a.id}`)}catch(b){M("NO_SOURCE_ITEMS"===b?.data?.message?a.exam.noSource:a.common.messages?.saveFailed||"Failed"),K(!1)}},O=a.practice.difficulty;return(0,b.jsxs)(j.N,{children:[(0,b.jsx)(j.Y,{children:(0,b.jsx)(j.v,{className:"text-lg",children:a.exam.createTitle})}),(0,b.jsx)(j.O,{children:(0,b.jsxs)("form",{onSubmit:N,className:"space-y-5",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(s.f,{children:a.exam.notebooks}),f.length>1&&(0,b.jsx)("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>k(h.length===f.length?[]:f.map(a=>a.id)),children:a.exam.selectAll})]}),(0,b.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:f.map(a=>(0,b.jsxs)("label",{className:"flex items-center gap-2 rounded-md border p-2 text-sm cursor-pointer hover:bg-muted/50",children:[(0,b.jsx)(q.f,{checked:h.includes(a.id),onCheckedChange:()=>{var b;return b=a.id,void k(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])}}),(0,b.jsx)("span",{className:"truncate",children:a.name}),(0,b.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:a._count?.errorItems??""})]},a.id))})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:a.exam.tags}),(0,b.jsx)(t.f,{value:l,onChange:m,placeholder:a.exam.tagsPlaceholder})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:a.exam.scope}),(0,b.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-md bg-muted p-1",children:w.map(c=>(0,b.jsx)("button",{type:"button",onClick:()=>A(c),className:`rounded px-2 py-1.5 text-sm transition-colors ${z===c?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:a.exam.scopes[c]},c))})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{htmlFor:"exam-count",children:a.exam.count}),(0,b.jsx)(r.f,{id:"exam-count",type:"number",min:1,max:50,value:D,onChange:a=>E(Math.min(50,Math.max(1,parseInt(a.target.value,10)||1)))})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{htmlFor:"exam-difficulty",children:a.exam.difficulty}),(0,b.jsx)("select",{id:"exam-difficulty",value:F,onChange:a=>G(a.target.value),className:"h-9 w-full rounded-md border bg-background px-3 text-sm",children:y.map(a=>(0,b.jsx)("option",{value:a,children:O[a]},a))})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{children:a.exam.pickRule}),(0,b.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:max-w-sm",children:x.map(c=>(0,b.jsx)("button",{type:"button",onClick:()=>C(c),className:`rounded px-2 py-1.5 text-sm transition-colors ${B===c?"bg-background shadow-sm font-medium":"text-muted-foreground"}`,children:a.exam.pickRules[c]},c))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a.exam.pickRuleHints[B]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(s.f,{htmlFor:"exam-title",children:a.exam.titleLabel}),(0,b.jsx)(r.f,{id:"exam-title",value:H,maxLength:100,onChange:a=>I(a.target.value)})]}),L&&(0,b.jsx)("p",{className:"text-sm text-destructive",children:L}),(0,b.jsxs)(i.f,{type:"submit",disabled:J,className:"w-full sm:w-auto",children:[J?(0,b.jsx)(o.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(p.f,{className:"mr-2 h-4 w-4"}),J?a.exam.creating:a.exam.generate]})]})})]})}var A=a.i(726319),B=a.i(557999);a.s(["default",0,function(){let{timeZone:a}=(0,e.M)(),{t:n}=(0,u.b)();(0,B.f)(n.exam.title);let[o,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(!1);(0,c.useEffect)(()=>{v.f.get("/api/exams").then(a=>{p(a),0===a.length&&r(!0)}).catch(()=>p([]))},[]);let s=n.practice.difficulty;return(0,b.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(l.f,{title:n.exam.title,description:n.exam.subtitle,actions:!q&&(0,b.jsxs)(i.f,{onClick:()=>r(!0),"aria-label":n.exam.create,children:[(0,b.jsx)(h.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:n.exam.create})]})}),q&&(0,b.jsx)(z,{}),(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:n.exam.list}),null===o?(0,b.jsx)(m.f,{}):0===o.length?(0,b.jsx)(k.f,{icon:g.f,title:n.exam.empty,className:"py-10"}):(0,b.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:o.map(c=>(0,b.jsx)(d.default,{href:`/exams/${c.id}`,children:(0,b.jsx)(j.N,{className:"h-full rounded-2xl transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md",children:(0,b.jsxs)(j.O,{className:"space-y-2 pt-4",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,b.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,b.jsx)(g.f,{className:"h-4 w-4 shrink-0 text-primary"}),c.title]}),(0,b.jsx)(A.f,{status:c.status,recorded:c.recordedCount>0})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:(0,f.r)(c.createdAt,"yyyy-MM-dd HH:mm",a)}),(0,b.jsx)("span",{children:n.exam.questionCount.replace("{count}",String(c.questionCount))}),(0,b.jsx)("span",{children:n.exam.scopes[c.scope]}),(0,b.jsx)("span",{children:s[c.difficulty]||c.difficulty}),(0,b.jsx)("span",{children:c.recordedCount>0?n.exam.recorded:n.exam.notRecorded})]})]})})},c.id))})]})]})})}],790861)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_exams_page_tsx_17_d4_gy2i1ds._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[701453,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(699570),f=a.i(251538),g=a.i(506376),h=a.i(915618),i=a.i(699464),j=a.i(238246),k=a.i(170106);let l=(0,k.f)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),m=(0,k.f)("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);var n=a.i(755023),o=a.i(771931);let p=(0,k.f)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var q=a.i(263323),r=a.i(405784);let s=(0,k.f)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);var t=a.i(507554),u=a.i(470121),v=a.i(750104),w=a.i(225152),x=a.i(30553),y=a.i(37738),z=a.i(507827),A=a.i(596743),B=a.i(486228),C=a.i(422297),D=a.i(392843),E=a.i(704691),F=a.i(692616),G=a.i(777192),H=a.i(224050),I=a.i(811011),J=a.i(746872),K=a.i(241852),L=a.i(152081),M=Object.defineProperty,N=(a,b)=>M(a,"name",{value:b,configurable:!0}),O=["Enter"," "],P=["ArrowUp","PageDown","End"],Q=["ArrowDown","PageUp","Home",...P],R={ltr:[...O,"ArrowRight"],rtl:[...O,"ArrowLeft"]},S={ltr:["ArrowLeft"],rtl:["ArrowRight"]},T="Menu",[U,V,W]=(0,y.f)(T),[X,Y]=(0,v.f)(T,[W,E.y,H.B]),Z=(0,E.y)(),$=(0,H.B)(),[_,aa]=X(T),[ab,ac]=X(T),ad=N(a=>{let{__scopeMenu:d,open:e=!1,children:f,dir:g,onOpenChange:h,modal:i=!0}=a,j=Z(d),[k,l]=c.useState(null),m=c.useRef(!1),n=(0,J.f)(h),o=(0,z.f)(g);return c.useEffect(()=>{let a=N(()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},"handleKeyDown"),b=N(()=>m.current=!1,"handlePointer");return document.addEventListener("keydown",a,{capture:!0}),()=>{document.removeEventListener("keydown",a,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),c.useEffect(()=>{if(!e)return;let a=N(()=>n(!1),"handleBlur");return window.addEventListener("blur",a),()=>window.removeEventListener("blur",a)},[e,n]),(0,b.jsx)(E.F,{...j,children:(0,b.jsx)(_,{scope:d,open:e,onOpenChange:n,content:k,onContentChange:l,children:(0,b.jsx)(ab,{scope:d,onClose:c.useCallback(()=>n(!1),[n]),isUsingKeyboardRef:m,dir:o,modal:i,children:f})})})},"Menu"),ae=c.forwardRef(N(function(a,c){let{__scopeMenu:d,...e}=a,f=Z(d);return(0,b.jsx)(E.g,{...f,...e,ref:c})},"MenuAnchor")),af="MenuPortal",[ag,ah]=X(af,{forceMount:void 0}),ai=N(a=>{let{__scopeMenu:c,forceMount:d,children:e,container:f}=a,g=aa(af,c);return(0,b.jsx)(ag,{scope:c,forceMount:d,children:(0,b.jsx)(G.f,{present:d||g.open,children:(0,b.jsx)(F.f,{asChild:!0,container:f,children:e})})})},"MenuPortal"),aj="MenuContent",[ak,al]=X(aj),am=c.forwardRef(N(function(a,c){let d=ah(aj,a.__scopeMenu),{forceMount:e=d.forceMount,...f}=a,g=aa(aj,a.__scopeMenu),h=ac(aj,a.__scopeMenu);return(0,b.jsx)(U.Provider,{scope:a.__scopeMenu,children:(0,b.jsx)(G.f,{present:e||g.open,children:(0,b.jsx)(U.Slot,{scope:a.__scopeMenu,children:h.modal?(0,b.jsx)(an,{...f,ref:c}):(0,b.jsx)(ao,{...f,ref:c})})})})},"MenuContent")),an=c.forwardRef(N(function(a,d){let e=aa(aj,a.__scopeMenu),f=c.useRef(null),g=(0,u.f)(d,f);return c.useEffect(()=>{let a=f.current;if(a)return(0,K.f)(a)},[]),(0,b.jsx)(aq,{...a,ref:g,trapFocus:e.open,disableOutsidePointerEvents:e.open,disableOutsideScroll:!0,onFocusOutside:(0,t.f)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>e.onOpenChange(!1)})},"MenuRootContentModal")),ao=c.forwardRef(N(function(a,c){let d=aa(aj,a.__scopeMenu);return(0,b.jsx)(aq,{...a,ref:c,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>d.onOpenChange(!1)})},"MenuRootContentNonModal")),ap=(0,I.B)("MenuContent.ScrollLock"),aq=c.forwardRef(N(function(a,d){let{__scopeMenu:e,loop:f=!1,trapFocus:g,onOpenAutoFocus:h,onCloseAutoFocus:i,disableOutsidePointerEvents:j,onEntryFocus:k,onEscapeKeyDown:l,onPointerDownOutside:m,onFocusOutside:n,onInteractOutside:o,onDismiss:p,disableOutsideScroll:q,...r}=a,s=aa(aj,e),v=ac(aj,e),w=Z(e),x=$(e),y=V(e),[z,D]=c.useState(null),F=c.useRef(null),[G,I]=c.useState(null);(0,C.i)(G);let{nodes:J,registry:K}=(0,C.D)(),M=!!(g||q),O=(0,u.f)(d,F,s.onContentChange,I),R=c.useRef(0),S=c.useRef(""),T=c.useRef(0),U=c.useRef(null),W=c.useRef("right"),X=c.useRef(0),Y=c.useMemo(()=>q?[F,...J.map(a=>({current:a}))]:[],[F,J,q]),_=q?L.f:c.Fragment,ab=N(a=>{let b=S.current+a,c=y().filter(a=>!a.disabled),d=document.activeElement,e=c.find(a=>a.ref.current===d)?.textValue,f=aQ(c.map(a=>a.textValue),b,e),g=c.find(a=>a.textValue===f)?.ref.current;function h(a){S.current=a,window.clearTimeout(R.current),""!==a&&(R.current=window.setTimeout(()=>h(""),1e3))}N(h,"updateSearch"),h(b),g&&setTimeout(()=>g.focus())},"handleTypeaheadSearch");c.useEffect(()=>()=>window.clearTimeout(R.current),[]),(0,B.f)();let ad=c.useCallback(a=>W.current===U.current?.side&&aS(a,U.current?.area),[]);return(0,b.jsx)(ak,{scope:e,searchRef:S,onItemEnter:c.useCallback(a=>{ad(a)&&a.preventDefault()},[ad]),onItemLeave:c.useCallback(a=>{ad(a)||(F.current?.focus(),D(null))},[ad]),onTriggerLeave:c.useCallback(a=>{ad(a)&&a.preventDefault()},[ad]),pointerGraceTimerRef:T,onPointerGraceIntentChange:c.useCallback(a=>{U.current=a},[]),children:(0,b.jsx)(C.l,{registry:M?K:null,children:(0,b.jsx)(_,{...q?{as:ap,allowPinchZoom:!0,shards:Y}:void 0,children:(0,b.jsx)(C.v,{asChild:!0,trapped:g,branches:J,onMountAutoFocus:(0,t.f)(h,a=>{a.preventDefault(),F.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,b.jsx)(A.V,{asChild:!0,disableOutsidePointerEvents:j,onEscapeKeyDown:l,onPointerDownOutside:m,onFocusOutside:n,onInteractOutside:o,onDismiss:p,children:(0,b.jsx)(H.F,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:f,currentTabStopId:z,onCurrentTabStopIdChange:D,onEntryFocus:(0,t.f)(k,a=>{v.isUsingKeyboardRef.current||a.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,b.jsx)(E.c,{role:"menu","aria-orientation":"vertical","data-state":aL(s.open),"data-radix-menu-content":"",dir:v.dir,...w,...r,ref:O,style:{outline:"none",...r.style},onKeyDown:(0,t.f)(r.onKeyDown,a=>{let b=a.target.closest("[data-radix-menu-content]")===a.currentTarget,c=a.ctrlKey||a.altKey||a.metaKey,d=1===a.key.length;b&&("Tab"===a.key&&a.preventDefault(),!c&&d&&ab(a.key));let e=F.current;if(a.target!==e||!Q.includes(a.key))return;a.preventDefault();let f=y().filter(a=>!a.disabled).map(a=>a.ref.current);P.includes(a.key)&&f.reverse(),aO(f)}),onBlur:(0,t.f)(a.onBlur,a=>{a.currentTarget.contains(a.target)||(window.clearTimeout(R.current),S.current="")}),onPointerMove:(0,t.f)(a.onPointerMove,aT(a=>{let b=a.target,c=X.current!==a.clientX;a.currentTarget.contains(b)&&c&&(W.current=a.clientX>X.current?"right":"left",X.current=a.clientX)}))})})})})})})})},"MenuContentImpl")),ar=c.forwardRef(N(function(a,c){let{__scopeMenu:d,...e}=a;return(0,b.jsx)(x.V.div,{...e,ref:c})},"MenuLabel")),as="MenuItem",at="menu.itemSelect",au=c.forwardRef(N(function(a,d){let{disabled:e=!1,onSelect:f,...g}=a,h=c.useRef(null),i=ac(as,a.__scopeMenu),j=al(as,a.__scopeMenu),k=(0,u.f)(d,h),l=c.useRef(!1),m=N(()=>{let a=h.current;if(!e&&a){let b=new CustomEvent(at,{bubbles:!0,cancelable:!0});a.addEventListener(at,a=>f?.(a),{once:!0}),(0,x.u)(a,b),b.defaultPrevented?l.current=!1:i.onClose()}},"handleSelect");return(0,b.jsx)(av,{...g,ref:k,disabled:e,onClick:(0,t.f)(a.onClick,m),onPointerDown:b=>{a.onPointerDown?.(b),l.current=!0},onPointerUp:(0,t.f)(a.onPointerUp,a=>{l.current||a.currentTarget?.click()}),onKeyDown:(0,t.f)(a.onKeyDown,a=>{e||a.target!==a.currentTarget||(""===j.searchRef.current||" "!==a.key)&&O.includes(a.key)&&(a.currentTarget.click(),a.preventDefault())})})},"MenuItem")),av=c.forwardRef(N(function(a,d){let{__scopeMenu:e,disabled:f=!1,textValue:g,...h}=a,i=al(as,e),j=$(e),k=c.useRef(null),l=(0,u.f)(d,k),[m,n]=c.useState(!1),[o,p]=c.useState("");return c.useEffect(()=>{let a=k.current;a&&p((a.textContent??"").trim())},[h.children]),(0,b.jsx)(U.ItemSlot,{scope:e,disabled:f,textValue:g??o,children:(0,b.jsx)(H.M,{asChild:!0,...j,focusable:!f,children:(0,b.jsx)(x.V.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":f||void 0,"data-disabled":f?"":void 0,...h,ref:l,onPointerMove:(0,t.f)(a.onPointerMove,aT(a=>{f?i.onItemLeave(a):(i.onItemEnter(a),a.defaultPrevented||a.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,t.f)(a.onPointerLeave,aT(a=>i.onItemLeave(a))),onFocus:(0,t.f)(a.onFocus,()=>n(!0)),onBlur:(0,t.f)(a.onBlur,()=>n(!1))})})})},"MenuItemImpl")),aw=c.forwardRef(N(function(a,c){let{checked:d=!1,onCheckedChange:e,...f}=a;return(0,b.jsx)(aB,{scope:a.__scopeMenu,checked:d,children:(0,b.jsx)(au,{role:"menuitemcheckbox","aria-checked":aM(d)?"mixed":d,...f,ref:c,"data-state":aN(d),onSelect:(0,t.f)(f.onSelect,()=>e?.(!!aM(d)||!d),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),[ax,ay]=X("MenuRadioGroup",{value:void 0,onValueChange:N(()=>{},"onValueChange")}),az=c.forwardRef(N(function(a,c){let{value:d,...e}=a,f=ay("MenuRadioItem",a.__scopeMenu),g=d===f.value;return(0,b.jsx)(aB,{scope:a.__scopeMenu,checked:g,children:(0,b.jsx)(au,{role:"menuitemradio","aria-checked":g,...e,ref:c,"data-state":aN(g),onSelect:(0,t.f)(e.onSelect,()=>f.onValueChange?.(d),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),aA="MenuItemIndicator",[aB,aC]=X(aA,{checked:!1}),aD=c.forwardRef(N(function(a,c){let{__scopeMenu:d,forceMount:e,...f}=a,g=aC(aA,d);return(0,b.jsx)(G.f,{present:e||aM(g.checked)||!0===g.checked,children:(0,b.jsx)(x.V.span,{...f,ref:c,"data-state":aN(g.checked)})})},"MenuItemIndicator")),aE=c.forwardRef(N(function(a,c){let{__scopeMenu:d,...e}=a;return(0,b.jsx)(x.V.div,{role:"separator","aria-orientation":"horizontal",...e,ref:c})},"MenuSeparator")),aF="MenuSub",[aG,aH]=X(aF),aI=(a=>{let{__scopeMenu:d,children:e,open:f=!1,onOpenChange:g}=a,h=aa(aF,d),i=Z(d),[j,k]=c.useState(null),[l,m]=c.useState(null),n=(0,J.f)(g);return c.useEffect(()=>(!1===h.open&&n(!1),()=>n(!1)),[h.open,n]),(0,b.jsx)(E.F,{...i,children:(0,b.jsx)(_,{scope:d,open:f,onOpenChange:n,content:l,onContentChange:m,children:(0,b.jsx)(aG,{scope:d,contentId:(0,D.f)(),triggerId:(0,D.f)(),trigger:j,onTriggerChange:k,children:e})})})},"MenuSubTrigger"),aJ=c.forwardRef(N(function(a,d){let e=aa(aI,a.__scopeMenu),f=ac(aI,a.__scopeMenu),g=aH(aI,a.__scopeMenu),h=al(aI,a.__scopeMenu),i=c.useRef(null),{pointerGraceTimerRef:j,onPointerGraceIntentChange:k}=h,l={__scopeMenu:a.__scopeMenu},m=c.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);c.useEffect(()=>m,[m]),c.useEffect(()=>{let a=j.current;return()=>{window.clearTimeout(a),k(null)}},[j,k]);let n=(0,u.f)(d,g.onTriggerChange);return(0,b.jsx)(ae,{asChild:!0,...l,children:(0,b.jsx)(av,{id:g.triggerId,"aria-haspopup":"menu","aria-expanded":e.open,"aria-controls":e.open?g.contentId:void 0,"data-state":aL(e.open),...a,ref:n,onClick:b=>{a.onClick?.(b),a.disabled||b.defaultPrevented||(b.currentTarget.focus(),e.open||e.onOpenChange(!0))},onPointerMove:(0,t.f)(a.onPointerMove,aT(b=>{h.onItemEnter(b),!b.defaultPrevented&&(a.disabled||e.open||i.current||(h.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{e.onOpenChange(!0),m()},100)))})),onPointerLeave:(0,t.f)(a.onPointerLeave,aT(a=>{m();let b=e.content?.getBoundingClientRect();if(b){let c=e.content?.dataset.side,d="right"===c,f=b[d?"left":"right"],g=b[d?"right":"left"];h.onPointerGraceIntentChange({area:[{x:a.clientX+(d?-5:5),y:a.clientY},{x:f,y:b.top},{x:g,y:b.top},{x:g,y:b.bottom},{x:f,y:b.bottom}],side:c}),window.clearTimeout(j.current),j.current=window.setTimeout(()=>h.onPointerGraceIntentChange(null),300)}else{if(h.onTriggerLeave(a),a.defaultPrevented)return;h.onPointerGraceIntentChange(null)}})),onKeyDown:(0,t.f)(a.onKeyDown,b=>{a.disabled||b.target!==b.currentTarget||(""===h.searchRef.current||" "!==b.key)&&R[f.dir].includes(b.key)&&(e.onOpenChange(!0),e.content?.focus(),b.preventDefault())})})})},"MenuSubTrigger")),aK=c.forwardRef(N(function(a,d){let e=ah(aj,a.__scopeMenu),{forceMount:f=e.forceMount,align:g="start",...h}=a,i=aa(aj,a.__scopeMenu),j=ac(aj,a.__scopeMenu),k=aH("MenuSubContent",a.__scopeMenu),l=c.useRef(null),m=(0,u.f)(d,l);return(0,b.jsx)(U.Provider,{scope:a.__scopeMenu,children:(0,b.jsx)(G.f,{present:f||i.open,children:(0,b.jsx)(U.Slot,{scope:a.__scopeMenu,children:(0,b.jsx)(aq,{id:k.contentId,"aria-labelledby":k.triggerId,...h,ref:m,align:g,side:"rtl"===j.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:a=>{j.isUsingKeyboardRef.current&&l.current?.focus(),a.preventDefault()},onCloseAutoFocus:a=>a.preventDefault(),onFocusOutside:(0,t.f)(a.onFocusOutside,a=>{a.target!==k.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:(0,t.f)(a.onEscapeKeyDown,a=>{j.onClose(),a.preventDefault()}),onKeyDown:(0,t.f)(a.onKeyDown,a=>{let b=a.currentTarget.contains(a.target),c=S[j.dir].includes(a.key);b&&c&&(i.onOpenChange(!1),k.trigger?.focus(),a.preventDefault())})})})})})},"MenuSubContent"));function aL(a){return a?"open":"closed"}function aM(a){return"indeterminate"===a}function aN(a){return aM(a)?"indeterminate":a?"checked":"unchecked"}function aO(a){let b=document.activeElement;for(let c of a)if(c===b||(c.focus(),document.activeElement!==b))return}function aP(a,b){return a.map((c,d)=>a[(b+d)%a.length])}function aQ(a,b,c){let d=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,e=c?a.indexOf(c):-1,f=aP(a,Math.max(e,0));1===d.length&&(f=f.filter(a=>a!==c));let g=f.find(a=>a.toLowerCase().startsWith(d.toLowerCase()));return g!==c?g:void 0}function aR(a,b){let{x:c,y:d}=a,e=!1;for(let a=0,f=b.length-1;a<b.length;f=a++){let g=b[a],h=b[f],i=g.x,j=g.y,k=h.x,l=h.y;j>d!=l>d&&c<(k-i)*(d-j)/(l-j)+i&&(e=!e)}return e}function aS(a,b){return!!b&&aR({x:a.clientX,y:a.clientY},b)}function aT(a){return b=>"mouse"===b.pointerType?a(b):void 0}N(aL,"getOpenState"),N(aM,"isIndeterminate"),N(aN,"getCheckedState"),N(aO,"focusFirst"),N(aP,"wrapArray"),N(aQ,"getNextMatch"),N(aR,"isPointInPolygon"),N(aS,"isPointerInGraceArea"),N(aT,"whenMouse");var aU=Object.defineProperty,aV=(a,b)=>aU(a,"name",{value:b,configurable:!0}),aW="DropdownMenu",[aX,aY]=(0,v.f)(aW,[Y]),aZ=Y(),[a$,a_]=aX(aW),a0=aV(a=>{let{__scopeDropdownMenu:d,children:e,dir:f,open:g,defaultOpen:h,onOpenChange:i,modal:j=!0}=a,k=aZ(d),l=c.useRef(null),[m,n]=(0,w.f)({prop:g,defaultProp:h??!1,onChange:i,caller:aW});return(0,b.jsx)(a$,{scope:d,triggerId:(0,D.f)(),triggerRef:l,contentId:(0,D.f)(),open:m,onOpenChange:n,onOpenToggle:c.useCallback(()=>n(a=>!a),[n]),modal:j,children:(0,b.jsx)(ad,{...k,open:m,onOpenChange:n,dir:f,modal:j,children:e})})},"DropdownMenu"),a1=c.forwardRef(aV(function(a,c){let{__scopeDropdownMenu:d,disabled:e=!1,...f}=a,g=a_("DropdownMenuTrigger",d),h=aZ(d),i=(0,u.f)(c,g.triggerRef);return(0,b.jsx)(ae,{asChild:!0,...h,children:(0,b.jsx)(x.V.button,{type:"button",id:g.triggerId,"aria-haspopup":"menu","aria-expanded":g.open,"aria-controls":g.open?g.contentId:void 0,"data-state":g.open?"open":"closed","data-disabled":e?"":void 0,disabled:e,...f,ref:i,onPointerDown:(0,t.f)(a.onPointerDown,a=>{!e&&0===a.button&&!1===a.ctrlKey&&(g.onOpenToggle(),g.open||a.preventDefault())}),onKeyDown:(0,t.f)(a.onKeyDown,a=>{!e&&(["Enter"," "].includes(a.key)&&g.onOpenToggle(),"ArrowDown"===a.key&&g.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})},"DropdownMenuTrigger")),a2=aV(a=>{let{__scopeDropdownMenu:c,...d}=a,e=aZ(c);return(0,b.jsx)(ai,{...e,...d})},"DropdownMenuPortal"),a3=c.forwardRef(aV(function(a,d){let{__scopeDropdownMenu:e,...f}=a,g=a_("DropdownMenuContent",e),h=aZ(e),i=c.useRef(!1);return(0,b.jsx)(am,{id:g.contentId,"aria-labelledby":g.triggerId,...h,...f,ref:d,onCloseAutoFocus:(0,t.f)(a.onCloseAutoFocus,a=>{i.current||g.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:(0,t.f)(a.onInteractOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey,d=2===b.button||c;(!g.modal||d)&&(i.current=!0)}),style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),a4=c.forwardRef(aV(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=aZ(d);return(0,b.jsx)(ar,{...f,...e,ref:c})},"DropdownMenuLabel")),a5=c.forwardRef(aV(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=aZ(d);return(0,b.jsx)(au,{...f,...e,ref:c})},"DropdownMenuItem")),a6=c.forwardRef(aV(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=aZ(d);return(0,b.jsx)(aw,{...f,...e,ref:c})},"DropdownMenuCheckboxItem")),a7=c.forwardRef(aV(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=aZ(d);return(0,b.jsx)(az,{...f,...e,ref:c})},"DropdownMenuRadioItem")),a8=c.forwardRef(aV(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=aZ(d);return(0,b.jsx)(aD,{...f,...e,ref:c})},"DropdownMenuItemIndicator")),a9=c.forwardRef(aV(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=aZ(d);return(0,b.jsx)(aE,{...f,...e,ref:c})},"DropdownMenuSeparator")),ba=c.forwardRef(aV(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=aZ(d);return(0,b.jsx)(aJ,{...f,...e,ref:c})},"DropdownMenuSubTrigger")),bb=c.forwardRef(aV(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=aZ(d);return(0,b.jsx)(aK,{...f,...e,ref:c,style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),bc=a.i(533441),bd=a.i(50522);let be=(0,k.f)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var bf=a.i(368114);(c.forwardRef(({className:a,inset:c,children:d,...e},f)=>(0,b.jsxs)(ba,{ref:f,className:(0,bf.f)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",c&&"pl-8",a),...e,children:[d,(0,b.jsx)(bd.f,{className:"ml-auto h-4 w-4"})]}))).displayName=ba.displayName,(c.forwardRef(({className:a,...c},d)=>(0,b.jsx)(bb,{ref:d,className:(0,bf.f)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...c}))).displayName=bb.displayName;let bg=c.forwardRef(({className:a,sideOffset:c=4,...d},e)=>(0,b.jsx)(a2,{children:(0,b.jsx)(a3,{ref:e,sideOffset:c,className:(0,bf.f)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...d})}));bg.displayName=a3.displayName;let bh=c.forwardRef(({className:a,inset:c,...d},e)=>(0,b.jsx)(a5,{ref:e,className:(0,bf.f)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",c&&"pl-8",a),...d}));bh.displayName=a5.displayName,(c.forwardRef(({className:a,children:c,checked:d,...e},f)=>(0,b.jsxs)(a6,{ref:f,className:(0,bf.f)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:d,...e,children:[(0,b.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,b.jsx)(a8,{children:(0,b.jsx)(bc.f,{className:"h-4 w-4"})})}),c]}))).displayName=a6.displayName,(c.forwardRef(({className:a,children:c,...d},e)=>(0,b.jsxs)(a7,{ref:e,className:(0,bf.f)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...d,children:[(0,b.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,b.jsx)(a8,{children:(0,b.jsx)(be,{className:"h-2 w-2 fill-current"})})}),c]}))).displayName=a7.displayName;let bi=c.forwardRef(({className:a,inset:c,...d},e)=>(0,b.jsx)(a4,{ref:e,className:(0,bf.f)("px-2 py-1.5 text-sm font-semibold",c&&"pl-8",a),...d}));bi.displayName=a4.displayName;let bj=c.forwardRef(({className:a,...c},d)=>(0,b.jsx)(a9,{ref:d,className:(0,bf.f)("-mx-1 my-1 h-px bg-muted",a),...c}));bj.displayName=a9.displayName;var bk=a.i(550194);function bl({mastery:a,timeRange:c,onMasteryChange:d,onTimeRangeChange:f}){let{t:g}=(0,bk.b)(),h=[{value:"all",label:g.filter.all||"All"},{value:"new",label:g.filter.review||"To Review"},{value:"reviewing",label:g.filter.reviewing||"Reviewing"},{value:"mastered",label:g.filter.mastered||"Mastered"}],i=[{value:"all",label:g.filter.allTime||"All Time"},{value:"week",label:g.filter.lastWeek||"Last Week"},{value:"month",label:g.filter.lastMonth||"Last Month"}];return(0,b.jsxs)(a0,{children:[(0,b.jsx)(a1,{asChild:!0,children:(0,b.jsxs)(e.f,{variant:"outline",size:"sm",className:"h-10",children:[(0,b.jsx)(s,{className:"mr-2 h-4 w-4"}),g.notebook.filter,(0,b.jsx)(r.f,{className:"ml-2 h-4 w-4"})]})}),(0,b.jsxs)(bg,{align:"end",className:"w-48",children:[(0,b.jsx)(bi,{children:g.filter.masteryStatus||"Mastery Status"}),h.map(({value:c,label:e})=>(0,b.jsxs)(bh,{onClick:()=>d(c),children:[a===c&&"✓ ",e]},c)),(0,b.jsx)(bj,{}),(0,b.jsx)(bi,{children:g.filter.timeRange||"Time Range"}),i.map(({value:a,label:d})=>(0,b.jsxs)(bh,{onClick:()=>f(a),children:[c===a&&"✓ ",d]},a))]})]})}function bm({value:a,onChange:c}){let{t:d}=(0,bk.b)(),f=[{value:"all",label:d.filter.all||"All"},{value:"a",label:d.editor.paperLevels?.a||"Paper A"},{value:"b",label:d.editor.paperLevels?.b||"Paper B"},{value:"other",label:d.editor.paperLevels?.other||"Other"}];return(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:f.map(d=>(0,b.jsx)(e.f,{variant:a===d.value?"default":"outline",size:"sm",className:"rounded-full",onClick:()=>c(d.value),children:d.label},d.value))})}var bn=a.i(781560),bo=a.i(633508),bp=a.i(596221),bq=a.i(814574),br=a.i(225949),bs=a.i(93907),bt=a.i(291938),bu=a.i(630534);function bv({ids:a}){let{t:d}=(0,bk.b)(),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(null),[k,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(0),[r,s]=a,t=()=>{m(!0),i(null),o(null),q(a=>a+1)};return(0,c.useEffect)(()=>{if(!f||!r||!s)return;let a=!0;return bt.f.post("/api/error-items/similarity",{ids:[r,s]}).then(b=>{a&&i(b)}).catch(b=>{a&&(o("Question text is required for similarity comparison"===b?.data?.message?d.questionSimilarity.missingText:d.questionSimilarity.failed),bu.f.error("[Similarity]","相似度比较失败",{error:b instanceof Error?b.message:String(b)}))}).finally(()=>{a&&m(!1)}),()=>{a=!1}},[f,r,s,p,d.questionSimilarity.failed,d.questionSimilarity.missingText]),(0,b.jsxs)(bq.N,{open:f,onOpenChange:a=>{g(a),a&&t()},children:[(0,b.jsx)(bq.a,{asChild:!0,children:(0,b.jsxs)(e.f,{variant:"outline",disabled:2!==a.length,title:d.questionSimilarity.selectTwo,children:[(0,b.jsx)(l,{className:"mr-2 h-4 w-4"}),d.questionSimilarity.title]})}),(0,b.jsxs)(bq.d,{className:"w-[calc(100vw-2rem)] sm:max-w-3xl max-h-[85vh] overflow-y-auto",children:[(0,b.jsxs)(bq.s,{children:[(0,b.jsx)(bq.F,{children:d.questionSimilarity.title}),(0,b.jsx)(bq.C,{children:d.questionSimilarity.description})]}),k&&(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",role:"status",children:[(0,b.jsx)(bp.f,{className:"h-4 w-4 animate-spin"}),d.common.loading]}),n&&(0,b.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:n}),n&&(0,b.jsx)(e.f,{variant:"outline",onClick:t,children:d.questionSimilarity.retry}),h&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted p-4",role:"status",children:[(0,b.jsx)("p",{className:"text-sm",children:d.questionSimilarity.score}),(0,b.jsxs)("p",{className:"text-3xl font-bold tabular-nums",children:[Number((100*h.similarity).toFixed(4)),"%"]}),(0,b.jsx)("p",{className:"text-sm",children:d.questionSimilarity.threshold.replace("{threshold}",String(h.threshold))}),(0,b.jsx)("p",{className:"text-sm font-medium",children:h.duplicate?d.questionSimilarity.duplicate:d.questionSimilarity.different})]}),(0,b.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:h.items.map((a,c)=>(0,b.jsxs)("div",{className:"min-w-0 space-y-2 rounded-lg border p-3",children:[(0,b.jsxs)(j.default,{href:`/error-items/${a.id}`,className:"text-sm font-medium text-primary hover:underline",children:[d.questionSimilarity.question.replace("{index}",String(c+1))," · ",a.shortId||"-"]}),a.notebookName&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a.notebookName}),(0,b.jsx)("div",{className:"max-h-56 overflow-auto text-sm",children:(0,b.jsx)(bs.f,{content:a.questionText})})]},a.id))})]}),(0,b.jsx)(br.f,{onSaved:t})]})]})}function bw({selectedIds:a,deleting:c,onCancel:d,onDelete:f}){let{t:g}=(0,bk.b)();return(0,b.jsx)("div",{className:"pb-safe fixed bottom-0 left-0 right-0 z-50 border-t bg-card/95 p-4 shadow-lg backdrop-blur",children:(0,b.jsxs)("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,b.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground",children:[(0,b.jsx)("p",{children:g.notebook.selectedCount.replace("{count}",String(a.length))}),(0,b.jsx)("p",{className:"text-xs",children:g.questionSimilarity.selectTwo})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(bv,{ids:a}),(0,b.jsxs)(e.f,{variant:"outline",onClick:d,children:[(0,b.jsx)(bo.X,{className:"mr-2 h-4 w-4"}),g.notebook.cancelSelect]}),(0,b.jsxs)(e.f,{variant:"destructive",onClick:f,disabled:0===a.length||c,children:[(0,b.jsx)(bn.f,{className:"mr-2 h-4 w-4"}),g.notebook.deleteSelected]})]})]})})}var bx=a.i(529759),by=a.i(986705),bz=a.i(580701),bA=a.i(957292);let bB={1:["一年级"],2:["二年级"],3:["三年级"],4:["四年级"],5:["五年级"],6:["六年级"],7:["七年级上","七年级下","七年级"],8:["八年级上","八年级下","八年级"],9:["九年级上","九年级下","九年级"],10:["高一上","高一下","高一"],11:["高二上","高二下","高二"],12:["高三上","高三下","高三"]};function bC({gradeSemester:a,tag:d,subjectName:e,onFilterChange:f,className:g}){let{t:h}=(0,bk.b)(),{timeZone:i}=(0,bx.M)(),[j,k]=(0,c.useState)(a||""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(d||""),[p,q]=(0,c.useState)([]),[r,s]=(0,c.useState)(!0),[t,u]=(0,c.useState)([]),[v,w]=(0,c.useState)(a);a!==v&&(w(a),void 0!==a&&k(a));let[x,y]=(0,c.useState)(d);d!==x&&(y(d),void 0!==d&&o(d||""));let z=(0,c.useCallback)((a,b)=>{let c=(0,by.c)(new Date,i),d=c.getFullYear(),e=(c.getMonth()+1>=9?d:d-1)-b+1;return"primary"===a?e:"junior_high"===a?e+6:"senior_high"===a?e+9:0},[i]),A=(0,c.useCallback)((a,b)=>{let c=[];return a?"primary"===a?c=[1,2,3,4,5,6]:"junior_high"===a?(c=[7,8,9],b&&z(a,b)>=10&&c.push(10,11,12)):c="senior_high"===a?[10,11,12]:[1,2,3,4,5,6,7,8,9,10,11,12]:c=[1,2,3,4,5,6,7,8,9,10,11,12],c.flatMap(a=>bB[a]||[])},[z]);(0,c.useEffect)(()=>{(async()=>{s(!0);try{let a=await bt.f.get("/api/user"),b=A(a.educationStage,a.enrollmentYear);u(b);let c=e?(0,bA.f)(e):"math";try{let a=await bt.f.get(`/api/tags?subject=${c}`);q(a.tags)}catch(a){bu.f.warn("[KnowledgeFilter]","Failed to fetch tags for subject",{subject:c,error:a}),q([])}}catch(a){bu.f.error("[KnowledgeFilter]","Failed to load filter data",{error:a})}finally{s(!1)}})()},[e,A]);let B=p.find(a=>a.name===j),C=B?.children||[],D=C.find(a=>a.name===l),E=a=>0===a.children.length?[a.name]:a.children.flatMap(a=>E(a)),F=D?[...new Set(E(D))]:[],G=t.filter(a=>p.some(b=>b.name===a));return(0,b.jsxs)("div",{className:`flex gap-2 ${g}`,children:[(0,b.jsxs)(bz.d,{value:j,onValueChange:a=>{k(a),m(""),o(""),f({gradeSemester:"all"===a?void 0:a,chapter:void 0,tag:void 0})},disabled:r,children:[(0,b.jsx)(bz.P,{className:"w-[140px]",children:(0,b.jsx)(bz.U,{placeholder:h.filter?.gradeShort||"Grade"})}),(0,b.jsxs)(bz.r,{children:[(0,b.jsx)(bz.T,{value:"all",children:h.filter?.allGrades||"All grades"}),G.map(a=>(0,b.jsx)(bz.T,{value:a,children:a},a))]})]}),(0,b.jsxs)(bz.d,{value:l,onValueChange:a=>{m(a),o(""),f({gradeSemester:"all"===j?void 0:j,chapter:"all"===a?void 0:a,tag:void 0})},disabled:!j||"all"===j,children:[(0,b.jsx)(bz.P,{className:"w-[180px]",children:(0,b.jsx)(bz.U,{placeholder:h.filter?.chapter||"Chapter"})}),(0,b.jsxs)(bz.r,{children:[(0,b.jsx)(bz.T,{value:"all",children:h.filter?.allChapters||"All chapters"}),C.map(a=>(0,b.jsx)(bz.T,{value:a.name,children:a.name.replace(/^第\d+章\s*/,"")},a.id))]})]}),(0,b.jsxs)(bz.d,{value:n,onValueChange:a=>{o(a),f({gradeSemester:"all"===j?void 0:j,chapter:"all"===l?void 0:l,tag:"all"===a?void 0:a})},disabled:!l||"all"===l,children:[(0,b.jsx)(bz.P,{className:"w-[140px]",children:(0,b.jsx)(bz.U,{placeholder:h.filter?.knowledgePoint||"Tag"})}),(0,b.jsxs)(bz.r,{children:[(0,b.jsx)(bz.T,{value:"all",children:h.filter?.allKnowledgePoints||"All tags"}),F.map(a=>(0,b.jsx)(bz.T,{value:a,children:a},a))]})]})]})}var bD=a.i(786304),bE=a.i(579834),bF=a.i(866718),bG=a.i(882524),bH=a.i(697902);function bI(a){let b=new URLSearchParams;return a.subjectId&&b.append("subjectId",a.subjectId),a.search&&b.append("query",a.search),"all"!==a.mastery&&b.append("mastery",a.mastery),"all"!==a.timeRange&&b.append("timeRange",a.timeRange),a.tag&&b.append("tag",a.tag),a.gradeSemester&&b.append("gradeSemester",a.gradeSemester),a.chapter&&b.append("chapter",a.chapter),"all"!==a.paperLevel&&b.append("paperLevel",a.paperLevel),b}var bJ=a.i(710302),bK=a.i(879188),bL=a.i(83715);function bM({subjectId:a,subjectName:f}={}){let{t:g}=(0,bk.b)(),h=(0,d.useRouter)(),[i,j]=(0,c.useState)([]),[k,r]=(0,c.useState)(!0),[s,t]=(0,c.useState)(""),[u,v]=(0,c.useState)("all"),[w,x]=(0,c.useState)("all"),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)(""),[C,D]=(0,c.useState)("all"),[E,F]=(0,c.useState)(null),[G,H]=(0,c.useState)(1),I=bH.$,[J,K]=(0,c.useState)(0),[L,M]=(0,c.useState)(0),[N,O]=(0,c.useState)(!1),[P,Q]=(0,c.useState)(new Set),[R,S]=(0,c.useState)(!1),T=(0,c.useMemo)(()=>({subjectId:a,search:s,mastery:u,timeRange:w,tag:E,gradeSemester:y,chapter:A,paperLevel:C}),[a,s,u,w,E,y,A,C]),U=()=>{O(!N),Q(new Set)},V=(0,c.useCallback)(async()=>{r(!0);try{let a=bI(T);a.append("page",G.toString()),a.append("pageSize",I.toString());let b=await bt.f.get(`/api/error-items/list?${a.toString()}`);j(b.items),K(b.total),M(b.totalPages)}catch(a){bu.f.error("[ErrorList]","Failed to fetch error items",{error:a})}finally{r(!1)}},[T,G,I]),W=async()=>{if(0===P.size)return;let a=(g.notebook?.confirmBatchDelete||"Delete {count} items?").replace("{count}",P.size.toString());if(await (0,bJ.u)(a,{destructive:!0})){S(!0);try{await bt.f.post("/api/error-items/batch-delete",{ids:Array.from(P)}),bJ.c.success(g.notebook?.batchDeleteSuccess||"Deleted successfully"),O(!1),Q(new Set),V()}catch(a){bu.f.error("[ErrorList]","Batch delete failed",{error:a}),bJ.c.error(g.common?.messages?.deleteFailed||"Delete failed")}finally{S(!1)}}},X=(0,c.useRef)(T);return(0,c.useEffect)(()=>{let a=X.current!==T;(X.current=T,a&&1!==G)?H(1):V()},[G,T,V]),(0,b.jsxs)("div",{className:`space-y-6 ${N?"pb-40 sm:pb-24":""}`,children:[(0,b.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row",children:[(0,b.jsxs)("div",{className:"relative w-full lg:flex-1",children:[(0,b.jsx)(p,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(bF.f,{placeholder:g.notebook.search,title:g.shortId.searchHint,className:"h-10 rounded-xl bg-card pl-9",value:s,onChange:a=>t(a.target.value),onKeyDown:async a=>{let b=s.trim();if("Enter"!==a.key||!(0,bL.f)(b))return;let c=await (0,bK.f)(b);c&&h.push(`/error-items/${c}`)}})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(bl,{mastery:u,timeRange:w,onMasteryChange:v,onTimeRangeChange:x}),(0,b.jsxs)(e.f,{variant:"outline",size:"sm",className:"h-10",onClick:()=>h.push(`/print-preview?${bI(T).toString()}`),children:[(0,b.jsx)(o.f,{className:"mr-2 h-4 w-4"}),g.notebook?.exportPrint||"Export for Print"]}),!N&&(0,b.jsxs)(e.f,{variant:"outline",size:"sm",className:"h-10",onClick:U,children:[(0,b.jsx)(l,{className:"mr-2 h-4 w-4"}),g.questionSimilarity.title]}),(0,b.jsxs)(e.f,{variant:N?"secondary":"outline",size:"sm",className:"h-10",onClick:U,children:[(0,b.jsx)(n.f,{className:"mr-2 h-4 w-4"}),N?g.notebook?.cancelSelect||"Cancel":g.notebook?.selectMode||"Select"]})]})]}),(0,b.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-stretch sm:items-center",children:[(0,b.jsx)("div",{className:"w-full sm:w-auto",children:(0,b.jsx)(bC,{gradeSemester:y,tag:E,onFilterChange:({gradeSemester:a,chapter:b,tag:c})=>{void 0!==a&&z(a),void 0!==b&&B(b),F(void 0===c?null:c),a?b||B(""):(z(""),B(""),F(null)),H(1)},subjectName:f})}),(0,b.jsx)(bm,{value:C,onChange:D})]}),E&&(0,b.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg",children:[(0,b.jsxs)("span",{className:"text-sm text-muted-foreground",children:[g.filter.filteringByTag||"Filtering by tag",":"]}),(0,b.jsxs)(bD.f,{variant:"secondary",className:"cursor-pointer",onClick:()=>F(null),children:[E,(0,b.jsx)("span",{className:"ml-1 text-xs",children:"×"})]})]}),!k&&0===i.length&&(0,b.jsx)(bE.f,{icon:m,title:g.notebook.emptyList,description:g.notebook.emptyListHint}),k&&0===i.length&&(0,b.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6},(a,c)=>(0,b.jsx)("div",{className:"h-44 animate-pulse rounded-2xl bg-muted"},c))}),(0,b.jsx)("div",{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-3 transition-opacity ${k?"opacity-60":""}`,children:i.map(a=>(0,b.jsx)(q.f,{item:a,selectMode:N,selected:P.has(a.id),onToggleSelect:()=>{var b;return b=a.id,void Q(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},selectedTag:E,onTagClick:a=>F(E===a?null:a)},a.id))}),(0,b.jsx)(bG.f,{page:G,totalPages:L,total:J,pageSize:I,onPageChange:H}),N&&(0,b.jsx)(bw,{selectedIds:[...P],deleting:R,onCancel:U,onDelete:W})]})}var bN=a.i(73556),bO=a.i(808406);function bP({notebookId:a,onFinished:d}){let{t:f}=(0,bk.b)(),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(null),k=(0,c.useRef)(!1),l=(0,c.useCallback)(()=>{bt.f.get(`/api/notebooks/${a}/retag`).then(a=>{k.current&&a&&!a.running&&d?.(),k.current=!!a?.running,h(a)}).catch(()=>void 0)},[a,d]);(0,c.useEffect)(l,[l]),(0,c.useEffect)(()=>{if(!g?.running)return;let a=setTimeout(l,2e3);return()=>clearTimeout(a)},[g,l]);let m=async()=>{if(await (0,bJ.u)(f.retag.notebookConfirm)){j(null);try{let b=await bt.f.post(`/api/notebooks/${a}/retag`,{});if(0===b.total)return void j(f.retag.empty);k.current=b.running,h(b)}catch{j(f.retag.itemFailed)}}},n=i??(g?.running?f.retag.progress.replace("{done}",String(g.done)).replace("{total}",String(g.total)):g?.finishedAt&&g.total>0?f.retag.finished.replace("{success}",String(g.total-g.failed)).replace("{failed}",String(g.failed)):null);return(0,b.jsxs)("div",{className:"flex flex-col items-start sm:items-end gap-1",children:[(0,b.jsxs)(e.f,{variant:"outline",size:"sm",onClick:m,disabled:g?.running,"aria-label":f.retag.notebookButton,children:[g?.running?(0,b.jsx)(bp.f,{className:"h-4 w-4 animate-spin sm:mr-2"}):(0,b.jsx)(bO.f,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:f.retag.notebookButton})]}),n&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:n})]})}var bQ=a.i(468368),bR=a.i(557999);a.s(["default",0,function(){let a=(0,d.useParams)(),k=(0,d.useRouter)(),{t:l}=(0,bk.b)(),[m,n]=(0,c.useState)(null);(0,bR.f)(l.notebooks.title,m?.name);let[o,p]=(0,c.useState)(!0),[q,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(0),u=(0,c.useCallback)(async a=>{try{let b=await bt.f.get(`/api/notebooks/${a}`);n(b)}catch(a){bu.f.error("[NotebookDetail]","Failed to fetch notebook",{error:a}),bJ.c.error(l.notebooks?.notFound||"Notebook not found"),k.push("/notebooks")}finally{p(!1)}},[k,l]);(0,c.useEffect)(()=>{a.id&&u(a.id)},[a.id,u]);let v=async a=>{m&&n(await bt.f.put(`/api/notebooks/${m.id}`,{name:a}))};return o?(0,b.jsx)(g.f,{label:l.common.loading}):m?(0,b.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(f.f,{backHref:"/notebooks",title:m.name,titleAddon:(0,b.jsx)(e.f,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground",onClick:()=>r(!0),title:l.notebooks?.rename||"Rename",children:(0,b.jsx)(i.f,{className:"h-4 w-4"})}),description:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(bQ.E,{notebook:m})," · ",(l.notebooks?.totalErrors||"Total {count} errors").replace("{count}",(m._count?.errorItems||0).toString())]}),actions:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(bP,{notebookId:m.id,onFinished:()=>t(a=>a+1)}),(0,b.jsx)(j.default,{href:`/notebooks/${m.id}/add`,children:(0,b.jsxs)(e.f,{"aria-label":l.notebooks?.addError||"Add Error",children:[(0,b.jsx)(h.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:l.notebooks?.addError||"Add Error"})]})})]})}),(0,b.jsx)(bM,{subjectId:m.id,subjectName:m.name},s),(0,b.jsx)(bN.f,{open:q,onOpenChange:r,currentName:m.name,onRename:v})]})}):null}],701453)}];
1
+ module.exports=[701453,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(699570),f=a.i(251538),g=a.i(506376),h=a.i(915618),i=a.i(170106);let j=(0,i.f)("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"}]]);var k=a.i(781560),l=a.i(238246);let m=(0,i.f)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),n=(0,i.f)("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);var o=a.i(755023),p=a.i(771931);let q=(0,i.f)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var r=a.i(263323),s=a.i(405784);let t=(0,i.f)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);var u=a.i(507554),v=a.i(470121),w=a.i(750104),x=a.i(225152),y=a.i(30553),z=a.i(37738),A=a.i(507827),B=a.i(596743),C=a.i(486228),D=a.i(422297),E=a.i(392843),F=a.i(704691),G=a.i(692616),H=a.i(777192),I=a.i(224050),J=a.i(811011),K=a.i(746872),L=a.i(241852),M=a.i(152081),N=Object.defineProperty,O=(a,b)=>N(a,"name",{value:b,configurable:!0}),P=["Enter"," "],Q=["ArrowUp","PageDown","End"],R=["ArrowDown","PageUp","Home",...Q],S={ltr:[...P,"ArrowRight"],rtl:[...P,"ArrowLeft"]},T={ltr:["ArrowLeft"],rtl:["ArrowRight"]},U="Menu",[V,W,X]=(0,z.f)(U),[Y,Z]=(0,w.f)(U,[X,F.y,I.B]),$=(0,F.y)(),_=(0,I.B)(),[aa,ab]=Y(U),[ac,ad]=Y(U),ae=O(a=>{let{__scopeMenu:d,open:e=!1,children:f,dir:g,onOpenChange:h,modal:i=!0}=a,j=$(d),[k,l]=c.useState(null),m=c.useRef(!1),n=(0,K.f)(h),o=(0,A.f)(g);return c.useEffect(()=>{let a=O(()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},"handleKeyDown"),b=O(()=>m.current=!1,"handlePointer");return document.addEventListener("keydown",a,{capture:!0}),()=>{document.removeEventListener("keydown",a,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),c.useEffect(()=>{if(!e)return;let a=O(()=>n(!1),"handleBlur");return window.addEventListener("blur",a),()=>window.removeEventListener("blur",a)},[e,n]),(0,b.jsx)(F.F,{...j,children:(0,b.jsx)(aa,{scope:d,open:e,onOpenChange:n,content:k,onContentChange:l,children:(0,b.jsx)(ac,{scope:d,onClose:c.useCallback(()=>n(!1),[n]),isUsingKeyboardRef:m,dir:o,modal:i,children:f})})})},"Menu"),af=c.forwardRef(O(function(a,c){let{__scopeMenu:d,...e}=a,f=$(d);return(0,b.jsx)(F.g,{...f,...e,ref:c})},"MenuAnchor")),ag="MenuPortal",[ah,ai]=Y(ag,{forceMount:void 0}),aj=O(a=>{let{__scopeMenu:c,forceMount:d,children:e,container:f}=a,g=ab(ag,c);return(0,b.jsx)(ah,{scope:c,forceMount:d,children:(0,b.jsx)(H.f,{present:d||g.open,children:(0,b.jsx)(G.f,{asChild:!0,container:f,children:e})})})},"MenuPortal"),ak="MenuContent",[al,am]=Y(ak),an=c.forwardRef(O(function(a,c){let d=ai(ak,a.__scopeMenu),{forceMount:e=d.forceMount,...f}=a,g=ab(ak,a.__scopeMenu),h=ad(ak,a.__scopeMenu);return(0,b.jsx)(V.Provider,{scope:a.__scopeMenu,children:(0,b.jsx)(H.f,{present:e||g.open,children:(0,b.jsx)(V.Slot,{scope:a.__scopeMenu,children:h.modal?(0,b.jsx)(ao,{...f,ref:c}):(0,b.jsx)(ap,{...f,ref:c})})})})},"MenuContent")),ao=c.forwardRef(O(function(a,d){let e=ab(ak,a.__scopeMenu),f=c.useRef(null),g=(0,v.f)(d,f);return c.useEffect(()=>{let a=f.current;if(a)return(0,L.f)(a)},[]),(0,b.jsx)(ar,{...a,ref:g,trapFocus:e.open,disableOutsidePointerEvents:e.open,disableOutsideScroll:!0,onFocusOutside:(0,u.f)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>e.onOpenChange(!1)})},"MenuRootContentModal")),ap=c.forwardRef(O(function(a,c){let d=ab(ak,a.__scopeMenu);return(0,b.jsx)(ar,{...a,ref:c,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>d.onOpenChange(!1)})},"MenuRootContentNonModal")),aq=(0,J.B)("MenuContent.ScrollLock"),ar=c.forwardRef(O(function(a,d){let{__scopeMenu:e,loop:f=!1,trapFocus:g,onOpenAutoFocus:h,onCloseAutoFocus:i,disableOutsidePointerEvents:j,onEntryFocus:k,onEscapeKeyDown:l,onPointerDownOutside:m,onFocusOutside:n,onInteractOutside:o,onDismiss:p,disableOutsideScroll:q,...r}=a,s=ab(ak,e),t=ad(ak,e),w=$(e),x=_(e),y=W(e),[z,A]=c.useState(null),E=c.useRef(null),[G,H]=c.useState(null);(0,D.i)(G);let{nodes:J,registry:K}=(0,D.D)(),L=!!(g||q),N=(0,v.f)(d,E,s.onContentChange,H),P=c.useRef(0),S=c.useRef(""),T=c.useRef(0),U=c.useRef(null),V=c.useRef("right"),X=c.useRef(0),Y=c.useMemo(()=>q?[E,...J.map(a=>({current:a}))]:[],[E,J,q]),Z=q?M.f:c.Fragment,aa=O(a=>{let b=S.current+a,c=y().filter(a=>!a.disabled),d=document.activeElement,e=c.find(a=>a.ref.current===d)?.textValue,f=aR(c.map(a=>a.textValue),b,e),g=c.find(a=>a.textValue===f)?.ref.current;function h(a){S.current=a,window.clearTimeout(P.current),""!==a&&(P.current=window.setTimeout(()=>h(""),1e3))}O(h,"updateSearch"),h(b),g&&setTimeout(()=>g.focus())},"handleTypeaheadSearch");c.useEffect(()=>()=>window.clearTimeout(P.current),[]),(0,C.f)();let ac=c.useCallback(a=>V.current===U.current?.side&&aT(a,U.current?.area),[]);return(0,b.jsx)(al,{scope:e,searchRef:S,onItemEnter:c.useCallback(a=>{ac(a)&&a.preventDefault()},[ac]),onItemLeave:c.useCallback(a=>{ac(a)||(E.current?.focus(),A(null))},[ac]),onTriggerLeave:c.useCallback(a=>{ac(a)&&a.preventDefault()},[ac]),pointerGraceTimerRef:T,onPointerGraceIntentChange:c.useCallback(a=>{U.current=a},[]),children:(0,b.jsx)(D.l,{registry:L?K:null,children:(0,b.jsx)(Z,{...q?{as:aq,allowPinchZoom:!0,shards:Y}:void 0,children:(0,b.jsx)(D.v,{asChild:!0,trapped:g,branches:J,onMountAutoFocus:(0,u.f)(h,a=>{a.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,b.jsx)(B.V,{asChild:!0,disableOutsidePointerEvents:j,onEscapeKeyDown:l,onPointerDownOutside:m,onFocusOutside:n,onInteractOutside:o,onDismiss:p,children:(0,b.jsx)(I.F,{asChild:!0,...x,dir:t.dir,orientation:"vertical",loop:f,currentTabStopId:z,onCurrentTabStopIdChange:A,onEntryFocus:(0,u.f)(k,a=>{t.isUsingKeyboardRef.current||a.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,b.jsx)(F.c,{role:"menu","aria-orientation":"vertical","data-state":aM(s.open),"data-radix-menu-content":"",dir:t.dir,...w,...r,ref:N,style:{outline:"none",...r.style},onKeyDown:(0,u.f)(r.onKeyDown,a=>{let b=a.target.closest("[data-radix-menu-content]")===a.currentTarget,c=a.ctrlKey||a.altKey||a.metaKey,d=1===a.key.length;b&&("Tab"===a.key&&a.preventDefault(),!c&&d&&aa(a.key));let e=E.current;if(a.target!==e||!R.includes(a.key))return;a.preventDefault();let f=y().filter(a=>!a.disabled).map(a=>a.ref.current);Q.includes(a.key)&&f.reverse(),aP(f)}),onBlur:(0,u.f)(a.onBlur,a=>{a.currentTarget.contains(a.target)||(window.clearTimeout(P.current),S.current="")}),onPointerMove:(0,u.f)(a.onPointerMove,aU(a=>{let b=a.target,c=X.current!==a.clientX;a.currentTarget.contains(b)&&c&&(V.current=a.clientX>X.current?"right":"left",X.current=a.clientX)}))})})})})})})})},"MenuContentImpl")),as=c.forwardRef(O(function(a,c){let{__scopeMenu:d,...e}=a;return(0,b.jsx)(y.V.div,{...e,ref:c})},"MenuLabel")),at="MenuItem",au="menu.itemSelect",av=c.forwardRef(O(function(a,d){let{disabled:e=!1,onSelect:f,...g}=a,h=c.useRef(null),i=ad(at,a.__scopeMenu),j=am(at,a.__scopeMenu),k=(0,v.f)(d,h),l=c.useRef(!1),m=O(()=>{let a=h.current;if(!e&&a){let b=new CustomEvent(au,{bubbles:!0,cancelable:!0});a.addEventListener(au,a=>f?.(a),{once:!0}),(0,y.u)(a,b),b.defaultPrevented?l.current=!1:i.onClose()}},"handleSelect");return(0,b.jsx)(aw,{...g,ref:k,disabled:e,onClick:(0,u.f)(a.onClick,m),onPointerDown:b=>{a.onPointerDown?.(b),l.current=!0},onPointerUp:(0,u.f)(a.onPointerUp,a=>{l.current||a.currentTarget?.click()}),onKeyDown:(0,u.f)(a.onKeyDown,a=>{e||a.target!==a.currentTarget||(""===j.searchRef.current||" "!==a.key)&&P.includes(a.key)&&(a.currentTarget.click(),a.preventDefault())})})},"MenuItem")),aw=c.forwardRef(O(function(a,d){let{__scopeMenu:e,disabled:f=!1,textValue:g,...h}=a,i=am(at,e),j=_(e),k=c.useRef(null),l=(0,v.f)(d,k),[m,n]=c.useState(!1),[o,p]=c.useState("");return c.useEffect(()=>{let a=k.current;a&&p((a.textContent??"").trim())},[h.children]),(0,b.jsx)(V.ItemSlot,{scope:e,disabled:f,textValue:g??o,children:(0,b.jsx)(I.M,{asChild:!0,...j,focusable:!f,children:(0,b.jsx)(y.V.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":f||void 0,"data-disabled":f?"":void 0,...h,ref:l,onPointerMove:(0,u.f)(a.onPointerMove,aU(a=>{f?i.onItemLeave(a):(i.onItemEnter(a),a.defaultPrevented||a.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,u.f)(a.onPointerLeave,aU(a=>i.onItemLeave(a))),onFocus:(0,u.f)(a.onFocus,()=>n(!0)),onBlur:(0,u.f)(a.onBlur,()=>n(!1))})})})},"MenuItemImpl")),ax=c.forwardRef(O(function(a,c){let{checked:d=!1,onCheckedChange:e,...f}=a;return(0,b.jsx)(aC,{scope:a.__scopeMenu,checked:d,children:(0,b.jsx)(av,{role:"menuitemcheckbox","aria-checked":aN(d)?"mixed":d,...f,ref:c,"data-state":aO(d),onSelect:(0,u.f)(f.onSelect,()=>e?.(!!aN(d)||!d),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),[ay,az]=Y("MenuRadioGroup",{value:void 0,onValueChange:O(()=>{},"onValueChange")}),aA=c.forwardRef(O(function(a,c){let{value:d,...e}=a,f=az("MenuRadioItem",a.__scopeMenu),g=d===f.value;return(0,b.jsx)(aC,{scope:a.__scopeMenu,checked:g,children:(0,b.jsx)(av,{role:"menuitemradio","aria-checked":g,...e,ref:c,"data-state":aO(g),onSelect:(0,u.f)(e.onSelect,()=>f.onValueChange?.(d),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),aB="MenuItemIndicator",[aC,aD]=Y(aB,{checked:!1}),aE=c.forwardRef(O(function(a,c){let{__scopeMenu:d,forceMount:e,...f}=a,g=aD(aB,d);return(0,b.jsx)(H.f,{present:e||aN(g.checked)||!0===g.checked,children:(0,b.jsx)(y.V.span,{...f,ref:c,"data-state":aO(g.checked)})})},"MenuItemIndicator")),aF=c.forwardRef(O(function(a,c){let{__scopeMenu:d,...e}=a;return(0,b.jsx)(y.V.div,{role:"separator","aria-orientation":"horizontal",...e,ref:c})},"MenuSeparator")),aG="MenuSub",[aH,aI]=Y(aG),aJ=(a=>{let{__scopeMenu:d,children:e,open:f=!1,onOpenChange:g}=a,h=ab(aG,d),i=$(d),[j,k]=c.useState(null),[l,m]=c.useState(null),n=(0,K.f)(g);return c.useEffect(()=>(!1===h.open&&n(!1),()=>n(!1)),[h.open,n]),(0,b.jsx)(F.F,{...i,children:(0,b.jsx)(aa,{scope:d,open:f,onOpenChange:n,content:l,onContentChange:m,children:(0,b.jsx)(aH,{scope:d,contentId:(0,E.f)(),triggerId:(0,E.f)(),trigger:j,onTriggerChange:k,children:e})})})},"MenuSubTrigger"),aK=c.forwardRef(O(function(a,d){let e=ab(aJ,a.__scopeMenu),f=ad(aJ,a.__scopeMenu),g=aI(aJ,a.__scopeMenu),h=am(aJ,a.__scopeMenu),i=c.useRef(null),{pointerGraceTimerRef:j,onPointerGraceIntentChange:k}=h,l={__scopeMenu:a.__scopeMenu},m=c.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);c.useEffect(()=>m,[m]),c.useEffect(()=>{let a=j.current;return()=>{window.clearTimeout(a),k(null)}},[j,k]);let n=(0,v.f)(d,g.onTriggerChange);return(0,b.jsx)(af,{asChild:!0,...l,children:(0,b.jsx)(aw,{id:g.triggerId,"aria-haspopup":"menu","aria-expanded":e.open,"aria-controls":e.open?g.contentId:void 0,"data-state":aM(e.open),...a,ref:n,onClick:b=>{a.onClick?.(b),a.disabled||b.defaultPrevented||(b.currentTarget.focus(),e.open||e.onOpenChange(!0))},onPointerMove:(0,u.f)(a.onPointerMove,aU(b=>{h.onItemEnter(b),!b.defaultPrevented&&(a.disabled||e.open||i.current||(h.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{e.onOpenChange(!0),m()},100)))})),onPointerLeave:(0,u.f)(a.onPointerLeave,aU(a=>{m();let b=e.content?.getBoundingClientRect();if(b){let c=e.content?.dataset.side,d="right"===c,f=b[d?"left":"right"],g=b[d?"right":"left"];h.onPointerGraceIntentChange({area:[{x:a.clientX+(d?-5:5),y:a.clientY},{x:f,y:b.top},{x:g,y:b.top},{x:g,y:b.bottom},{x:f,y:b.bottom}],side:c}),window.clearTimeout(j.current),j.current=window.setTimeout(()=>h.onPointerGraceIntentChange(null),300)}else{if(h.onTriggerLeave(a),a.defaultPrevented)return;h.onPointerGraceIntentChange(null)}})),onKeyDown:(0,u.f)(a.onKeyDown,b=>{a.disabled||b.target!==b.currentTarget||(""===h.searchRef.current||" "!==b.key)&&S[f.dir].includes(b.key)&&(e.onOpenChange(!0),e.content?.focus(),b.preventDefault())})})})},"MenuSubTrigger")),aL=c.forwardRef(O(function(a,d){let e=ai(ak,a.__scopeMenu),{forceMount:f=e.forceMount,align:g="start",...h}=a,i=ab(ak,a.__scopeMenu),j=ad(ak,a.__scopeMenu),k=aI("MenuSubContent",a.__scopeMenu),l=c.useRef(null),m=(0,v.f)(d,l);return(0,b.jsx)(V.Provider,{scope:a.__scopeMenu,children:(0,b.jsx)(H.f,{present:f||i.open,children:(0,b.jsx)(V.Slot,{scope:a.__scopeMenu,children:(0,b.jsx)(ar,{id:k.contentId,"aria-labelledby":k.triggerId,...h,ref:m,align:g,side:"rtl"===j.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:a=>{j.isUsingKeyboardRef.current&&l.current?.focus(),a.preventDefault()},onCloseAutoFocus:a=>a.preventDefault(),onFocusOutside:(0,u.f)(a.onFocusOutside,a=>{a.target!==k.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:(0,u.f)(a.onEscapeKeyDown,a=>{j.onClose(),a.preventDefault()}),onKeyDown:(0,u.f)(a.onKeyDown,a=>{let b=a.currentTarget.contains(a.target),c=T[j.dir].includes(a.key);b&&c&&(i.onOpenChange(!1),k.trigger?.focus(),a.preventDefault())})})})})})},"MenuSubContent"));function aM(a){return a?"open":"closed"}function aN(a){return"indeterminate"===a}function aO(a){return aN(a)?"indeterminate":a?"checked":"unchecked"}function aP(a){let b=document.activeElement;for(let c of a)if(c===b||(c.focus(),document.activeElement!==b))return}function aQ(a,b){return a.map((c,d)=>a[(b+d)%a.length])}function aR(a,b,c){let d=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,e=c?a.indexOf(c):-1,f=aQ(a,Math.max(e,0));1===d.length&&(f=f.filter(a=>a!==c));let g=f.find(a=>a.toLowerCase().startsWith(d.toLowerCase()));return g!==c?g:void 0}function aS(a,b){let{x:c,y:d}=a,e=!1;for(let a=0,f=b.length-1;a<b.length;f=a++){let g=b[a],h=b[f],i=g.x,j=g.y,k=h.x,l=h.y;j>d!=l>d&&c<(k-i)*(d-j)/(l-j)+i&&(e=!e)}return e}function aT(a,b){return!!b&&aS({x:a.clientX,y:a.clientY},b)}function aU(a){return b=>"mouse"===b.pointerType?a(b):void 0}O(aM,"getOpenState"),O(aN,"isIndeterminate"),O(aO,"getCheckedState"),O(aP,"focusFirst"),O(aQ,"wrapArray"),O(aR,"getNextMatch"),O(aS,"isPointInPolygon"),O(aT,"isPointerInGraceArea"),O(aU,"whenMouse");var aV=Object.defineProperty,aW=(a,b)=>aV(a,"name",{value:b,configurable:!0}),aX="DropdownMenu",[aY,aZ]=(0,w.f)(aX,[Z]),a$=Z(),[a_,a0]=aY(aX),a1=aW(a=>{let{__scopeDropdownMenu:d,children:e,dir:f,open:g,defaultOpen:h,onOpenChange:i,modal:j=!0}=a,k=a$(d),l=c.useRef(null),[m,n]=(0,x.f)({prop:g,defaultProp:h??!1,onChange:i,caller:aX});return(0,b.jsx)(a_,{scope:d,triggerId:(0,E.f)(),triggerRef:l,contentId:(0,E.f)(),open:m,onOpenChange:n,onOpenToggle:c.useCallback(()=>n(a=>!a),[n]),modal:j,children:(0,b.jsx)(ae,{...k,open:m,onOpenChange:n,dir:f,modal:j,children:e})})},"DropdownMenu"),a2=c.forwardRef(aW(function(a,c){let{__scopeDropdownMenu:d,disabled:e=!1,...f}=a,g=a0("DropdownMenuTrigger",d),h=a$(d),i=(0,v.f)(c,g.triggerRef);return(0,b.jsx)(af,{asChild:!0,...h,children:(0,b.jsx)(y.V.button,{type:"button",id:g.triggerId,"aria-haspopup":"menu","aria-expanded":g.open,"aria-controls":g.open?g.contentId:void 0,"data-state":g.open?"open":"closed","data-disabled":e?"":void 0,disabled:e,...f,ref:i,onPointerDown:(0,u.f)(a.onPointerDown,a=>{!e&&0===a.button&&!1===a.ctrlKey&&(g.onOpenToggle(),g.open||a.preventDefault())}),onKeyDown:(0,u.f)(a.onKeyDown,a=>{!e&&(["Enter"," "].includes(a.key)&&g.onOpenToggle(),"ArrowDown"===a.key&&g.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})},"DropdownMenuTrigger")),a3=aW(a=>{let{__scopeDropdownMenu:c,...d}=a,e=a$(c);return(0,b.jsx)(aj,{...e,...d})},"DropdownMenuPortal"),a4=c.forwardRef(aW(function(a,d){let{__scopeDropdownMenu:e,...f}=a,g=a0("DropdownMenuContent",e),h=a$(e),i=c.useRef(!1);return(0,b.jsx)(an,{id:g.contentId,"aria-labelledby":g.triggerId,...h,...f,ref:d,onCloseAutoFocus:(0,u.f)(a.onCloseAutoFocus,a=>{i.current||g.triggerRef.current?.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:(0,u.f)(a.onInteractOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey,d=2===b.button||c;(!g.modal||d)&&(i.current=!0)}),style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),a5=c.forwardRef(aW(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=a$(d);return(0,b.jsx)(as,{...f,...e,ref:c})},"DropdownMenuLabel")),a6=c.forwardRef(aW(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=a$(d);return(0,b.jsx)(av,{...f,...e,ref:c})},"DropdownMenuItem")),a7=c.forwardRef(aW(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=a$(d);return(0,b.jsx)(ax,{...f,...e,ref:c})},"DropdownMenuCheckboxItem")),a8=c.forwardRef(aW(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=a$(d);return(0,b.jsx)(aA,{...f,...e,ref:c})},"DropdownMenuRadioItem")),a9=c.forwardRef(aW(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=a$(d);return(0,b.jsx)(aE,{...f,...e,ref:c})},"DropdownMenuItemIndicator")),ba=c.forwardRef(aW(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=a$(d);return(0,b.jsx)(aF,{...f,...e,ref:c})},"DropdownMenuSeparator")),bb=c.forwardRef(aW(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=a$(d);return(0,b.jsx)(aK,{...f,...e,ref:c})},"DropdownMenuSubTrigger")),bc=c.forwardRef(aW(function(a,c){let{__scopeDropdownMenu:d,...e}=a,f=a$(d);return(0,b.jsx)(aL,{...f,...e,ref:c,style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),bd=a.i(533441),be=a.i(50522);let bf=(0,i.f)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var bg=a.i(368114);(c.forwardRef(({className:a,inset:c,children:d,...e},f)=>(0,b.jsxs)(bb,{ref:f,className:(0,bg.f)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",c&&"pl-8",a),...e,children:[d,(0,b.jsx)(be.f,{className:"ml-auto h-4 w-4"})]}))).displayName=bb.displayName,(c.forwardRef(({className:a,...c},d)=>(0,b.jsx)(bc,{ref:d,className:(0,bg.f)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...c}))).displayName=bc.displayName;let bh=c.forwardRef(({className:a,sideOffset:c=4,...d},e)=>(0,b.jsx)(a3,{children:(0,b.jsx)(a4,{ref:e,sideOffset:c,className:(0,bg.f)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...d})}));bh.displayName=a4.displayName;let bi=c.forwardRef(({className:a,inset:c,...d},e)=>(0,b.jsx)(a6,{ref:e,className:(0,bg.f)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",c&&"pl-8",a),...d}));bi.displayName=a6.displayName,(c.forwardRef(({className:a,children:c,checked:d,...e},f)=>(0,b.jsxs)(a7,{ref:f,className:(0,bg.f)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:d,...e,children:[(0,b.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,b.jsx)(a9,{children:(0,b.jsx)(bd.f,{className:"h-4 w-4"})})}),c]}))).displayName=a7.displayName,(c.forwardRef(({className:a,children:c,...d},e)=>(0,b.jsxs)(a8,{ref:e,className:(0,bg.f)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...d,children:[(0,b.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,b.jsx)(a9,{children:(0,b.jsx)(bf,{className:"h-2 w-2 fill-current"})})}),c]}))).displayName=a8.displayName;let bj=c.forwardRef(({className:a,inset:c,...d},e)=>(0,b.jsx)(a5,{ref:e,className:(0,bg.f)("px-2 py-1.5 text-sm font-semibold",c&&"pl-8",a),...d}));bj.displayName=a5.displayName;let bk=c.forwardRef(({className:a,...c},d)=>(0,b.jsx)(ba,{ref:d,className:(0,bg.f)("-mx-1 my-1 h-px bg-muted",a),...c}));bk.displayName=ba.displayName;var bl=a.i(550194);function bm({mastery:a,timeRange:c,onMasteryChange:d,onTimeRangeChange:f}){let{t:g}=(0,bl.b)(),h=[{value:"all",label:g.filter.all||"All"},{value:"new",label:g.filter.review||"To Review"},{value:"reviewing",label:g.filter.reviewing||"Reviewing"},{value:"mastered",label:g.filter.mastered||"Mastered"}],i=[{value:"all",label:g.filter.allTime||"All Time"},{value:"week",label:g.filter.lastWeek||"Last Week"},{value:"month",label:g.filter.lastMonth||"Last Month"}];return(0,b.jsxs)(a1,{children:[(0,b.jsx)(a2,{asChild:!0,children:(0,b.jsxs)(e.f,{variant:"outline",size:"sm",className:"h-10",children:[(0,b.jsx)(t,{className:"mr-2 h-4 w-4"}),g.notebook.filter,(0,b.jsx)(s.f,{className:"ml-2 h-4 w-4"})]})}),(0,b.jsxs)(bh,{align:"end",className:"w-48",children:[(0,b.jsx)(bj,{children:g.filter.masteryStatus||"Mastery Status"}),h.map(({value:c,label:e})=>(0,b.jsxs)(bi,{onClick:()=>d(c),children:[a===c&&"✓ ",e]},c)),(0,b.jsx)(bk,{}),(0,b.jsx)(bj,{children:g.filter.timeRange||"Time Range"}),i.map(({value:a,label:d})=>(0,b.jsxs)(bi,{onClick:()=>f(a),children:[c===a&&"✓ ",d]},a))]})]})}function bn({value:a,onChange:c}){let{t:d}=(0,bl.b)(),f=[{value:"all",label:d.filter.all||"All"},{value:"a",label:d.editor.paperLevels?.a||"Paper A"},{value:"b",label:d.editor.paperLevels?.b||"Paper B"},{value:"other",label:d.editor.paperLevels?.other||"Other"}];return(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:f.map(d=>(0,b.jsx)(e.f,{variant:a===d.value?"default":"outline",size:"sm",className:"rounded-full",onClick:()=>c(d.value),children:d.label},d.value))})}var bo=a.i(633508),bp=a.i(596221),bq=a.i(814574),br=a.i(225949),bs=a.i(93907),bt=a.i(291938),bu=a.i(630534);function bv({ids:a}){let{t:d}=(0,bl.b)(),[f,g]=(0,c.useState)(!1),[h,i]=(0,c.useState)(null),[j,k]=(0,c.useState)(!1),[n,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(0),[r,s]=a,t=()=>{k(!0),i(null),o(null),q(a=>a+1)};return(0,c.useEffect)(()=>{if(!f||!r||!s)return;let a=!0;return bt.f.post("/api/error-items/similarity",{ids:[r,s]}).then(b=>{a&&i(b)}).catch(b=>{a&&(o("Question text is required for similarity comparison"===b?.data?.message?d.questionSimilarity.missingText:d.questionSimilarity.failed),bu.f.error("[Similarity]","相似度比较失败",{error:b instanceof Error?b.message:String(b)}))}).finally(()=>{a&&k(!1)}),()=>{a=!1}},[f,r,s,p,d.questionSimilarity.failed,d.questionSimilarity.missingText]),(0,b.jsxs)(bq.N,{open:f,onOpenChange:a=>{g(a),a&&t()},children:[(0,b.jsx)(bq.a,{asChild:!0,children:(0,b.jsxs)(e.f,{variant:"outline",disabled:2!==a.length,title:d.questionSimilarity.selectTwo,children:[(0,b.jsx)(m,{className:"mr-2 h-4 w-4"}),d.questionSimilarity.title]})}),(0,b.jsxs)(bq.d,{className:"w-[calc(100vw-2rem)] sm:max-w-3xl max-h-[85vh] overflow-y-auto",children:[(0,b.jsxs)(bq.s,{children:[(0,b.jsx)(bq.F,{children:d.questionSimilarity.title}),(0,b.jsx)(bq.C,{children:d.questionSimilarity.description})]}),j&&(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",role:"status",children:[(0,b.jsx)(bp.f,{className:"h-4 w-4 animate-spin"}),d.common.loading]}),n&&(0,b.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:n}),n&&(0,b.jsx)(e.f,{variant:"outline",onClick:t,children:d.questionSimilarity.retry}),h&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted p-4",role:"status",children:[(0,b.jsx)("p",{className:"text-sm",children:d.questionSimilarity.score}),(0,b.jsxs)("p",{className:"text-3xl font-bold tabular-nums",children:[Number((100*h.similarity).toFixed(4)),"%"]}),(0,b.jsx)("p",{className:"text-sm",children:d.questionSimilarity.threshold.replace("{threshold}",String(h.threshold))}),(0,b.jsx)("p",{className:"text-sm font-medium",children:h.duplicate?d.questionSimilarity.duplicate:d.questionSimilarity.different})]}),(0,b.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:h.items.map((a,c)=>(0,b.jsxs)("div",{className:"min-w-0 space-y-2 rounded-lg border p-3",children:[(0,b.jsxs)(l.default,{href:`/error-items/${a.id}`,className:"text-sm font-medium text-primary hover:underline",children:[d.questionSimilarity.question.replace("{index}",String(c+1))," · ",a.shortId||"-"]}),a.notebookName&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a.notebookName}),(0,b.jsx)("div",{className:"max-h-56 overflow-auto text-sm",children:(0,b.jsx)(bs.f,{content:a.questionText})})]},a.id))})]}),(0,b.jsx)(br.f,{onSaved:t})]})]})}function bw({selectedIds:a,deleting:c,onCancel:d,onDelete:f}){let{t:g}=(0,bl.b)();return(0,b.jsx)("div",{className:"pb-safe fixed bottom-0 left-0 right-0 z-50 border-t bg-card/95 p-4 shadow-lg backdrop-blur",children:(0,b.jsxs)("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,b.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground",children:[(0,b.jsx)("p",{children:g.notebook.selectedCount.replace("{count}",String(a.length))}),(0,b.jsx)("p",{className:"text-xs",children:g.questionSimilarity.selectTwo})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(bv,{ids:a}),(0,b.jsxs)(e.f,{variant:"outline",onClick:d,children:[(0,b.jsx)(bo.X,{className:"mr-2 h-4 w-4"}),g.notebook.cancelSelect]}),(0,b.jsxs)(e.f,{variant:"destructive",onClick:f,disabled:0===a.length||c,children:[(0,b.jsx)(k.f,{className:"mr-2 h-4 w-4"}),g.notebook.deleteSelected]})]})]})})}var bx=a.i(529759),by=a.i(986705),bz=a.i(580701),bA=a.i(957292);let bB={1:["一年级"],2:["二年级"],3:["三年级"],4:["四年级"],5:["五年级"],6:["六年级"],7:["七年级上","七年级下","七年级"],8:["八年级上","八年级下","八年级"],9:["九年级上","九年级下","九年级"],10:["高一上","高一下","高一"],11:["高二上","高二下","高二"],12:["高三上","高三下","高三"]};function bC({gradeSemester:a,tag:d,subjectName:e,onFilterChange:f,className:g}){let{t:h}=(0,bl.b)(),{timeZone:i}=(0,bx.M)(),[j,k]=(0,c.useState)(a||""),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(d||""),[p,q]=(0,c.useState)([]),[r,s]=(0,c.useState)(!0),[t,u]=(0,c.useState)([]),[v,w]=(0,c.useState)(a);a!==v&&(w(a),void 0!==a&&k(a));let[x,y]=(0,c.useState)(d);d!==x&&(y(d),void 0!==d&&o(d||""));let z=(0,c.useCallback)((a,b)=>{let c=(0,by.c)(new Date,i),d=c.getFullYear(),e=(c.getMonth()+1>=9?d:d-1)-b+1;return"primary"===a?e:"junior_high"===a?e+6:"senior_high"===a?e+9:0},[i]),A=(0,c.useCallback)((a,b)=>{let c=[];return a?"primary"===a?c=[1,2,3,4,5,6]:"junior_high"===a?(c=[7,8,9],b&&z(a,b)>=10&&c.push(10,11,12)):c="senior_high"===a?[10,11,12]:[1,2,3,4,5,6,7,8,9,10,11,12]:c=[1,2,3,4,5,6,7,8,9,10,11,12],c.flatMap(a=>bB[a]||[])},[z]);(0,c.useEffect)(()=>{(async()=>{s(!0);try{let a=await bt.f.get("/api/user"),b=A(a.educationStage,a.enrollmentYear);u(b);let c=e?(0,bA.f)(e):"math";try{let a=await bt.f.get(`/api/tags?subject=${c}`);q(a.tags)}catch(a){bu.f.warn("[KnowledgeFilter]","Failed to fetch tags for subject",{subject:c,error:a}),q([])}}catch(a){bu.f.error("[KnowledgeFilter]","Failed to load filter data",{error:a})}finally{s(!1)}})()},[e,A]);let B=p.find(a=>a.name===j),C=B?.children||[],D=C.find(a=>a.name===l),E=a=>0===a.children.length?[a.name]:a.children.flatMap(a=>E(a)),F=D?[...new Set(E(D))]:[],G=t.filter(a=>p.some(b=>b.name===a));return(0,b.jsxs)("div",{className:`flex gap-2 ${g}`,children:[(0,b.jsxs)(bz.d,{value:j,onValueChange:a=>{k(a),m(""),o(""),f({gradeSemester:"all"===a?void 0:a,chapter:void 0,tag:void 0})},disabled:r,children:[(0,b.jsx)(bz.P,{className:"w-[140px]",children:(0,b.jsx)(bz.U,{placeholder:h.filter?.gradeShort||"Grade"})}),(0,b.jsxs)(bz.r,{children:[(0,b.jsx)(bz.T,{value:"all",children:h.filter?.allGrades||"All grades"}),G.map(a=>(0,b.jsx)(bz.T,{value:a,children:a},a))]})]}),(0,b.jsxs)(bz.d,{value:l,onValueChange:a=>{m(a),o(""),f({gradeSemester:"all"===j?void 0:j,chapter:"all"===a?void 0:a,tag:void 0})},disabled:!j||"all"===j,children:[(0,b.jsx)(bz.P,{className:"w-[180px]",children:(0,b.jsx)(bz.U,{placeholder:h.filter?.chapter||"Chapter"})}),(0,b.jsxs)(bz.r,{children:[(0,b.jsx)(bz.T,{value:"all",children:h.filter?.allChapters||"All chapters"}),C.map(a=>(0,b.jsx)(bz.T,{value:a.name,children:a.name.replace(/^第\d+章\s*/,"")},a.id))]})]}),(0,b.jsxs)(bz.d,{value:n,onValueChange:a=>{o(a),f({gradeSemester:"all"===j?void 0:j,chapter:"all"===l?void 0:l,tag:"all"===a?void 0:a})},disabled:!l||"all"===l,children:[(0,b.jsx)(bz.P,{className:"w-[140px]",children:(0,b.jsx)(bz.U,{placeholder:h.filter?.knowledgePoint||"Tag"})}),(0,b.jsxs)(bz.r,{children:[(0,b.jsx)(bz.T,{value:"all",children:h.filter?.allKnowledgePoints||"All tags"}),F.map(a=>(0,b.jsx)(bz.T,{value:a,children:a},a))]})]})]})}var bD=a.i(786304),bE=a.i(579834),bF=a.i(866718),bG=a.i(882524),bH=a.i(697902);function bI(a){let b=new URLSearchParams;return a.subjectId&&b.append("subjectId",a.subjectId),a.search&&b.append("query",a.search),"all"!==a.mastery&&b.append("mastery",a.mastery),"all"!==a.timeRange&&b.append("timeRange",a.timeRange),a.tag&&b.append("tag",a.tag),a.gradeSemester&&b.append("gradeSemester",a.gradeSemester),a.chapter&&b.append("chapter",a.chapter),"all"!==a.paperLevel&&b.append("paperLevel",a.paperLevel),b}var bJ=a.i(710302),bK=a.i(879188),bL=a.i(83715);function bM({subjectId:a,subjectName:f}={}){let{t:g}=(0,bl.b)(),h=(0,d.useRouter)(),[i,j]=(0,c.useState)([]),[k,l]=(0,c.useState)(!0),[s,t]=(0,c.useState)(""),[u,v]=(0,c.useState)("all"),[w,x]=(0,c.useState)("all"),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)(""),[C,D]=(0,c.useState)("all"),[E,F]=(0,c.useState)(null),[G,H]=(0,c.useState)(1),I=bH.$,[J,K]=(0,c.useState)(0),[L,M]=(0,c.useState)(0),[N,O]=(0,c.useState)(!1),[P,Q]=(0,c.useState)(new Set),[R,S]=(0,c.useState)(!1),T=(0,c.useMemo)(()=>({subjectId:a,search:s,mastery:u,timeRange:w,tag:E,gradeSemester:y,chapter:A,paperLevel:C}),[a,s,u,w,E,y,A,C]),U=()=>{O(!N),Q(new Set)},V=(0,c.useCallback)(async()=>{l(!0);try{let a=bI(T);a.append("page",G.toString()),a.append("pageSize",I.toString());let b=await bt.f.get(`/api/error-items/list?${a.toString()}`);j(b.items),K(b.total),M(b.totalPages)}catch(a){bu.f.error("[ErrorList]","Failed to fetch error items",{error:a})}finally{l(!1)}},[T,G,I]),W=async()=>{if(0===P.size)return;let a=(g.notebook?.confirmBatchDelete||"Delete {count} items?").replace("{count}",P.size.toString());if(await (0,bJ.u)(a,{destructive:!0})){S(!0);try{await bt.f.post("/api/error-items/batch-delete",{ids:Array.from(P)}),bJ.c.success(g.notebook?.batchDeleteSuccess||"Deleted successfully"),O(!1),Q(new Set),V()}catch(a){bu.f.error("[ErrorList]","Batch delete failed",{error:a}),bJ.c.error(g.common?.messages?.deleteFailed||"Delete failed")}finally{S(!1)}}},X=(0,c.useRef)(T);return(0,c.useEffect)(()=>{let a=X.current!==T;(X.current=T,a&&1!==G)?H(1):V()},[G,T,V]),(0,b.jsxs)("div",{className:`space-y-6 ${N?"pb-40 sm:pb-24":""}`,children:[(0,b.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row",children:[(0,b.jsxs)("div",{className:"relative w-full lg:flex-1",children:[(0,b.jsx)(q,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(bF.f,{placeholder:g.notebook.search,title:g.shortId.searchHint,className:"h-10 rounded-xl bg-card pl-9",value:s,onChange:a=>t(a.target.value),onKeyDown:async a=>{let b=s.trim();if("Enter"!==a.key||!(0,bL.f)(b))return;let c=await (0,bK.f)(b);c&&h.push(`/error-items/${c}`)}})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)(bm,{mastery:u,timeRange:w,onMasteryChange:v,onTimeRangeChange:x}),(0,b.jsxs)(e.f,{variant:"outline",size:"sm",className:"h-10",onClick:()=>h.push(`/print-preview?${bI(T).toString()}`),children:[(0,b.jsx)(p.f,{className:"mr-2 h-4 w-4"}),g.notebook?.exportPrint||"Export for Print"]}),!N&&(0,b.jsxs)(e.f,{variant:"outline",size:"sm",className:"h-10",onClick:U,children:[(0,b.jsx)(m,{className:"mr-2 h-4 w-4"}),g.questionSimilarity.title]}),(0,b.jsxs)(e.f,{variant:N?"secondary":"outline",size:"sm",className:"h-10",onClick:U,children:[(0,b.jsx)(o.f,{className:"mr-2 h-4 w-4"}),N?g.notebook?.cancelSelect||"Cancel":g.notebook?.selectMode||"Select"]})]})]}),(0,b.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-stretch sm:items-center",children:[(0,b.jsx)("div",{className:"w-full sm:w-auto",children:(0,b.jsx)(bC,{gradeSemester:y,tag:E,onFilterChange:({gradeSemester:a,chapter:b,tag:c})=>{void 0!==a&&z(a),void 0!==b&&B(b),F(void 0===c?null:c),a?b||B(""):(z(""),B(""),F(null)),H(1)},subjectName:f})}),(0,b.jsx)(bn,{value:C,onChange:D})]}),E&&(0,b.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg",children:[(0,b.jsxs)("span",{className:"text-sm text-muted-foreground",children:[g.filter.filteringByTag||"Filtering by tag",":"]}),(0,b.jsxs)(bD.f,{variant:"secondary",className:"cursor-pointer",onClick:()=>F(null),children:[E,(0,b.jsx)("span",{className:"ml-1 text-xs",children:"×"})]})]}),!k&&0===i.length&&(0,b.jsx)(bE.f,{icon:n,title:g.notebook.emptyList,description:g.notebook.emptyListHint}),k&&0===i.length&&(0,b.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6},(a,c)=>(0,b.jsx)("div",{className:"h-44 animate-pulse rounded-2xl bg-muted"},c))}),(0,b.jsx)("div",{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-3 transition-opacity ${k?"opacity-60":""}`,children:i.map(a=>(0,b.jsx)(r.f,{item:a,selectMode:N,selected:P.has(a.id),onToggleSelect:()=>{var b;return b=a.id,void Q(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},selectedTag:E,onTagClick:a=>F(E===a?null:a)},a.id))}),(0,b.jsx)(bG.f,{page:G,totalPages:L,total:J,pageSize:I,onPageChange:H}),N&&(0,b.jsx)(bw,{selectedIds:[...P],deleting:R,onCancel:U,onDelete:W})]})}var bN=a.i(870430);function bO({open:a,onOpenChange:d,currentName:f,onRename:g}){let[h,i]=(0,c.useState)(f),[j,k]=(0,c.useState)(!1),{t:l}=(0,bl.b)(),[m,n]=(0,c.useState)(f);f!==m&&(n(f),i(f));let o=async()=>{if(!h.trim())return void bJ.c.warning(l.notebooks?.renameDialog?.enterName||"Please enter notebook name");k(!0);try{await g(h.trim()),d(!1)}catch(a){bu.f.error("[RenameNotebook]","Failed to rename notebook",{error:a})}finally{k(!1)}};return(0,b.jsx)(bq.N,{open:a,onOpenChange:d,children:(0,b.jsxs)(bq.d,{children:[(0,b.jsx)(bq.s,{children:(0,b.jsx)(bq.F,{children:l.notebooks?.renameDialog?.title||"Rename Notebook"})}),(0,b.jsx)("div",{className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(bN.f,{htmlFor:"rename-name",children:l.notebooks?.renameDialog?.nameLabel||"New Name"}),(0,b.jsx)(bF.f,{id:"rename-name",placeholder:l.notebooks?.renameDialog?.placeholder||"Enter new notebook name",value:h,onChange:a=>i(a.target.value),onKeyDown:a=>"Enter"===a.key&&o()})]})}),(0,b.jsxs)(bq.c,{children:[(0,b.jsx)(e.f,{variant:"outline",onClick:()=>d(!1),children:l.common.cancel}),(0,b.jsx)(e.f,{onClick:o,disabled:j||!h.trim(),children:j?l.notebooks?.renameDialog?.renaming||"Renaming...":l.notebooks?.renameDialog?.rename||"Rename"})]})]})})}var bP=a.i(808406);function bQ({notebookId:a,onFinished:d}){let{t:f}=(0,bl.b)(),[g,h]=(0,c.useState)(null),[i,j]=(0,c.useState)(null),k=(0,c.useRef)(!1),l=(0,c.useCallback)(()=>{bt.f.get(`/api/notebooks/${a}/retag`).then(a=>{k.current&&a&&!a.running&&d?.(),k.current=!!a?.running,h(a)}).catch(()=>void 0)},[a,d]);(0,c.useEffect)(l,[l]),(0,c.useEffect)(()=>{if(!g?.running)return;let a=setTimeout(l,2e3);return()=>clearTimeout(a)},[g,l]);let m=async()=>{if(await (0,bJ.u)(f.retag.notebookConfirm)){j(null);try{let b=await bt.f.post(`/api/notebooks/${a}/retag`,{});if(0===b.total)return void j(f.retag.empty);k.current=b.running,h(b)}catch{j(f.retag.itemFailed)}}},n=i??(g?.running?f.retag.progress.replace("{done}",String(g.done)).replace("{total}",String(g.total)):g?.finishedAt&&g.total>0?f.retag.finished.replace("{success}",String(g.total-g.failed)).replace("{failed}",String(g.failed)):null);return(0,b.jsxs)("div",{className:"flex flex-col items-start sm:items-end gap-1",children:[(0,b.jsxs)(e.f,{variant:"outline",size:"sm",onClick:m,disabled:g?.running,"aria-label":f.retag.notebookButton,children:[g?.running?(0,b.jsx)(bp.f,{className:"h-4 w-4 animate-spin sm:mr-2"}):(0,b.jsx)(bP.f,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:f.retag.notebookButton})]}),n&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:n})]})}var bR=a.i(468368),bS=a.i(557999),bT=a.i(960927);a.s(["default",0,function(){let a=(0,d.useParams)(),i=(0,d.useRouter)(),{t:m}=(0,bl.b)(),[n,o]=(0,c.useState)(null);(0,bS.f)(m.notebooks.title,n?.name);let[p,q]=(0,c.useState)(!0),[r,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(0),v=(0,c.useCallback)(async a=>{try{let b=await bt.f.get(`/api/notebooks/${a}`);o(b)}catch(a){bu.f.error("[NotebookDetail]","Failed to fetch notebook",{error:a}),bJ.c.error(m.notebooks?.notFound||"Notebook not found"),i.push("/notebooks")}finally{q(!1)}},[i,m]);(0,c.useEffect)(()=>{a.id&&v(a.id)},[a.id,v]);let w=async a=>{n&&o(await bt.f.put(`/api/notebooks/${n.id}`,{name:a}))},x=async()=>{if(n)try{let a=await bt.f.get(`/api/notebooks/${n.id}`);if((a._count?.errorItems||0)>0)return void bJ.c.warning(m.notebooks?.deleteNotEmpty||"Please clear all items in this notebook first.");if(!await (0,bJ.u)((m.notebooks?.deleteConfirm||"Are you sure?").replace("{name}",n.name),{destructive:!0}))return;await bt.f.delete(`/api/notebooks/${n.id}`),i.replace("/notebooks")}catch(a){bu.f.error("[NotebookDetail]","Failed to delete notebook",{error:a}),bJ.c.error((0,bT.d)(a)||m.notebooks?.deleteError||"Failed to delete")}};return p?(0,b.jsx)(g.f,{label:m.common.loading}):n?(0,b.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(f.f,{backHref:"/notebooks",title:n.name,titleAddon:(0,b.jsx)(e.f,{variant:"ghost",size:"icon-sm",className:"shrink-0 text-muted-foreground",onClick:()=>s(!0),title:m.notebooks?.rename||"Rename",children:(0,b.jsx)(j,{className:"h-4 w-4"})}),description:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(bR.E,{notebook:n})," · ",(m.notebooks?.totalErrors||"Total {count} errors").replace("{count}",(n._count?.errorItems||0).toString())]}),actions:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(e.f,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:x,"aria-label":m.common.delete,children:[(0,b.jsx)(k.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:m.common.delete})]}),(0,b.jsx)(bQ,{notebookId:n.id,onFinished:()=>u(a=>a+1)}),(0,b.jsx)(l.default,{href:`/notebooks/${n.id}/add`,children:(0,b.jsxs)(e.f,{"aria-label":m.notebooks?.addError||"Add Error",children:[(0,b.jsx)(h.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:m.notebooks?.addError||"Add Error"})]})})]})}),(0,b.jsx)(bM,{subjectId:n.id,subjectName:n.name},t),(0,b.jsx)(bO,{open:r,onOpenChange:s,currentName:n.name,onRename:w})]})}):null}],701453)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_notebooks_%5Bid%5D_page_tsx_08njm-5-txm8_._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[732204,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(699570),f=a.i(579834),g=a.i(251538),h=a.i(506376),i=a.i(596221),j=a.i(170106);let k=(0,j.f)("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 l=a.i(866718),m=a.i(550194),n=a.i(879188),o=a.i(83715);function p(){let{t:a}=(0,m.b)(),f=(0,d.useRouter)(),[g,h]=(0,c.useState)(""),[j,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(!1),s=async b=>{b.preventDefault();let c=g.trim();if(!(0,o.f)(c))return void p(a.shortId.invalid);r(!0),p(null);let d=await (0,n.f)(c);r(!1),d?f.push(`/error-items/${d}`):p(a.shortId.notFound)};return(0,b.jsxs)("form",{onSubmit:s,className:"space-y-1",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(l.f,{value:g,onChange:a=>{h(a.target.value),p(null)},placeholder:a.shortId.locatePlaceholder,maxLength:6,className:"font-mono sm:max-w-xs","aria-label":a.shortId.locateTitle}),(0,b.jsxs)(e.f,{type:"submit",variant:"outline",disabled:q||!g.trim(),children:[q?(0,b.jsx)(i.f,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(k,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"ml-2",children:a.shortId.locate})]})]}),j&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:j})]})}var q=a.i(953722),r=a.i(915618);let s=(0,j.f)("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"}]]),t=(0,j.f)("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 u=a.i(50522);let v=(0,j.f)("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"}]]),w=(0,j.f)("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"}]]),x=(0,j.f)("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 y=a.i(149625);let z=(0,j.f)("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 A=a.i(699464);let B=(0,j.f)("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"}]]),C=(0,j.f)("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 D=a.i(781560),E=a.i(468368),F=a.i(723222);let G={math:{icon:C,className:"bg-blue-100 text-blue-600 dark:bg-blue-500/15 dark:text-blue-300"},english:{icon:y.f,className:"bg-emerald-100 text-emerald-600 dark:bg-emerald-500/15 dark:text-emerald-300"},chinese:{icon:t,className:"bg-rose-100 text-rose-600 dark:bg-rose-500/15 dark:text-rose-300"},physics:{icon:s,className:"bg-amber-100 text-amber-600 dark:bg-amber-500/15 dark:text-amber-300"},chemistry:{icon:v,className:"bg-teal-100 text-teal-600 dark:bg-teal-500/15 dark:text-teal-300"},biology:{icon:z,className:"bg-lime-100 text-lime-700 dark:bg-lime-500/15 dark:text-lime-300"},history:{icon:x,className:"bg-orange-100 text-orange-600 dark:bg-orange-500/15 dark:text-orange-300"},geography:{icon:w,className:"bg-cyan-100 text-cyan-600 dark:bg-cyan-500/15 dark:text-cyan-300"},politics:{icon:B,className:"bg-red-100 text-red-600 dark:bg-red-500/15 dark:text-red-300"}},H={icon:q.f,className:"bg-accent text-accent-foreground"};function I({id:a,name:c,stage:d,subjectKey:f,errorCount:g,onClick:h,onRename:i,onDelete:j,itemLabel:k="items"}){let l=(0,F.v)({name:c,stage:d,subjectKey:f}),{icon:m,className:n}=l.subject?G[l.subject]:H;return(0,b.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:h,onKeyDown:a=>{"Enter"===a.key&&h()},children:[(0,b.jsx)("div",{className:`flex h-12 w-12 shrink-0 items-center justify-center rounded-xl ${n}`,children:(0,b.jsx)(m,{className:"h-6 w-6"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("h3",{className:"truncate font-semibold",children:c}),(0,b.jsxs)("p",{className:"mt-0.5 flex items-center gap-1.5 text-sm text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium tabular-nums text-foreground",children:g}),k,(0,b.jsx)("span",{className:"text-border",children:"|"}),(0,b.jsx)(E.E,{notebook:{name:c,stage:d,subjectKey:f},className:"truncate"})]})]}),(0,b.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:[i&&(0,b.jsx)(e.f,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:a=>{a.stopPropagation(),i()},children:(0,b.jsx)(A.f,{className:"h-4 w-4"})}),j&&(0,b.jsx)(e.f,{variant:"ghost",size:"icon-sm",onClick:b=>{b.stopPropagation(),j(a)},children:(0,b.jsx)(D.f,{className:`h-4 w-4 ${g>0?"text-muted-foreground":"text-destructive"}`})})]}),(0,b.jsx)(u.f,{className:"hidden h-4 w-4 shrink-0 text-muted-foreground sm:block"})]})}var J=a.i(814574),K=a.i(870430),L=a.i(580701),M=a.i(710302),N=a.i(630534);function O({open:a,onOpenChange:d,onCreate:f}){let[g,h]=(0,c.useState)(""),[i,j]=(0,c.useState)(F.j),[k,n]=(0,c.useState)(F.W[F.j][0]),[o,p]=(0,c.useState)(!1),{t:q}=(0,m.b)(),{stageLabel:r,subjectLabel:s}=(0,E.O)(),t=async()=>{if(!g.trim())return void M.c.warning(q.notebooks?.dialog?.enterName||"Please enter notebook name");p(!0);try{await f({name:g.trim(),stage:i,subjectKey:k}),h(""),d(!1)}catch(a){N.f.error("[CreateNotebook]","Failed to create notebook",{error:a})}finally{p(!1)}};return(0,b.jsx)(J.N,{open:a,onOpenChange:d,children:(0,b.jsxs)(J.d,{children:[(0,b.jsxs)(J.s,{children:[(0,b.jsx)(J.F,{children:q.notebooks?.dialog?.title||"Create New Notebook"}),(0,b.jsx)(J.C,{children:q.notebooks?.dialog?.desc||"Create separate notebooks for different subjects or chapters"})]}),(0,b.jsxs)("div",{className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(K.f,{htmlFor:"notebook-stage",children:q.notebooks.dialog.stageLabel}),(0,b.jsxs)(L.d,{value:i,onValueChange:a=>{j(a),F.W[a].includes(k)||n(F.W[a][0])},children:[(0,b.jsx)(L.P,{id:"notebook-stage",children:(0,b.jsx)(L.U,{})}),(0,b.jsx)(L.r,{children:F.c.map(a=>(0,b.jsx)(L.T,{value:a,children:r(a)},a))})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(K.f,{htmlFor:"notebook-subject",children:q.notebooks.dialog.subjectLabel}),(0,b.jsxs)(L.d,{value:k,onValueChange:a=>n(a),children:[(0,b.jsx)(L.P,{id:"notebook-subject",children:(0,b.jsx)(L.U,{})}),(0,b.jsx)(L.r,{children:F.W[i].map(a=>(0,b.jsx)(L.T,{value:a,children:s(a)},a))})]})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q.notebooks.dialog.scopeHint}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(K.f,{htmlFor:"name",children:q.notebooks?.dialog?.nameLabel||"Notebook Name"}),(0,b.jsx)(l.f,{id:"name",placeholder:q.notebooks?.dialog?.placeholder||"e.g. Math, Physics, Chemistry...",value:g,onChange:a=>h(a.target.value),onKeyDown:a=>"Enter"===a.key&&t()})]})]}),(0,b.jsxs)(J.c,{children:[(0,b.jsx)(e.f,{variant:"outline",onClick:()=>d(!1),children:q.common.cancel}),(0,b.jsx)(e.f,{onClick:t,disabled:o||!g.trim(),children:o?q.notebooks?.dialog?.creating||"Creating...":q.notebooks?.dialog?.create||"Create"})]})]})})}var P=a.i(73556),Q=a.i(291938),R=a.i(557999),S=a.i(960927);a.s(["default",0,function(){let a=(0,d.useRouter)(),{t:i}=(0,m.b)();(0,R.f)(i.notebooks.title);let[j,k]=(0,c.useState)([]),[l,n]=(0,c.useState)(!0),[o,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),v=(0,c.useCallback)(async()=>{try{let a=await Q.f.get("/api/notebooks");k(a)}catch(a){N.f.error("[Notebooks]","Failed to fetch notebooks",{error:a})}finally{n(!1)}},[]);(0,c.useEffect)(()=>{v()},[v]);let w=async a=>{try{await Q.f.post("/api/notebooks",a),await v()}catch(b){N.f.error("[Notebooks]","Failed to create notebook",{error:b});let a=(0,S.d)(b)||i.notebooks?.createError||"Failed to create";M.c.error(a)}},x=async a=>{t&&(await Q.f.put(`/api/notebooks/${t.id}`,{name:a}),u(null),await v())},y=async(a,b,c)=>{if(b>0)return void M.c.warning(i.notebooks?.deleteNotEmpty||"Please clear all items in this notebook first.");if(await (0,M.u)((i.notebooks?.deleteConfirm||"Are you sure?").replace("{name}",c),{destructive:!0}))try{await Q.f.delete(`/api/notebooks/${a}`),await v()}catch(b){N.f.error("[Notebooks]","Failed to delete notebook",{error:b});let a=(0,S.d)(b)||i.notebooks?.deleteError||"Failed to delete";M.c.error(a)}};return l?(0,b.jsx)(h.f,{label:i.common.loading}):(0,b.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(g.f,{title:i.notebooks?.title||"My Notebooks",description:i.notebooks?.subtitle||"Manage your mistakes by subject",actions:(0,b.jsxs)(e.f,{onClick:()=>s(!0),"aria-label":i.notebooks?.create||"New Notebook",children:[(0,b.jsx)(r.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:i.notebooks?.create||"New Notebook"})]})}),(0,b.jsx)(p,{}),0===j.length?(0,b.jsx)(f.f,{icon:q.f,title:i.notebooks?.empty||"No notebooks yet.",action:(0,b.jsxs)(e.f,{onClick:()=>s(!0),children:[(0,b.jsx)(r.f,{className:"h-4 w-4"}),i.notebooks?.createFirst||"Create Notebook"]})}):(0,b.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:j.map(c=>(0,b.jsx)(I,{id:c.id,name:c.name,stage:c.stage,subjectKey:c.subjectKey,errorCount:c._count?.errorItems||0,onClick:()=>{var b;return b=c.id,void a.push(`/notebooks/${b}`)},onRename:()=>u(c),onDelete:()=>y(c.id,c._count?.errorItems||0,c.name),itemLabel:i.notebooks?.items||"items"},c.id))}),(0,b.jsx)(O,{open:o,onOpenChange:s,onCreate:w},i.common.loading),(0,b.jsx)(P.f,{open:!!t,onOpenChange:a=>{a||u(null)},currentName:t?.name||"",onRename:x})]})})}],732204)}];
1
+ module.exports=[732204,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(699570),f=a.i(579834),g=a.i(251538),h=a.i(506376),i=a.i(596221),j=a.i(170106);let k=(0,j.f)("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 l=a.i(866718),m=a.i(550194),n=a.i(879188),o=a.i(83715);function p(){let{t:a}=(0,m.b)(),f=(0,d.useRouter)(),[g,h]=(0,c.useState)(""),[j,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(!1),s=async b=>{b.preventDefault();let c=g.trim();if(!(0,o.f)(c))return void p(a.shortId.invalid);r(!0),p(null);let d=await (0,n.f)(c);r(!1),d?f.push(`/error-items/${d}`):p(a.shortId.notFound)};return(0,b.jsxs)("form",{onSubmit:s,className:"space-y-1",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(l.f,{value:g,onChange:a=>{h(a.target.value),p(null)},placeholder:a.shortId.locatePlaceholder,maxLength:6,className:"font-mono sm:max-w-xs","aria-label":a.shortId.locateTitle}),(0,b.jsxs)(e.f,{type:"submit",variant:"outline",disabled:q||!g.trim(),children:[q?(0,b.jsx)(i.f,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(k,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"ml-2",children:a.shortId.locate})]})]}),j&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:j})]})}var q=a.i(953722),r=a.i(915618);let s=(0,j.f)("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"}]]),t=(0,j.f)("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 u=a.i(50522);let v=(0,j.f)("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"}]]),w=(0,j.f)("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"}]]),x=(0,j.f)("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 y=a.i(149625);let z=(0,j.f)("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"}]]),A=(0,j.f)("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"}]]),B=(0,j.f)("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 C=a.i(468368),D=a.i(723222);let E={math:{icon:B,className:"bg-blue-100 text-blue-600 dark:bg-blue-500/15 dark:text-blue-300"},english:{icon:y.f,className:"bg-emerald-100 text-emerald-600 dark:bg-emerald-500/15 dark:text-emerald-300"},chinese:{icon:t,className:"bg-rose-100 text-rose-600 dark:bg-rose-500/15 dark:text-rose-300"},physics:{icon:s,className:"bg-amber-100 text-amber-600 dark:bg-amber-500/15 dark:text-amber-300"},chemistry:{icon:v,className:"bg-teal-100 text-teal-600 dark:bg-teal-500/15 dark:text-teal-300"},biology:{icon:z,className:"bg-lime-100 text-lime-700 dark:bg-lime-500/15 dark:text-lime-300"},history:{icon:x,className:"bg-orange-100 text-orange-600 dark:bg-orange-500/15 dark:text-orange-300"},geography:{icon:w,className:"bg-cyan-100 text-cyan-600 dark:bg-cyan-500/15 dark:text-cyan-300"},politics:{icon:A,className:"bg-red-100 text-red-600 dark:bg-red-500/15 dark:text-red-300"}},F={icon:q.f,className:"bg-accent text-accent-foreground"};function G({name:a,stage:c,subjectKey:d,errorCount:e,onClick:f,itemLabel:g="items"}){let h=(0,D.v)({name:a,stage:c,subjectKey:d}),{icon:i,className:j}=h.subject?E[h.subject]:F;return(0,b.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:f,onKeyDown:a=>{"Enter"===a.key&&f()},children:[(0,b.jsx)("div",{className:`flex h-12 w-12 shrink-0 items-center justify-center rounded-xl ${j}`,children:(0,b.jsx)(i,{className:"h-6 w-6"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("h3",{className:"truncate font-semibold",children:a}),(0,b.jsxs)("p",{className:"mt-0.5 flex items-center gap-1.5 text-sm text-muted-foreground",children:[(0,b.jsx)("span",{className:"font-medium tabular-nums text-foreground",children:e}),g,(0,b.jsx)("span",{className:"text-border",children:"|"}),(0,b.jsx)(C.E,{notebook:{name:a,stage:c,subjectKey:d},className:"truncate"})]})]}),(0,b.jsx)(u.f,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]})}var H=a.i(74352),I=a.i(291938),J=a.i(557999),K=a.i(710302),L=a.i(630534),M=a.i(960927);a.s(["default",0,function(){let a=(0,d.useRouter)(),{t:i}=(0,m.b)();(0,J.f)(i.notebooks.title);let[j,k]=(0,c.useState)([]),[l,n]=(0,c.useState)(!0),[o,s]=(0,c.useState)(!1),t=(0,c.useCallback)(async()=>{try{let a=await I.f.get("/api/notebooks");k(a)}catch(a){L.f.error("[Notebooks]","Failed to fetch notebooks",{error:a})}finally{n(!1)}},[]);(0,c.useEffect)(()=>{t()},[t]);let u=async a=>{try{await I.f.post("/api/notebooks",a),await t()}catch(b){L.f.error("[Notebooks]","Failed to create notebook",{error:b});let a=(0,M.d)(b)||i.notebooks?.createError||"Failed to create";K.c.error(a)}};return l?(0,b.jsx)(h.f,{label:i.common.loading}):(0,b.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(g.f,{title:i.notebooks?.title||"My Notebooks",description:i.notebooks?.subtitle||"Manage your mistakes by subject",actions:(0,b.jsxs)(e.f,{onClick:()=>s(!0),"aria-label":i.notebooks?.create||"New Notebook",children:[(0,b.jsx)(r.f,{className:"h-4 w-4"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:i.notebooks?.create||"New Notebook"})]})}),(0,b.jsx)(p,{}),0===j.length?(0,b.jsx)(f.f,{icon:q.f,title:i.notebooks?.empty||"No notebooks yet.",action:(0,b.jsxs)(e.f,{onClick:()=>s(!0),children:[(0,b.jsx)(r.f,{className:"h-4 w-4"}),i.notebooks?.createFirst||"Create Notebook"]})}):(0,b.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:j.map(c=>(0,b.jsx)(G,{name:c.name,stage:c.stage,subjectKey:c.subjectKey,errorCount:c._count?.errorItems||0,onClick:()=>{var b;return b=c.id,void a.push(`/notebooks/${b}`)},itemLabel:i.notebooks.cardItems},c.id))}),(0,b.jsx)(H.f,{open:o,onOpenChange:s,onCreate:u},i.common.loading)]})})}],732204)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_notebooks_page_tsx_1p9src5gnz_40._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[771706,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(699570),f=a.i(695001),g=a.i(93907),h=a.i(418943),i=a.i(291938),j=a.i(550194),k=a.i(557999),l=a.i(697902),m=a.i(630534);function n(){var a,n,o,p;let q=(0,d.useSearchParams)(),{t:r}=(0,j.b)(),[s,t]=(0,c.useState)([]);(0,k.f)(r.printPreview.title);let[u,v]=(0,c.useState)(!0),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(70),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(new Set),I=(0,c.useCallback)(async()=>{try{let a=new URLSearchParams(q.toString());a.set("pageSize",String(l.A));let b=await i.f.get(`/api/error-items/list?${a.toString()}`);t(b.items),H(new Set(b.items.map(a=>a.id)))}catch(a){m.f.error("[PrintPreview]","Failed to fetch items",{error:a})}finally{v(!1)}},[q]);(0,c.useEffect)(()=>{I()},[I]);let J=s.filter(a=>G.has(a.id)),K=!w&&!y,L=(a=s.length,(n=J.length)===a?String(a):`${n}/${a}`),M=(o=s.length,p=J.length,0===o?"noItems":0===p?"noSelection":null);return u?(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,b.jsx)("p",{className:"text-muted-foreground",children:r.common.loading})}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"print:hidden sticky top-0 z-10 bg-background border-b p-3 sm:p-4 shadow-sm",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(f.f,{fallbackUrl:"/notebooks"}),(0,b.jsxs)("h1",{className:"text-lg sm:text-xl font-bold flex-1",children:[r.printPreview?.title||"Print Preview"," (",L," ",r.notebooks?.items||"items",")"]}),(0,b.jsx)(e.f,{onClick:()=>{window.print()},size:"sm",className:"whitespace-nowrap",disabled:0===J.length,children:r.printPreview?.printButton||"Print / Save PDF"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,b.jsxs)("span",{className:"whitespace-nowrap text-xs sm:text-sm",children:[r.printPreview?.imageScale||"Image Scale",": ",C,"%"]}),(0,b.jsx)("input",{type:"range",min:"30",max:"100",value:C,onChange:a=>D(Number(a.target.value)),className:"w-16 sm:w-20 accent-primary"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 sm:gap-4",children:[(0,b.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:E,onChange:a=>F(a.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),r.printPreview?.showQuestionText||"Question Text"]}),(0,b.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:w,onChange:a=>x(a.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),r.printPreview?.showAnswers||"Show Answers"]}),(0,b.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:y,onChange:a=>z(a.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),r.printPreview?.showAnalysis||"Show Analysis"]}),(0,b.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:A,onChange:a=>B(a.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),r.printPreview?.showTags||"Show Tags"]})]})]}),(0,b.jsxs)("div",{className:"rounded-md border bg-muted/20 p-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsxs)("div",{className:"text-sm font-medium",children:[r.printPreview?.selectItems||"Select Items"," (",J.length,"/",s.length,")"]}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(e.f,{variant:"outline",size:"sm",onClick:()=>{H(new Set(s.map(a=>a.id)))},children:r.printPreview?.selectAll||"Select All"}),(0,b.jsx)(e.f,{variant:"outline",size:"sm",onClick:()=>{H(new Set)},children:r.printPreview?.clearSelection||"Clear Selection"})]})]}),(0,b.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3 max-h-44 overflow-y-auto pr-1",children:s.map((a,c)=>(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded border bg-background p-2 text-xs cursor-pointer hover:border-primary/50",children:[(0,b.jsx)("input",{type:"checkbox",checked:G.has(a.id),onChange:()=>{var b;return b=a.id,void H(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"mt-0.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,b.jsxs)("span",{className:"line-clamp-2",children:[(0,b.jsx)("span",{className:"font-semibold",children:r.printPreview?.questionNumber?.replace("{num}",String(c+1))||`Question ${c+1}`}),a.questionText?`:${a.questionText}`:""]})]},a.id))})]})]})}),(0,b.jsxs)("div",{className:"max-w-4xl mx-auto p-8 print:p-0",children:[J.map((a,c)=>{let d=[];if(a.tags&&a.tags.length>0)d=a.tags.map(a=>a.name);else try{d=JSON.parse(a.knowledgePoints||"[]")}catch{d=[]}return(0,b.jsxs)("div",{className:`mb-4 border-b last:border-b-0 print:break-inside-avoid ${K?"pb-20 print:pb-16":"pb-6"}`,children:[(0,b.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 leading-7",children:[(0,b.jsx)("span",{className:"text-lg font-bold",children:r.printPreview?.questionNumber?.replace("{num}",String(c+1))||`Question ${c+1}`}),a.shortId&&(0,b.jsx)("span",{className:"font-mono text-sm text-muted-foreground whitespace-nowrap",children:r.printPreview.source.replace("{id}",a.shortId)}),a.subject&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:a.subject.name}),a.gradeSemester&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:a.gradeSemester}),a.paperLevel&&(0,b.jsxs)("span",{className:"text-sm text-muted-foreground",children:[r.printPreview?.paperLevel||"Paper Level",": ",a.paperLevel.toUpperCase()]}),A&&d.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"font-semibold",children:[r.printPreview?.knowledgePoints||"Knowledge Points",":"]}),d.map((a,c)=>(0,b.jsx)("span",{className:"px-2 py-1 bg-muted rounded text-sm",children:a},`${a}-${c}`))]})]}),E&&a.questionText?(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsx)(g.f,{content:a.questionText}),(0,b.jsx)(h.f,{svg:a.figureSvg})]}):a.originalImageUrl&&(0,b.jsx)("div",{className:"mb-4",children:(0,b.jsx)("img",{src:a.originalImageUrl,alt:r.detail?.originalProblem||"Question Image",className:"h-auto border rounded",style:{maxWidth:`${C}%`}})}),w&&a.answerText&&(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("h3",{className:"font-semibold mb-2",children:[r.printPreview?.referenceAnswer||"Reference Answer",":"]}),(0,b.jsx)(g.f,{content:a.answerText})]}),y&&a.analysis&&(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("h3",{className:"font-semibold mb-2",children:[r.printPreview?.analysis||"Analysis",":"]}),(0,b.jsx)(g.f,{content:a.analysis})]})]},a.id)}),M&&(0,b.jsx)("div",{className:"text-center py-12 text-muted-foreground",children:"noSelection"===M?r.printPreview?.noSelection||"No items selected":r.printPreview?.noItems||"No matching error items"})]})]})}a.s(["default",0,function(){let{t:a}=(0,j.b)();return(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:a.common.loading}),children:(0,b.jsx)(n,{})})}],771706)}];
1
+ module.exports=[771706,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(699570),f=a.i(695001),g=a.i(93907),h=a.i(418943),i=a.i(291938),j=a.i(550194),k=a.i(557999),l=a.i(697902),m=a.i(630534);function n(){var a,n,o,p;let q=(0,d.useSearchParams)(),{t:r}=(0,j.b)(),[s,t]=(0,c.useState)([]);(0,k.f)(r.printPreview.title);let[u,v]=(0,c.useState)(!0),[w,x]=(0,c.useState)(!1),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(70),[E,F]=(0,c.useState)(!1),[G,H]=(0,c.useState)(new Set),I=(0,c.useCallback)(async()=>{try{let a=new URLSearchParams(q.toString());a.set("pageSize",String(l.A)),a.set("view","print");let b=await i.f.get(`/api/error-items/list?${a.toString()}`);t(b.items),H(new Set(b.items.map(a=>a.id)))}catch(a){m.f.error("[PrintPreview]","Failed to fetch items",{error:a})}finally{v(!1)}},[q]);(0,c.useEffect)(()=>{I()},[I]);let J=s.filter(a=>G.has(a.id)),K=!w&&!y,L=(a=s.length,(n=J.length)===a?String(a):`${n}/${a}`),M=(o=s.length,p=J.length,0===o?"noItems":0===p?"noSelection":null);return u?(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,b.jsx)("p",{className:"text-muted-foreground",children:r.common.loading})}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"print:hidden sticky top-0 z-10 bg-background border-b p-3 sm:p-4 shadow-sm",children:(0,b.jsxs)("div",{className:"max-w-6xl mx-auto space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(f.f,{fallbackUrl:"/notebooks"}),(0,b.jsxs)("h1",{className:"text-lg sm:text-xl font-bold flex-1",children:[r.printPreview?.title||"Print Preview"," (",L," ",r.notebooks?.items||"items",")"]}),(0,b.jsx)(e.f,{onClick:()=>{window.print()},size:"sm",className:"whitespace-nowrap",disabled:0===J.length,children:r.printPreview?.printButton||"Print / Save PDF"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm bg-muted/50 px-2 sm:px-3 py-1 rounded-md",children:[(0,b.jsxs)("span",{className:"whitespace-nowrap text-xs sm:text-sm",children:[r.printPreview?.imageScale||"Image Scale",": ",C,"%"]}),(0,b.jsx)("input",{type:"range",min:"30",max:"100",value:C,onChange:a=>D(Number(a.target.value)),className:"w-16 sm:w-20 accent-primary"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 sm:gap-4",children:[(0,b.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:E,onChange:a=>F(a.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),r.printPreview?.showQuestionText||"Question Text"]}),(0,b.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:w,onChange:a=>x(a.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),r.printPreview?.showAnswers||"Show Answers"]}),(0,b.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:y,onChange:a=>z(a.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),r.printPreview?.showAnalysis||"Show Analysis"]}),(0,b.jsxs)("label",{className:"flex items-center gap-1.5 text-xs sm:text-sm cursor-pointer whitespace-nowrap hover:text-primary transition-colors",children:[(0,b.jsx)("input",{type:"checkbox",checked:A,onChange:a=>B(a.target.checked),className:"rounded border-gray-300 text-primary focus:ring-primary w-3.5 h-3.5 sm:w-4 sm:h-4"}),r.printPreview?.showTags||"Show Tags"]})]})]}),(0,b.jsxs)("div",{className:"rounded-md border bg-muted/20 p-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsxs)("div",{className:"text-sm font-medium",children:[r.printPreview?.selectItems||"Select Items"," (",J.length,"/",s.length,")"]}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(e.f,{variant:"outline",size:"sm",onClick:()=>{H(new Set(s.map(a=>a.id)))},children:r.printPreview?.selectAll||"Select All"}),(0,b.jsx)(e.f,{variant:"outline",size:"sm",onClick:()=>{H(new Set)},children:r.printPreview?.clearSelection||"Clear Selection"})]})]}),(0,b.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3 max-h-44 overflow-y-auto pr-1",children:s.map((a,c)=>(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded border bg-background p-2 text-xs cursor-pointer hover:border-primary/50",children:[(0,b.jsx)("input",{type:"checkbox",checked:G.has(a.id),onChange:()=>{var b;return b=a.id,void H(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"mt-0.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,b.jsxs)("span",{className:"line-clamp-2",children:[(0,b.jsx)("span",{className:"font-semibold",children:r.printPreview?.questionNumber?.replace("{num}",String(c+1))||`Question ${c+1}`}),a.questionText?`:${a.questionText}`:""]})]},a.id))})]})]})}),(0,b.jsxs)("div",{className:"max-w-4xl mx-auto p-8 print:p-0",children:[J.map((a,c)=>{let d=[];if(a.tags&&a.tags.length>0)d=a.tags.map(a=>a.name);else try{d=JSON.parse(a.knowledgePoints||"[]")}catch{d=[]}return(0,b.jsxs)("div",{className:`mb-4 border-b last:border-b-0 print:break-inside-avoid ${K?"pb-20 print:pb-16":"pb-6"}`,children:[(0,b.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 leading-7",children:[(0,b.jsx)("span",{className:"text-lg font-bold",children:r.printPreview?.questionNumber?.replace("{num}",String(c+1))||`Question ${c+1}`}),a.shortId&&(0,b.jsx)("span",{className:"font-mono text-sm text-muted-foreground whitespace-nowrap",children:r.printPreview.source.replace("{id}",a.shortId)}),a.subject&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:a.subject.name}),a.gradeSemester&&(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:a.gradeSemester}),a.paperLevel&&(0,b.jsxs)("span",{className:"text-sm text-muted-foreground",children:[r.printPreview?.paperLevel||"Paper Level",": ",a.paperLevel.toUpperCase()]}),A&&d.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"font-semibold",children:[r.printPreview?.knowledgePoints||"Knowledge Points",":"]}),d.map((a,c)=>(0,b.jsx)("span",{className:"px-2 py-1 bg-muted rounded text-sm",children:a},`${a}-${c}`))]})]}),E&&a.questionText?(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsx)(g.f,{content:a.questionText}),(0,b.jsx)(h.f,{svg:a.figureSvg})]}):a.originalImageUrl&&(0,b.jsx)("div",{className:"mb-4",children:(0,b.jsx)("img",{src:a.originalImageUrl,alt:r.detail?.originalProblem||"Question Image",className:"h-auto border rounded",style:{maxWidth:`${C}%`}})}),w&&a.answerText&&(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("h3",{className:"font-semibold mb-2",children:[r.printPreview?.referenceAnswer||"Reference Answer",":"]}),(0,b.jsx)(g.f,{content:a.answerText})]}),y&&a.analysis&&(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("h3",{className:"font-semibold mb-2",children:[r.printPreview?.analysis||"Analysis",":"]}),(0,b.jsx)(g.f,{content:a.analysis})]})]},a.id)}),M&&(0,b.jsx)("div",{className:"text-center py-12 text-muted-foreground",children:"noSelection"===M?r.printPreview?.noSelection||"No items selected":r.printPreview?.noItems||"No matching error items"})]})]})}a.s(["default",0,function(){let{t:a}=(0,j.b)();return(0,b.jsx)(c.Suspense,{fallback:(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:a.common.loading}),children:(0,b.jsx)(n,{})})}],771706)}];
2
2
 
3
3
  //# sourceMappingURL=src_app_print-preview_page_tsx_001yt-fzrj7tf._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[914546,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(50944),e=a.i(875003),f=a.i(596221),g=a.i(293530),h=a.i(699570),i=a.i(550194),j=a.i(291938),k=a.i(710302),l=a.i(630534),m=a.i(151304),n=a.i(439830);function o({onSaved:a}){let{t:d}=(0,i.b)(),[e,f]=(0,c.useState)({aiProvider:"minimax"}),[g,h]=(0,c.useState)(!0),[p,q]=(0,c.useState)(!1);(0,c.useEffect)(()=>{j.f.get("/api/settings").then(a=>{f("minimax"!==a.aiProvider||a.minimax?.apiKey?a:{...a,aiProvider:"minimax-code"})}).catch(a=>l.f.error("[Setup]","Failed to fetch settings",{error:a})).finally(()=>h(!1))},[]);let r=async()=>{let b=(0,n.f)(e,d);if(b)return void k.c.error(b);q(!0);try{f(await j.f.post("/api/settings",e)),k.c.success(d.settings?.messages?.saved||"Settings saved"),a()}catch(a){l.f.error("[Setup]","Failed to save AI settings",{error:a}),k.c.error(d.settings?.messages?.saveFailed||"Failed to save")}finally{q(!1)}};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:d.setup.ai.title}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:d.setup.ai.desc})]}),(0,b.jsx)(m.f,{config:e,setConfig:f,loading:g,saving:p,onSave:r})]})}var p=a.i(953722),q=a.i(167453),r=a.i(74352),s=a.i(960927);function t(){let{t:a}=(0,i.b)(),[d,e]=(0,c.useState)(!1),[f,g]=(0,c.useState)([]),m=async b=>{try{await j.f.post("/api/notebooks",b),g(a=>[...a,b.name])}catch(b){throw l.f.error("[Setup]","Failed to create notebook",{error:b}),k.c.error((0,s.d)(b)||a.notebooks?.createError||"Failed to create"),b}};return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:a.setup.notebook.title}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a.setup.notebook.desc})]}),f.map(c=>(0,b.jsxs)("p",{className:"flex items-center gap-2 text-sm text-emerald-600 dark:text-emerald-400",children:[(0,b.jsx)(q.f,{className:"h-4 w-4 shrink-0"}),a.setup.notebook.created.replace("{name}",c)]},c)),(0,b.jsxs)(h.f,{type:"button",variant:"outline",className:"w-full",onClick:()=>e(!0),children:[(0,b.jsx)(p.f,{className:"mr-2 h-4 w-4"}),a.setup.notebook.create]}),(0,b.jsx)(r.f,{open:d,onOpenChange:e,onCreate:m})]})}var u=a.i(870430),v=a.i(152679);function w({onDone:a}){let{t:d}=(0,i.b)(),{update:g}=(0,e.useSession)(),[m,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(!1),t=async b=>{if(b.preventDefault(),m.length<6)return void k.c.error(d.setup.password.tooShort);if("123456"===m)return void k.c.error(d.setup.password.sameAsDefault);if(m!==o)return void k.c.error(d.setup.password.mismatch);r(!0);try{await j.f.patch("/api/user",{password:m}),await g(),k.c.success(d.setup.password.success),a()}catch(a){l.f.error("[Setup]","Failed to change default password",{error:a}),k.c.error((0,s.d)(a)||d.setup.password.failed)}finally{r(!1)}};return(0,b.jsxs)("form",{onSubmit:t,className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold",children:d.setup.password.title}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:d.setup.password.desc})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.f,{htmlFor:"setup-new-password",children:d.setup.password.newPassword}),(0,b.jsx)(v.f,{id:"setup-new-password",autoComplete:"new-password",value:m,onChange:a=>n(a.target.value)})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.f,{htmlFor:"setup-confirm-password",children:d.setup.password.confirmPassword}),(0,b.jsx)(v.f,{id:"setup-confirm-password",autoComplete:"new-password",value:o,onChange:a=>p(a.target.value)})]}),(0,b.jsxs)(h.f,{type:"submit",className:"w-full",disabled:q,children:[q&&(0,b.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}),d.setup.password.submit]})]})}function x({mustChangePassword:a,setupCompleted:e}){let{t:g}=(0,i.b)(),m=(0,d.useRouter)(),[n]=(0,c.useState)(()=>a&&e?["password"]:a?["password","ai","notebook"]:["ai","notebook"]),[p,q]=(0,c.useState)(0),[r,s]=(0,c.useState)(!1),u=n[p],v=p===n.length-1,y=async()=>{s(!0);try{await j.f.post("/api/setup",{}),k.c.success(g.setup.finished),m.replace("/")}catch(a){l.f.error("[Setup]","Failed to complete setup",{error:a}),k.c.error(g.setup.completeFailed),s(!1)}},z=()=>{v?y():q(a=>a+1)};return(0,b.jsxs)("div",{className:"space-y-5",children:[n.length>1&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:g.setup.step.replace("{current}",String(p+1)).replace("{total}",String(n.length))}),(0,b.jsx)("div",{className:"flex gap-1.5",children:n.map((a,c)=>(0,b.jsx)("div",{className:`h-1.5 flex-1 rounded-full ${c<=p?"bg-primary":"bg-muted"}`},a))})]}),"password"===u&&(0,b.jsx)(w,{onDone:z}),"ai"===u&&(0,b.jsx)(o,{onSaved:z}),"notebook"===u&&(0,b.jsx)(t,{}),"password"!==u&&(v?(0,b.jsxs)(h.f,{type:"button",className:"w-full",onClick:y,disabled:r,children:[r&&(0,b.jsx)(f.f,{className:"mr-2 h-4 w-4 animate-spin"}),g.setup.finish]}):(0,b.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-between",children:[(0,b.jsx)(h.f,{type:"button",variant:"ghost",onClick:y,disabled:r,children:g.setup.skipAll}),(0,b.jsx)(h.f,{type:"button",variant:"outline",onClick:z,disabled:r,children:g.setup.skip})]}))]})}var y=a.i(591119),z=a.i(557999);a.s(["default",0,function(){let{t:a}=(0,i.b)();(0,z.f)(a.setup.pageTitle);let h=(0,d.useRouter)(),{data:k,status:m}=(0,e.useSession)(),n=k?.user?.role==="admin",o=k?.user?.mustChangePassword===!0,[p,q]=(0,c.useState)(null);return(0,c.useEffect)(()=>{if("authenticated"===m&&!p){if(!n)return void h.replace("/");j.f.get("/api/setup").then(a=>q({mustChangePassword:o,setupCompleted:a.setupCompleted})).catch(a=>{l.f.error("[Setup]","Failed to fetch setup status",{error:a}),q({mustChangePassword:o,setupCompleted:!1})})}},[m,n,o,p,h]),(0,b.jsx)(g.f,{wide:!0,children:(0,b.jsx)(y.N,{children:(0,b.jsxs)(y.O,{className:"space-y-4",children:[p?(0,b.jsx)(x,{mustChangePassword:p.mustChangePassword,setupCompleted:p.setupCompleted}):(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(f.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),(0,b.jsx)("button",{type:"button",onClick:()=>(0,e.signOut)({callbackUrl:"/login"}),className:"w-full text-center text-sm text-muted-foreground hover:text-foreground",children:a.setup.logout})]})})})}],914546)}];
2
+
3
+ //# sourceMappingURL=src_app_setup_page_tsx_0szlnxow_9skp._.js.map
@@ -0,0 +1,3 @@
1
+ (()=>{"use strict";module.exports=[293530,a=>{var b=a.i(187924),c=a.i(16644),d=a.i(550194);a.s(["f",0,function({children:a,wide:e=!1}){let{t:f}=(0,d.b)();return(0,b.jsxs)("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[(0,b.jsx)("div",{className:"pointer-events-none absolute -left-32 -top-32 h-96 w-96 rounded-full bg-indigo-400/25 blur-3xl"}),(0,b.jsx)("div",{className:"pointer-events-none absolute -bottom-40 -right-24 h-[28rem] w-[28rem] rounded-full bg-violet-400/20 blur-3xl"}),(0,b.jsxs)("div",{className:`relative w-full space-y-6 py-8 ${e?"max-w-xl":"max-w-md"}`,children:[(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,b.jsx)(c.default,{src:"/icons/icon.png",alt:"",width:64,height:64,className:"rounded-2xl shadow-lg shadow-indigo-500/30",priority:!0,unoptimized:!0}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xl font-bold tracking-tight",children:f.pageTitle.base}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f.app.subtitle})]})]}),a]})]})}])},468368,723222,a=>{var b=a.i(187924),c=a.i(550194),d=a.i(957292);let e=["primary","junior_high","senior_high"],f="primary",g=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function h(a){return"string"==typeof a&&g.includes(a)}function i(a){var b;let c=h(a.subjectKey)?a.subjectKey:(0,d.f)(a.name);return{stage:"string"==typeof(b=a.stage)&&e.includes(b)?a.stage:f,subject:c&&h(c)?c:null}}function j(){let{t:a}=(0,c.b)();return{stageLabel:b=>({primary:a.auth.primary,junior_high:a.auth.juniorHigh,senior_high:a.auth.seniorHigh})[b],subjectLabel:b=>a.tags.subjects[b]}}a.s(["j",0,f,"c",0,e,"W",0,{primary:["math","english"],junior_high:g,senior_high:g},"v",0,i],723222),a.s(["E",0,function({notebook:a,className:c}){let{stageLabel:d,subjectLabel:e}=j(),f=i(a);return(0,b.jsxs)("span",{className:c,children:[d(f.stage),f.subject?` \xb7 ${e(f.subject)}`:""]})},"O",0,j],468368)}]})();
2
+
3
+ //# sourceMappingURL=src_components_04xv7f-d7_fyc._.js.map
@@ -0,0 +1,3 @@
1
+ (()=>{"use strict";module.exports=[726319,a=>{var b=a.i(187924),c=a.i(786304),d=a.i(550194);let e={generating:"bg-blue-100 text-blue-700 border-blue-200",ready:"bg-indigo-100 text-indigo-700 border-indigo-200",partial:"bg-amber-100 text-amber-700 border-amber-200",failed:"bg-red-100 text-red-700 border-red-200",completed:"bg-green-100 text-green-700 border-green-200"};a.s(["f",0,function({status:a,recorded:f}){let{t:g}=(0,d.b)(),h=f&&("ready"===a||"partial"===a)?"completed":a;return(0,b.jsx)(c.f,{variant:"outline",className:e[h],children:g.exam.status[h]})}])},579834,a=>{var b=a.i(187924),c=a.i(368114);a.s(["f",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",g),children:[(0,b.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,b.jsx)(a,{className:"h-7 w-7"})}),(0,b.jsx)("p",{className:"font-medium",children:d}),e&&(0,b.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:e}),f&&(0,b.jsx)("div",{className:"mt-5",children:f})]})}])},506376,a=>{var b=a.i(187924),c=a.i(596221);a.s(["f",0,function({label:a}){return(0,b.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,b.jsx)(c.f,{className:"h-7 w-7 animate-spin text-primary"}),a&&(0,b.jsx)("p",{className:"text-sm",children:a})]})}])}]})();
2
+
3
+ //# sourceMappingURL=src_components_1lbiuzxejiwvf._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[74352,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(814574),e=a.i(699570),f=a.i(866718),g=a.i(870430),h=a.i(580701),i=a.i(468368),j=a.i(550194),k=a.i(723222),l=a.i(710302),m=a.i(630534);a.s(["f",0,function({open:a,onOpenChange:n,onCreate:o}){let[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(k.j),[t,u]=(0,c.useState)(k.W[k.j][0]),[v,w]=(0,c.useState)(!1),{t:x}=(0,j.b)(),{stageLabel:y,subjectLabel:z}=(0,i.O)(),A=async()=>{if(!p.trim())return void l.c.warning(x.notebooks?.dialog?.enterName||"Please enter notebook name");w(!0);try{await o({name:p.trim(),stage:r,subjectKey:t}),q(""),n(!1)}catch(a){m.f.error("[CreateNotebook]","Failed to create notebook",{error:a})}finally{w(!1)}};return(0,b.jsx)(d.N,{open:a,onOpenChange:n,children:(0,b.jsxs)(d.d,{children:[(0,b.jsxs)(d.s,{children:[(0,b.jsx)(d.F,{children:x.notebooks?.dialog?.title||"Create New Notebook"}),(0,b.jsx)(d.C,{children:x.notebooks?.dialog?.desc||"Create separate notebooks for different subjects or chapters"})]}),(0,b.jsxs)("div",{className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(g.f,{htmlFor:"notebook-stage",children:x.notebooks.dialog.stageLabel}),(0,b.jsxs)(h.d,{value:r,onValueChange:a=>{s(a),k.W[a].includes(t)||u(k.W[a][0])},children:[(0,b.jsx)(h.P,{id:"notebook-stage",children:(0,b.jsx)(h.U,{})}),(0,b.jsx)(h.r,{children:k.c.map(a=>(0,b.jsx)(h.T,{value:a,children:y(a)},a))})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(g.f,{htmlFor:"notebook-subject",children:x.notebooks.dialog.subjectLabel}),(0,b.jsxs)(h.d,{value:t,onValueChange:a=>u(a),children:[(0,b.jsx)(h.P,{id:"notebook-subject",children:(0,b.jsx)(h.U,{})}),(0,b.jsx)(h.r,{children:k.W[r].map(a=>(0,b.jsx)(h.T,{value:a,children:z(a)},a))})]})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:x.notebooks.dialog.scopeHint}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(g.f,{htmlFor:"name",children:x.notebooks?.dialog?.nameLabel||"Notebook Name"}),(0,b.jsx)(f.f,{id:"name",placeholder:x.notebooks?.dialog?.placeholder||"e.g. Math, Physics, Chemistry...",value:p,onChange:a=>q(a.target.value),onKeyDown:a=>"Enter"===a.key&&A()})]})]}),(0,b.jsxs)(d.c,{children:[(0,b.jsx)(e.f,{variant:"outline",onClick:()=>n(!1),children:x.common.cancel}),(0,b.jsx)(e.f,{onClick:A,disabled:v||!p.trim(),children:v?x.notebooks?.dialog?.creating||"Creating...":x.notebooks?.dialog?.create||"Create"})]})]})})}])}];
2
+
3
+ //# sourceMappingURL=src_components_create-notebook-dialog_tsx_0c5teagim70r7._.js.map