wrong-notebook 2026.10.25 → 2026.10.26

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 (408) 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 +2 -2
  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 +2 -2
  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 +2 -2
  36. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  37. package/.next/server/app/api/analytics/route.js +1 -1
  38. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  39. package/.next/server/app/api/analyze/route.js +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  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 +2 -2
  84. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  85. package/.next/server/app/api/exams/route.js +2 -2
  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 +2 -2
  90. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  91. package/.next/server/app/api/import/route.js +2 -2
  92. package/.next/server/app/api/import/route.js.nft.json +1 -1
  93. package/.next/server/app/api/logs/frontend/route.js +1 -1
  94. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  95. package/.next/server/app/api/minimax-code/checkin/route.js +1 -1
  96. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  97. package/.next/server/app/api/minimax-code/login/route.js +1 -1
  98. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  99. package/.next/server/app/api/minimax-code/route.js +1 -1
  100. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  101. package/.next/server/app/api/notebooks/[id]/retag/route.js +2 -2
  102. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  103. package/.next/server/app/api/notebooks/[id]/route.js +1 -1
  104. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  105. package/.next/server/app/api/notebooks/route.js +1 -1
  106. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  107. package/.next/server/app/api/practice/generate/route.js +2 -2
  108. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  109. package/.next/server/app/api/practice/grade/route.js +2 -2
  110. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  111. package/.next/server/app/api/practice/record/[id]/route.js +2 -2
  112. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  113. package/.next/server/app/api/practice/record/route.js +2 -2
  114. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  115. package/.next/server/app/api/reanswer/route.js +2 -2
  116. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  117. package/.next/server/app/api/review/due/route.js +1 -1
  118. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  119. package/.next/server/app/api/settings/route.js +1 -1
  120. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  121. package/.next/server/app/api/setup/route/app-paths-manifest.json +3 -0
  122. package/.next/server/app/api/setup/route/build-manifest.json +12 -0
  123. package/.next/server/app/api/setup/route/server-reference-manifest.json +4 -0
  124. package/.next/server/app/api/setup/route.js +13 -0
  125. package/.next/server/app/api/setup/route.js.map +5 -0
  126. package/.next/server/app/api/setup/route.js.nft.json +1 -0
  127. package/.next/server/app/api/setup/route_client-reference-manifest.js +3 -0
  128. package/.next/server/app/api/stats/practice/clear/route.js +1 -1
  129. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  130. package/.next/server/app/api/stats/practice/route.js +1 -1
  131. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  132. package/.next/server/app/api/tags/route.js +1 -1
  133. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  134. package/.next/server/app/api/tags/stats/route.js +1 -1
  135. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  136. package/.next/server/app/api/tags/suggestions/route.js +1 -1
  137. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  138. package/.next/server/app/api/tasks/route.js +1 -1
  139. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  140. package/.next/server/app/api/user/route.js +1 -1
  141. package/.next/server/app/api/user/route.js.nft.json +1 -1
  142. package/.next/server/app/error-items/[id]/page/build-manifest.json +3 -3
  143. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  144. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  145. package/.next/server/app/exams/[id]/page/build-manifest.json +3 -3
  146. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  147. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  148. package/.next/server/app/exams/[id]/print/page/build-manifest.json +3 -3
  149. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  150. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  151. package/.next/server/app/exams/page/build-manifest.json +3 -3
  152. package/.next/server/app/exams/page.js.nft.json +1 -1
  153. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  154. package/.next/server/app/login/page/build-manifest.json +3 -3
  155. package/.next/server/app/login/page.js.nft.json +1 -1
  156. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  157. package/.next/server/app/notebooks/[id]/add/page/build-manifest.json +3 -3
  158. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  159. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  160. package/.next/server/app/notebooks/[id]/page/build-manifest.json +3 -3
  161. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  162. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  163. package/.next/server/app/notebooks/page/build-manifest.json +3 -3
  164. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  165. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  166. package/.next/server/app/page/build-manifest.json +3 -3
  167. package/.next/server/app/page.js.nft.json +1 -1
  168. package/.next/server/app/page_client-reference-manifest.js +1 -1
  169. package/.next/server/app/practice/page/build-manifest.json +3 -3
  170. package/.next/server/app/practice/page.js.nft.json +1 -1
  171. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  172. package/.next/server/app/print-preview/page/build-manifest.json +3 -3
  173. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  174. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  175. package/.next/server/app/register/page/build-manifest.json +3 -3
  176. package/.next/server/app/register/page.js.nft.json +1 -1
  177. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  178. package/.next/server/app/review/page/build-manifest.json +3 -3
  179. package/.next/server/app/review/page.js.nft.json +1 -1
  180. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  181. package/.next/server/app/setup/page/app-paths-manifest.json +3 -0
  182. package/.next/server/app/setup/page/build-manifest.json +22 -0
  183. package/.next/server/app/setup/page/next-font-manifest.json +11 -0
  184. package/.next/server/app/setup/page/react-loadable-manifest.json +1 -0
  185. package/.next/server/app/setup/page/server-reference-manifest.json +4 -0
  186. package/.next/server/app/setup/page.js +14 -0
  187. package/.next/server/app/setup/page.js.map +5 -0
  188. package/.next/server/app/setup/page.js.nft.json +1 -0
  189. package/.next/server/app/setup/page_client-reference-manifest.js +3 -0
  190. package/.next/server/app/stats/page/build-manifest.json +3 -3
  191. package/.next/server/app/stats/page.js.nft.json +1 -1
  192. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  193. package/.next/server/app/tags/page/build-manifest.json +3 -3
  194. package/.next/server/app/tags/page.js +2 -1
  195. package/.next/server/app/tags/page.js.nft.json +1 -1
  196. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  197. package/.next/server/app-paths-manifest.json +2 -0
  198. package/.next/server/chunks/{[root-of-the-server]__0-12_rul4y06m._.js → [root-of-the-server]__015ejcb8twm6c._.js} +1 -1
  199. package/.next/server/chunks/{[root-of-the-server]__0rbh_oqaajxmo._.js → [root-of-the-server]__03g_n15zojhn2._.js} +2 -2
  200. package/.next/server/chunks/{[root-of-the-server]__0brc9a9ftklux._.js → [root-of-the-server]__041tflu88yv18._.js} +1 -1
  201. package/.next/server/chunks/{[root-of-the-server]__1g2qwf_mnzqly._.js → [root-of-the-server]__04vkejt7399qm._.js} +2 -2
  202. package/.next/server/chunks/{[root-of-the-server]__03nsgjsm70ted._.js → [root-of-the-server]__05d1rfm7p02tv._.js} +2 -2
  203. package/.next/server/chunks/{[root-of-the-server]__05-dvjb11wbvo._.js → [root-of-the-server]__067bnq3j3z-3_._.js} +1 -1
  204. package/.next/server/chunks/{[root-of-the-server]__0-lanxvfyc5w7._.js → [root-of-the-server]__077qr39ck1pcs._.js} +1 -1
  205. package/.next/server/chunks/{[root-of-the-server]__0b3ss-8ztcftu._.js → [root-of-the-server]__09944y8f_7dhf._.js} +1 -1
  206. package/.next/server/chunks/{[root-of-the-server]__0my6t3vz24mmo._.js → [root-of-the-server]__0a62guogezjl6._.js} +2 -2
  207. package/.next/server/chunks/[root-of-the-server]__0aequ2pnoemzu._.js +3 -0
  208. package/.next/server/chunks/{[root-of-the-server]__0nj600_104dqn._.js → [root-of-the-server]__0f505ene-6a0j._.js} +2 -2
  209. package/.next/server/chunks/{[root-of-the-server]__0zr9l7lnr1i0l._.js → [root-of-the-server]__0gql12o_mf7e8._.js} +2 -2
  210. package/.next/server/chunks/{[root-of-the-server]__0-jhvuvprdrmu._.js → [root-of-the-server]__0lt6zgk4xq6fk._.js} +2 -2
  211. package/.next/server/chunks/[root-of-the-server]__0msiy_bvtvaqo._.js +3 -0
  212. package/.next/server/chunks/[root-of-the-server]__0ul_64h5yov45._.js +3 -0
  213. package/.next/server/chunks/{[root-of-the-server]__0ayraoa4xz-qt._.js → [root-of-the-server]__0uzkv_2-76muc._.js} +2 -2
  214. package/.next/server/chunks/{[root-of-the-server]__1imiyrtb6t6zp._.js → [root-of-the-server]__0v0mt3v8gyonn._.js} +2 -2
  215. package/.next/server/chunks/[root-of-the-server]__0vqoda1k-uvtz._.js +3 -0
  216. package/.next/server/chunks/{[root-of-the-server]__0icc6dvauvb15._.js → [root-of-the-server]__0vqtidz1lisc6._.js} +2 -2
  217. package/.next/server/chunks/{[root-of-the-server]__1ya630gfyks-f._.js → [root-of-the-server]__0y48od_b_qxct._.js} +2 -2
  218. package/.next/server/chunks/[root-of-the-server]__0zxrtk19v5vnf._.js +3 -0
  219. package/.next/server/chunks/[root-of-the-server]__0zxxkvf-ns40a._.js +3 -0
  220. package/.next/server/chunks/[root-of-the-server]__1-i5zhzxr_18g._.js +3 -0
  221. package/.next/server/chunks/[root-of-the-server]__10_vi76_sexvg._.js +3 -0
  222. package/.next/server/chunks/[root-of-the-server]__10lamgabz68ix._.js +3 -0
  223. package/.next/server/chunks/{[root-of-the-server]__03rln5n_21ad0._.js → [root-of-the-server]__118rtr0shk1ii._.js} +2 -2
  224. package/.next/server/chunks/[root-of-the-server]__11nevdba2vhtt._.js +3 -0
  225. package/.next/server/chunks/{[root-of-the-server]__0jb_3-yu-o6ms._.js → [root-of-the-server]__17aiova74blq9._.js} +2 -2
  226. package/.next/server/chunks/[root-of-the-server]__17o-ysd_xsch6._.js +3 -0
  227. package/.next/server/chunks/{[root-of-the-server]__023qntqk9nbma._.js → [root-of-the-server]__1930xo407ogqu._.js} +2 -2
  228. package/.next/server/chunks/{[root-of-the-server]__0qb8n1h-am-es._.js → [root-of-the-server]__1awckh2w31m-1._.js} +2 -2
  229. package/.next/server/chunks/[root-of-the-server]__1d39wr4nvawz9._.js +3 -0
  230. package/.next/server/chunks/{[root-of-the-server]__0h7igxq4ub38i._.js → [root-of-the-server]__1f1o5gbmw9gv7._.js} +2 -2
  231. package/.next/server/chunks/{[root-of-the-server]__12tt2pf5nuueu._.js → [root-of-the-server]__1hrdz_-5s3775._.js} +2 -2
  232. package/.next/server/chunks/[root-of-the-server]__1lbtlpnl59fx4._.js +3 -0
  233. package/.next/server/chunks/{[root-of-the-server]__199tod2f3vhny._.js → [root-of-the-server]__1n00d73k7_qf5._.js} +2 -2
  234. package/.next/server/chunks/[root-of-the-server]__1nos0_eby5gj4._.js +3 -0
  235. package/.next/server/chunks/{[root-of-the-server]__0jjisfje72sqz._.js → [root-of-the-server]__1np0y-f3_9a11._.js} +2 -2
  236. package/.next/server/chunks/{[root-of-the-server]__1-302_px1h0qz._.js → [root-of-the-server]__1pfiautl3zc2f._.js} +2 -2
  237. package/.next/server/chunks/[root-of-the-server]__1q-qp9_6drnjc._.js +3 -0
  238. package/.next/server/chunks/[root-of-the-server]__1r0p8cbxayfm4._.js +3 -0
  239. package/.next/server/chunks/[root-of-the-server]__1uamx3r_5niri._.js +3 -0
  240. package/.next/server/chunks/[root-of-the-server]__1ubqs9ptth-gi._.js +3 -0
  241. package/.next/server/chunks/{[root-of-the-server]__20i0-g_8_okaf._.js → [root-of-the-server]__1wjrhbs_gcrzx._.js} +2 -2
  242. package/.next/server/chunks/[root-of-the-server]__1wvpsikw739ko._.js +3 -0
  243. package/.next/server/chunks/[root-of-the-server]__1y4bactsi95qg._.js +3 -0
  244. package/.next/server/chunks/[root-of-the-server]__1yribihoxvucv._.js +3 -0
  245. package/.next/server/chunks/[root-of-the-server]__1zt-23c4kv6ca._.js +3 -0
  246. package/.next/server/chunks/{[root-of-the-server]__0u2_q8y9hl1u-._.js → [root-of-the-server]__20al_f02-oyfd._.js} +2 -2
  247. package/.next/server/chunks/_09o9zamz75n5d._.js +3 -0
  248. package/.next/server/chunks/_0_rhee7wb6tcg._.js +3 -0
  249. package/.next/server/chunks/{_0ekrwj-qx_6uh._.js → _0q-x4ftphyse4._.js} +2 -2
  250. package/.next/server/chunks/{_0x3ltk09eli_f._.js → _1btq785jvvco6._.js} +2 -2
  251. package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
  252. package/.next/server/chunks/_next-internal_server_app_api_setup_route_actions_0txsuev7wlgqs.js +3 -0
  253. package/.next/server/chunks/ssr/[root-of-the-server]__05d1gc-h-sk6z._.js +3 -0
  254. package/.next/server/chunks/ssr/[root-of-the-server]__06cr_rl6w07mf._.js +3 -0
  255. package/.next/server/chunks/ssr/[root-of-the-server]__0d-q1qjhzf_nt._.js +3 -0
  256. package/.next/server/chunks/ssr/{[root-of-the-server]__1b9f3v7g4ocyf._.js → [root-of-the-server]__0wbg4fz5qe7h-._.js} +1 -1
  257. package/.next/server/chunks/ssr/[root-of-the-server]__14c291vzuew0p._.js +3 -0
  258. package/.next/server/chunks/ssr/[root-of-the-server]__1_zton0k4t3va._.js +3 -0
  259. package/.next/server/chunks/ssr/[root-of-the-server]__1kh02fdj3kar7._.js +3 -0
  260. package/.next/server/chunks/ssr/{[root-of-the-server]__1xfc5gf4weasu._.js → [root-of-the-server]__1zh2txrawxztj._.js} +1 -1
  261. package/.next/server/chunks/ssr/_00np6xqvkg6u-._.js +1 -1
  262. package/.next/server/chunks/ssr/_04ziy8_ak_olr._.js +3 -0
  263. package/.next/server/chunks/ssr/_05alwt3w7oor-._.js +3 -0
  264. package/.next/server/chunks/ssr/_06k5kn4q-1k90._.js +3 -0
  265. package/.next/server/chunks/ssr/_0h6qsip9mphaq._.js +1 -1
  266. package/.next/server/chunks/ssr/_0iy-5lwc8jb9d._.js +3 -0
  267. package/.next/server/chunks/ssr/_0lpyto7r47jl8._.js +3 -0
  268. package/.next/server/chunks/ssr/_0ms6yihjxbuy1._.js +3 -0
  269. package/.next/server/chunks/ssr/_0oksf3a6pbj88._.js +3 -0
  270. package/.next/server/chunks/ssr/{_110r17vqu8gol._.js → _0p61m7hr-1evu._.js} +1 -1
  271. package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
  272. package/.next/server/chunks/ssr/_0trykmkw0cncr._.js +32 -0
  273. package/.next/server/chunks/ssr/{_1-bq77e5afl30._.js → _0vq069p6upfdb._.js} +1 -1
  274. package/.next/server/chunks/ssr/{_1f1l6ubybak3a._.js → _0z-gzl29_yrkq._.js} +2 -2
  275. package/.next/server/chunks/ssr/{_1prnv9r-jt4dy._.js → _10gxtgntt3mjd._.js} +1 -1
  276. package/.next/server/chunks/ssr/_11xqn1cgzpe6k._.js +3 -0
  277. package/.next/server/chunks/ssr/_1g8mzz6qxv2mr._.js +1 -1
  278. package/.next/server/chunks/ssr/_1tg3c_6clbzhd._.js +3 -0
  279. package/.next/server/chunks/ssr/_1yaa5p1rk6i7c._.js +3 -0
  280. package/.next/server/chunks/ssr/_next-internal_server_app_setup_page_actions_0u1sm0sllb5ji.js +3 -0
  281. package/.next/server/chunks/ssr/node_modules_004qzwkmt-_w5._.js +3 -0
  282. package/.next/server/chunks/ssr/{node_modules_@radix-ui_0jungqz8-8rpt._.js → node_modules_00hekemtvh207._.js} +2 -2
  283. package/.next/server/chunks/ssr/node_modules_207wmjzllytiz._.js +3 -0
  284. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0th0mlz3ys-17._.js +3 -0
  285. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1tz6jn4lbq7wr._.js +3 -0
  286. package/.next/server/chunks/ssr/{node_modules_next_dist_0ufsi7bhcumza._.js → node_modules_next_dist_0rsvep-qefr2x._.js} +2 -2
  287. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1a9z9hjfg293y.js +3 -0
  288. package/.next/server/chunks/ssr/src_0_rgx1hl-1b6i._.js +3 -0
  289. package/.next/server/chunks/ssr/src_0av4wv_56wg9j._.js +3 -0
  290. package/.next/server/chunks/ssr/src_0wxvmqdi_0uno._.js +3 -0
  291. package/.next/server/chunks/ssr/src_13u20tdu4gmgj._.js +1 -1
  292. package/.next/server/chunks/ssr/src_1jhctayt9gxoc._.js +3 -0
  293. package/.next/server/chunks/ssr/src_app_exams_[id]_page_tsx_0xcjflkgkwzgd._.js +1 -1
  294. package/.next/server/chunks/ssr/src_app_exams_page_tsx_17_d4_gy2i1ds._.js +1 -1
  295. package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
  296. package/.next/server/chunks/ssr/src_app_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
  297. package/.next/server/chunks/ssr/src_app_print-preview_page_tsx_001yt-fzrj7tf._.js +1 -1
  298. package/.next/server/chunks/ssr/src_app_setup_page_tsx_0szlnxow_9skp._.js +3 -0
  299. package/.next/server/chunks/ssr/src_components_04xv7f-d7_fyc._.js +3 -0
  300. package/.next/server/chunks/ssr/src_components_1lbiuzxejiwvf._.js +3 -0
  301. package/.next/server/chunks/ssr/src_components_create-notebook-dialog_tsx_0c5teagim70r7._.js +3 -0
  302. package/.next/server/chunks/ssr/src_components_error-list_error-item-card_tsx_1zsiqsrj-jjd7._.js +1 -1
  303. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +10 -10
  304. package/.next/server/edge/chunks/node_modules_0um8zwzayafzq._.js +1 -1
  305. package/.next/server/middleware-build-manifest.js +54 -43
  306. package/.next/server/middleware-manifest.json +5 -5
  307. package/.next/server/next-font-manifest.js +1 -1
  308. package/.next/server/next-font-manifest.json +4 -0
  309. package/.next/server/pages/500.html +1 -1
  310. package/.next/server/preview-props.json +3 -3
  311. package/.next/server/server-reference-manifest.js +1 -1
  312. package/.next/server/server-reference-manifest.json +1 -1
  313. package/.next/static/chunks/02bal925qbinj.js +1 -0
  314. package/.next/static/chunks/0g5r7y3bbmc-b.js +1 -0
  315. package/.next/static/chunks/0hfox3n5lesf0.js +191 -0
  316. package/.next/static/chunks/{0aqlzwgn78ncm.js → 0p-3zwi9dqdk8.js} +1 -1
  317. package/.next/static/chunks/0r7n8__w9jr5w.js +1 -0
  318. package/.next/static/chunks/1cp-v-3d-80iz.js +1 -0
  319. package/.next/static/chunks/{3mb_v650fie_i.js → 1fkaya2t7r343.js} +1 -1
  320. package/.next/static/chunks/1qa6rlj01hnl5.js +1 -0
  321. package/.next/static/chunks/1zplgew-00wdz.js +1 -0
  322. package/.next/static/chunks/{093w4w_19h9qh.js → 263d57goy87o4.js} +2 -2
  323. package/.next/static/chunks/29ctahruklp-r.js +1 -0
  324. package/.next/static/chunks/2h685ie6ojjd6.js +1 -0
  325. package/.next/static/chunks/2ods71pgjc-e2.js +1 -0
  326. package/.next/static/chunks/2q9n-d4_9bhp2.js +1 -0
  327. package/.next/static/chunks/2rgflf9-3s4ud.js +1 -0
  328. package/.next/static/chunks/{2l-1t8-pfq4ph.js → 2t6ygiu56xwkx.js} +1 -1
  329. package/.next/static/chunks/2ucdm1a-llop_.js +1 -0
  330. package/.next/static/chunks/314x1g250-zss.js +1 -0
  331. package/.next/static/chunks/{29m8r4g8_em2g.js → 3icoc8gklzn52.js} +1 -1
  332. package/.next/static/chunks/3jb_u6u63wui6.js +1 -0
  333. package/.next/static/chunks/3tc0l--v631lz.js +1 -0
  334. package/.next/static/chunks/3wxogk-dqqw8w.js +1 -0
  335. package/.next/static/chunks/40q-bbhsqichn.js +1 -0
  336. package/.next/static/chunks/43xs7yzz06q0y.css +3 -0
  337. package/.next/static/chunks/45c1obyfb78ht.js +3 -0
  338. package/README.md +1 -1
  339. package/bin/wrong-notebook.js +1 -1
  340. package/launcher.js +1 -1
  341. package/package.json +1 -1
  342. package/prisma/seed.db +0 -0
  343. package/.next/server/chunks/[root-of-the-server]__0dmllzem7rfag._.js +0 -3
  344. package/.next/server/chunks/[root-of-the-server]__0gx76tnihfcyv._.js +0 -3
  345. package/.next/server/chunks/[root-of-the-server]__0kskkg4ve55lv._.js +0 -3
  346. package/.next/server/chunks/[root-of-the-server]__0mbd9_76yhyaf._.js +0 -3
  347. package/.next/server/chunks/[root-of-the-server]__0q4s9a9wy51vm._.js +0 -3
  348. package/.next/server/chunks/[root-of-the-server]__0v3k8_i3f2v13._.js +0 -3
  349. package/.next/server/chunks/[root-of-the-server]__0vu6_38lbzxar._.js +0 -3
  350. package/.next/server/chunks/[root-of-the-server]__0wcet8-wl-oad._.js +0 -3
  351. package/.next/server/chunks/[root-of-the-server]__13z5coff9j0sa._.js +0 -3
  352. package/.next/server/chunks/[root-of-the-server]__14n5uude1fj4h._.js +0 -3
  353. package/.next/server/chunks/[root-of-the-server]__18lmdddgrhac8._.js +0 -3
  354. package/.next/server/chunks/[root-of-the-server]__1bep0vcwbtlfu._.js +0 -3
  355. package/.next/server/chunks/[root-of-the-server]__1esyxu40fpnyx._.js +0 -3
  356. package/.next/server/chunks/[root-of-the-server]__1iux__qytdtm5._.js +0 -3
  357. package/.next/server/chunks/[root-of-the-server]__1jthkkelxfeb0._.js +0 -3
  358. package/.next/server/chunks/[root-of-the-server]__1k7cmt02s_syx._.js +0 -3
  359. package/.next/server/chunks/[root-of-the-server]__1kvcjw9quzr0w._.js +0 -3
  360. package/.next/server/chunks/[root-of-the-server]__1p08ff3pxle05._.js +0 -3
  361. package/.next/server/chunks/[root-of-the-server]__1rfqipe89aq-u._.js +0 -3
  362. package/.next/server/chunks/[root-of-the-server]__1uscfmw0q-en5._.js +0 -3
  363. package/.next/server/chunks/[root-of-the-server]__1yslrvk_y61kt._.js +0 -3
  364. package/.next/server/chunks/[root-of-the-server]__20sulb1y6n1b8._.js +0 -3
  365. package/.next/server/chunks/_0c25unp5_llaq._.js +0 -3
  366. package/.next/server/chunks/ssr/[root-of-the-server]__0i73t4kmj3-mp._.js +0 -3
  367. package/.next/server/chunks/ssr/[root-of-the-server]__18i084ru7sq9w._.js +0 -3
  368. package/.next/server/chunks/ssr/[root-of-the-server]__1i2zrji0j2c3l._.js +0 -3
  369. package/.next/server/chunks/ssr/[root-of-the-server]__1upv9f0hlagx7._.js +0 -3
  370. package/.next/server/chunks/ssr/[root-of-the-server]__1urwx866fvhi4._.js +0 -3
  371. package/.next/server/chunks/ssr/_0bsjhzelppbjh._.js +0 -3
  372. package/.next/server/chunks/ssr/_0di9wj37_9zhf._.js +0 -3
  373. package/.next/server/chunks/ssr/_0ng735s0jio00._.js +0 -3
  374. package/.next/server/chunks/ssr/_0t2jed64ec8vu._.js +0 -3
  375. package/.next/server/chunks/ssr/_0uvml2k65e53w._.js +0 -3
  376. package/.next/server/chunks/ssr/_1-sbpqghw1pn7._.js +0 -3
  377. package/.next/server/chunks/ssr/_14d3enlxi54zl._.js +0 -3
  378. package/.next/server/chunks/ssr/_1b9b1aq5b_1sj._.js +0 -3
  379. package/.next/server/chunks/ssr/_1g12ubvpxwe-j._.js +0 -3
  380. package/.next/server/chunks/ssr/_1i0mdte5du0e1._.js +0 -3
  381. package/.next/server/chunks/ssr/node_modules_@radix-ui_0im69oqv_i2ki._.js +0 -3
  382. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1_p6srzucwl-s._.js +0 -3
  383. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_1g_su6v6_1gmz._.js +0 -3
  384. package/.next/server/chunks/ssr/src_app_tags_page_tsx_1h2vkk4hv_zlp._.js +0 -3
  385. package/.next/static/chunks/08wadcj8wbdsy.js +0 -1
  386. package/.next/static/chunks/0e7mao0hn_nw4.js +0 -1
  387. package/.next/static/chunks/0pdeh9usti0bj.js +0 -3
  388. package/.next/static/chunks/14a1tth-1ddn-.js +0 -1
  389. package/.next/static/chunks/15e5p9740moee.js +0 -1
  390. package/.next/static/chunks/181--wh89vylg.js +0 -1
  391. package/.next/static/chunks/1_h2h09t_394a.js +0 -1
  392. package/.next/static/chunks/1enxsrqonvvxr.js +0 -1
  393. package/.next/static/chunks/1m3ompn8ev8gr.js +0 -1
  394. package/.next/static/chunks/1nimjc5xqpgag.js +0 -191
  395. package/.next/static/chunks/1v_ioerabkr4s.js +0 -1
  396. package/.next/static/chunks/1wqqkfg03tuu1.js +0 -1
  397. package/.next/static/chunks/2ir3p1tlsazez.js +0 -1
  398. package/.next/static/chunks/2tayqxc443yyh.js +0 -1
  399. package/.next/static/chunks/2v3rvsf6-bnfs.js +0 -1
  400. package/.next/static/chunks/30eew6y-03vg8.js +0 -1
  401. package/.next/static/chunks/32oh815gi42ey.js +0 -1
  402. package/.next/static/chunks/3gvzs1nxarb0s.js +0 -1
  403. package/.next/static/chunks/3r4z_6i5z0hd5.js +0 -1
  404. package/.next/static/chunks/3wm2jhitfeeue.js +0 -1
  405. package/.next/static/chunks/43gsd2ww2f2iy.css +0 -3
  406. /package/.next/static/{5uNP139l0DCSagwPDMOvD → RKk8t6MmArFLi1wGSWXua}/_buildManifest.js +0 -0
  407. /package/.next/static/{5uNP139l0DCSagwPDMOvD → RKk8t6MmArFLi1wGSWXua}/_clientMiddlewareManifest.js +0 -0
  408. /package/.next/static/{5uNP139l0DCSagwPDMOvD → RKk8t6MmArFLi1wGSWXua}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,72664,3198,e=>{var t=e.i(475254);let r=(0,t.f)("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);e.s(["f",0,r],72664);var i=e.i(843476),a=e.i(271645),n=e.i(531278);let s=(0,t.f)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),o=(0,t.f)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);var l=e.i(367240),d=e.i(16715),h=e.i(727612),c=e.i(519455),u=e.i(111110),m=e.i(294114),g=e.i(201276);let p=null,f=["setcoordsystem","setaxesvisible","setgridvisible","setcolor","setlinethickness","setlinestyle","setpointsize","setpointstyle","setlabelvisible","setcaption","setvisible","setfilling","setvalue","setfixed","setbackgroundcolor"];function w(e,t,r){let i=e?.firstElementChild;i&&(i.style.width="100%",i.style.height=`${r}px`,t?.setSize(e?.offsetWidth||i.offsetWidth||800,r))}function x(e,t){for(let r of t)try{if(function(e){let t=e.toLowerCase().trim();return f.some(e=>t.startsWith(e+"("))}(r)){let t=function(e){let t=e.match(/^(\w+)\(([\s\S]+)\)$/);if(!t)return null;try{let e=t[2].trim();if(e.startsWith("[")&&e.endsWith("]"))return{m:t[1],a:JSON.parse(e)};if(/^-?\d+(\.\d+)?$/.test(e))return{m:t[1],a:[Number(e)]};if("true"===e||"false"===e)return{m:t[1],a:["true"===e]};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{m:t[1],a:[e.slice(1,-1)]};let r=e.split(",").map(e=>e.trim()).map(e=>/^-?\d+(\.\d+)?$/.test(e)?Number(e):"true"===e||"false"===e?"true"===e:e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e);return{m:t[1],a:r}}catch{return null}}(r),i=t?e[t.m]:void 0;t&&"function"==typeof i&&i.apply(e,t.a)}else{let t=r.trim();t&&!/[<>'"]/.test(t)?e.evalCommand(t):g.f.warn("[GGB]","Blocked potentially unsafe command",{command:r.substring(0,50)})}}catch(e){g.f.warn("[GGB]","Command failed",{command:r,error:e})}}e.s(["f",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:f=!1,showMenuBar:y=!1,className:b="",onRegenerate:v,onDelete:C}){let{t:k}=(0,u.b)(),j=(0,a.useRef)(null),N=(0,a.useRef)(null),D=(0,a.useId)(),M=(0,a.useRef)(`ggb-${D.replace(/[^a-zA-Z0-9_-]/g,"")}`),[R,E]=(0,a.useState)(!0),[S,$]=(0,a.useState)(null),[I,_]=(0,a.useState)(!0),[P,B]=(0,a.useState)(!1),[H,A]=(0,a.useState)(!1),z=(0,a.useMemo)(()=>(function(e){if(!e?.trim())return[];let t=e.trim();if(t.startsWith("["))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&""!==e.trim())}catch{}return t.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//"))})(e),[e]);(0,a.useEffect)(()=>{if(0===z.length)return;let e=!1,i=M.current,a=j.current;return(p||(p=new Promise((e,t)=>{if(window.GGBApplet)return void e();let r=document.createElement("script");r.src="https://www.geogebra.org/apps/deployggb.js",r.async=!0,r.onload=()=>e(),r.onerror=()=>{p=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let n=window.GGBApplet;if(!n){$(k.geogebra.notLoaded),E(!1);return}if(a){a.innerHTML=`<div id="${i}" style="width:100%;height:${t}px"></div>`;try{new n({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:f,showMenuBar:y,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(N.current=r,w(a,r,t),x(r,z),E(!1))}},!0).inject(i)}catch(t){g.f.error("[GGB]","Init failed",{error:t}),e||($(k.geogebra.initFailed),E(!1))}}}).catch(t=>{g.f.error("[GGB]","Script load failed",{error:t}),e||($(k.geogebra.scriptFailed),E(!1))}),()=>{e=!0;try{let e=N.current;e?.remove&&e.remove()}catch(e){g.f.warn("[GGB]","Cleanup failed",{error:e})}N.current=null,a&&(a.innerHTML="")}},[z,r,f,y]),(0,a.useEffect)(()=>{w(j.current,N.current,I?700:t)},[I,t]);let L=(0,a.useCallback)(()=>{let e=N.current;if(e)try{e.resetConstruction(),setTimeout(()=>{N.current&&x(N.current,z)},300)}catch(e){g.f.warn("[GGB]","Reset failed",{error:e})}},[z]),X=(0,a.useCallback)(async()=>{if(v&&!P){B(!0);try{await v()}finally{B(!1)}}},[v,P]),Y=(0,a.useCallback)(async()=>{if(C&&!H&&await (0,m.u)(k.geogebra.confirmDelete,{destructive:!0})){A(!0);try{await C()}catch{m.c.error(k.geogebra.deleteFailed)}finally{A(!1)}}},[C,H,k]);return 0===z.length?null:(0,i.jsxs)("div",{className:`relative rounded-lg border bg-card ${b}`,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:k.geogebra.title}),R&&(0,i.jsx)(n.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[v&&(0,i.jsxs)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:X,title:k.geogebra.regenerate,disabled:P||R,children:[P?(0,i.jsx)(n.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(d.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.regenerate})]}),C&&(0,i.jsxs)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:Y,title:k.geogebra.delete,disabled:H||P,children:[H?(0,i.jsx)(n.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(h.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.delete})]}),(0,i.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:L,title:k.geogebra.reset,disabled:R,children:(0,i.jsx)(l.f,{className:"h-3.5 w-3.5"})}),(0,i.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>_(e=>!e),title:I?k.geogebra.shrink:k.geogebra.enlarge,children:I?(0,i.jsx)(o,{className:"h-3.5 w-3.5"}):(0,i.jsx)(s,{className:"h-3.5 w-3.5"})})]})]}),(0,i.jsx)("div",{ref:j,style:{width:"100%"}}),R&&(0,i.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,i.jsx)(n.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm text-muted-foreground",children:k.geogebra.loading})]})}),S&&(0,i.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:S})]})}],3198)},356909,e=>{let t=(0,e.i(475254).f)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["f",0,t],356909)},283086,e=>{let t=(0,e.i(475254).f)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["f",0,t],283086)},469937,62825,e=>{var t=e.i(843476);let r=(0,e.i(475254).f)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var i=e.i(111110),a=e.i(975157);let n=[1,2,3,4,5];function s(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["f",0,function({value:e,onChange:s,disabled:o,size:l="sm",showUnrated:d=!0,className:h}){let{t:c}=(0,i.b)(),u=e??0,m="sm"===l?"h-3.5 w-3.5":"h-5 w-5",g=u?c.difficulty.starsLabel.replace("{n}",String(u)):c.difficulty.unrated;return s?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",h),role:"group","aria-label":`${c.difficulty.label}:${g}`,title:c.difficulty.clearHint,children:[n.map(e=>(0,t.jsx)("button",{type:"button",disabled:o,onClick:()=>s(e===u?null:e),"aria-label":c.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(r,{className:(0,a.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:c.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",h),role:"img","aria-label":`${c.difficulty.label}:${g}`,title:g,children:n.map(e=>(0,t.jsx)(r,{className:(0,a.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",h),children:c.difficulty.unrated}):null}],469937),e.s(["i",0,function(e,t="zh"){return("en"===t?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[s(e)]},"h",0,s,"x",0,function(e,t){return(t||"").trim()?"wrong_attempt":s(e)}],62825)},12130,e=>{var t=e.i(843476),r=e.i(271645),i=r,a={x:0,y:0,width:0,height:0,unit:"px"},n=(e,t,r)=>Math.min(Math.max(e,t),r),s=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function o(e,t,r){return"%"===e.unit?{...a,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function l(e,t,r){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...a,...e,unit:"px"}}function d(e,t,r,i,a,n=0,s=0,o=i,l=a){let h={...e},c=Math.min(n,i),u=Math.min(s,a),m=Math.min(o,i),g=Math.min(l,a);t&&(t>1?(u=(c=s?s*t:c)/t,m=o*t):(c=(u=n?n/t:u)*t,g=l/t)),h.y<0&&(h.height=Math.max(h.height+h.y,u),h.y=0),h.x<0&&(h.width=Math.max(h.width+h.x,c),h.x=0);let p=i-(h.x+h.width);p<0&&(h.x=Math.min(h.x,i-c),h.width+=p);let f=a-(h.y+h.height);if(f<0&&(h.y=Math.min(h.y,a-u),h.height+=f),h.width<c&&(("sw"===r||"nw"==r)&&(h.x-=c-h.width),h.width=c),h.height<u&&(("nw"===r||"ne"==r)&&(h.y-=u-h.height),h.height=u),h.width>m&&(("sw"===r||"nw"==r)&&(h.x-=m-h.width),h.width=m),h.height>g&&(("nw"===r||"ne"==r)&&(h.y-=g-h.height),h.height=g),t){let e=h.width/h.height;if(e<t){let e=Math.max(h.width/t,u);("nw"===r||"ne"==r)&&(h.y-=e-h.height),h.height=e}else if(e>t){let e=Math.max(h.height*t,c);("sw"===r||"nw"==r)&&(h.x-=e-h.width),h.width=e}}return h}var h={capture:!0,passive:!1},c=0,u=class e extends i.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,i.createRef)();mediaRef=(0,i.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${c++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:r,width:i,height:a}=e.getBoundingClientRect();return{x:t,y:r,width:i,height:a}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:i}=this.getBox();e&&i&&r(l(t,e,i),o(t,e,i))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,h),this.document.addEventListener("pointerup",this.onDocPointerDone,h),this.document.addEventListener("pointercancel",this.onDocPointerDone,h),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,h),this.document.removeEventListener("pointerup",this.onDocPointerDone,h),this.document.removeEventListener("pointercancel",this.onDocPointerDone,h),!1)}onCropPointerDown=e=>{let{crop:t,disabled:r}=this.props,i=this.getBox();if(!t)return;let a=l(t,i.width,i.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let n=e.target.dataset.ord,s=e.clientX,o=e.clientY,d=a.x,h=a.y;if(n){let t=e.clientX-i.x,r=e.clientY-i.y,l=0,c=0;"ne"===n||"e"==n?(l=t-(a.x+a.width),c=r-a.y,d=a.x,h=a.y+a.height):"se"===n||"s"===n?(l=t-(a.x+a.width),c=r-(a.y+a.height),d=a.x,h=a.y):"sw"===n||"w"==n?(l=t-a.x,c=r-(a.y+a.height),d=a.x+a.width,h=a.y):("nw"===n||"n"==n)&&(l=t-a.x,c=r-a.y,d=a.x+a.width,h=a.y+a.height),s=d+i.x+l,o=h+i.y+c}this.evData={startClientX:s,startClientY:o,startCropX:d,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!!n,ord:n},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:r,locked:i,keepSelection:a,onChange:n}=this.props,s=this.getBox();if(r||i||a&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let d=e.clientX-s.x,h=e.clientY-s.y,c={unit:"px",x:d,y:h,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:d,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,n(l(c,s.width,s.height),o(c,s.width,s.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:r,disabled:i,onChange:a,onDragStart:n}=this.props,d=this.getBox();if(i||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,n&&n(e));let{evData:h}=this;h.clientX=e.clientX,h.clientY=e.clientY,s(r,t=h.isResize?this.resizeCrop():this.dragCrop())||a(l(t,d.width,d.height),o(t,d.width,d.height))};onComponentKeyDown=t=>{let{crop:r,disabled:i,onChange:a,onComplete:s}=this.props;if(i)return;let d=t.key,h=!1;if(!r)return;let c=this.getBox(),u=this.makePixelCrop(c),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===d?(u.x-=m,h=!0):"ArrowRight"===d?(u.x+=m,h=!0):"ArrowUp"===d?(u.y-=m,h=!0):"ArrowDown"===d&&(u.y+=m,h=!0),h){t.cancelable&&t.preventDefault(),u.x=n(u.x,0,c.width-u.width),u.y=n(u.y,0,c.height-u.height);let e=l(u,c.width,c.height),r=o(u,c.width,c.height);a(e,r),s&&s(e,r)}};onHandlerKeyDown=(t,r)=>{var i,a;let n,{aspect:h=0,crop:c,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(u||!c||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=d((i=l(c,y.width,y.height),a=t.key,n={...i},"ArrowLeft"===a?"nw"===r?(n.x-=b,n.y-=b,n.width+=b,n.height+=b):"w"===r?(n.x-=b,n.width+=b):"sw"===r?(n.x-=b,n.width+=b,n.height+=b):"ne"===r?(n.y+=b,n.width-=b,n.height-=b):"e"===r?n.width-=b:"se"===r&&(n.width-=b,n.height-=b):"ArrowRight"===a&&("nw"===r?(n.x+=b,n.y+=b,n.width-=b,n.height-=b):"w"===r?(n.x+=b,n.width-=b):"sw"===r?(n.x+=b,n.width-=b,n.height-=b):"ne"===r?(n.y-=b,n.width+=b,n.height+=b):"e"===r?n.width+=b:"se"===r&&(n.width+=b,n.height+=b)),"ArrowUp"===a?"nw"===r?(n.x-=b,n.y-=b,n.width+=b,n.height+=b):"n"===r?(n.y-=b,n.height+=b):"ne"===r?(n.y-=b,n.width+=b,n.height+=b):"sw"===r?(n.x+=b,n.width-=b,n.height-=b):"s"===r?n.height-=b:"se"===r&&(n.width-=b,n.height-=b):"ArrowDown"===a&&("nw"===r?(n.x+=b,n.y+=b,n.width-=b,n.height-=b):"n"===r?(n.y+=b,n.height-=b):"ne"===r?(n.y+=b,n.width-=b,n.height-=b):"sw"===r?(n.x-=b,n.width+=b,n.height+=b):"s"===r?n.height+=b:"se"===r&&(n.width+=b,n.height+=b)),n),h,r,y.width,y.height,m,g,p,f);if(!s(c,v)){let e=o(v,y.width,y.height);w(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:r,onComplete:i,onDragEnd:a}=this.props,n=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,a&&a(e),i&&i(l(t,n.width,n.height),o(t,n.width,n.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),i=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return r.x=n(e.startCropX+i,0,t.width-r.width),r.y=n(e.startCropY+a,0,t.height-r.height),r}getPointRegion(e,t,r,i){let{evData:a}=this,n=a.clientX-e.x,s=a.clientY-e.y,o;return o=i&&t?"nw"===t||"n"===t||"ne"===t:s<a.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:n<a.startCropX)?o?"nw":"sw":o?"ne":"se"}resolveMinDimensions(e,t,r=0,i=0){let a=Math.min(r,e.width),n=Math.min(i,e.height);return t&&(a||n)?t>1?a?[a,a/t]:[n*t,n]:n?[n*t,n]:[a,a/t]:[a,n]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:i,maxHeight:a}=this.props,s=this.getBox(),[o,l]=this.resolveMinDimensions(s,r,this.props.minWidth,this.props.minHeight),h=this.makePixelCrop(s),c=this.getPointRegion(s,t.ord,o,l),u=t.ord||c,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(o&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-o)),(l&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-l));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===c?(p.x=t.startCropX,p.width=m,r?p.height=p.width/r:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===c?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,r?p.height=p.width/r:p.height=g):"sw"===c?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),r?p.height=p.width/r:p.height=g):"nw"===c&&(p.x=t.startCropX+m,p.width=Math.abs(m),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=d(p,r,c,s.width,s.height,o,l,i,a);return r||e.xyOrds.indexOf(u)>-1?h=f:e.xOrds.indexOf(u)>-1?(h.x=f.x,h.width=f.width):e.yOrds.indexOf(u)>-1&&(h.y=f.y,h.height=f.height),h.x=n(h.x,0,s.width-h.width),h.y=n(h.y,0,s.height-h.height),h}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:a,renderSelectionAddon:n,ruleOfThirds:s,crop:o}=this.props,l=this.getCropStyle();if(o)return i.default.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!a&&i.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},i.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),n&&i.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},n(this.state)),s&&i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return l({...a,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:a,crop:n,disabled:s,locked:o,style:l,ruleOfThirds:d}=this.props,{cropIsActive:h,newCropIsBeingDrawn:c}=this.state,u=n?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",a,h&&"ReactCrop--active",s&&"ReactCrop--disabled",o&&"ReactCrop--locked",c&&"ReactCrop--new-crop",n&&e&&"ReactCrop--fixed-aspect",n&&r&&"ReactCrop--circular-crop",n&&d&&"ReactCrop--rule-of-thirds",!this.dragStarted&&n&&!n.width&&!n.height&&"ReactCrop--invisible-crop",r&&"ReactCrop--no-animate");return i.default.createElement("div",{ref:this.componentRef,className:m,style:l},i.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),n?i.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},i.default.createElement("defs",null,i.default.createElement("mask",{id:`hole-${this.instanceId}`},i.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),r?i.default.createElement("ellipse",{cx:`${n.x+n.width/2}${n.unit}`,cy:`${n.y+n.height/2}${n.unit}`,rx:`${n.width/2}${n.unit}`,ry:`${n.height/2}${n.unit}`,fill:"black"}):i.default.createElement("rect",{x:`${n.x}${n.unit}`,y:`${n.y}${n.unit}`,width:`${n.width}${n.unit}`,height:`${n.height}${n.unit}`,fill:"black"}))),i.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}},m=e.i(519455),g=e.i(776639),p=e.i(37727),f=e.i(111110);async function w(e,t){let{naturalWidth:r,naturalHeight:i}=e;return Promise.all(t.map(t=>new Promise((a,n)=>{let s=document.createElement("canvas"),o=Math.round(t.x*r),l=Math.round(t.y*i);s.width=Math.max(1,Math.round(t.width*r)),s.height=Math.max(1,Math.round(t.height*i));let d=s.getContext("2d");d?(d.drawImage(e,o,l,s.width,s.height,0,0,s.width,s.height),s.toBlob(e=>e?a(e):n(Error("Canvas is empty")),"image/jpeg",.95)):n(Error("Canvas is not supported"))})))}let x=(0,r.forwardRef)(function({imageSrc:e,regions:i,onChange:a},n){let{t:s}=(0,f.b)(),o=(0,r.useRef)(null),l=(0,r.useRef)(null),[d,h]=(0,r.useState)(null),c=e=>{let t=o.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},u=()=>{d&&d.width>=.02&&d.height>=.02&&a([...i,d]),l.current=null,h(null)},m=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:n,src:e,alt:"",draggable:!1,style:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},className:"block"}),(0,t.jsxs)("div",{ref:o,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(o.current?.setPointerCapture(e.pointerId),l.current=c(e),h(null))},onPointerMove:e=>{var t,r,i,a;let n,s,o;if(!l.current)return;let d=c(e);h((t=l.current.x,r=l.current.y,i=d.x,a=d.y,s=(n=e=>Math.min(1,Math.max(0,e)))(Math.min(t,i)),o=n(Math.min(r,a)),{x:s,y:o,width:n(Math.max(t,i))-s,height:n(Math.max(r,a))-o}))},onPointerUp:u,onPointerCancel:u,children:[i.map((e,r)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:m(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:r+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":s.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>a(i.filter((e,t)=>t!==r)),children:(0,t.jsx)(p.X,{className:"h-3 w-3"})})]},r)),d&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:m(d)})]})]})});var y=e.i(201276);e.s(["f",0,function({imageSrc:e,open:i,onClose:a,onCropComplete:n,onMultiCropComplete:s}){let{t:o}=(0,f.b)(),[l,d]=(0,r.useState)(),[h,c]=(0,r.useState)(),p=(0,r.useRef)(null),[b,v]=(0,r.useState)("single"),[C,k]=(0,r.useState)({src:e,regions:[]}),j=C.src===e?C.regions:[],N=t=>k({src:e,regions:t}),D=(0,r.useRef)(null),M=async()=>{if(D.current&&0!==j.length&&s)try{s(await w(D.current,j)),N([])}catch(e){y.f.error("[ImageCropper]","Multi-image crop failed",{error:e})}},R=async(e,t)=>{let r=document.createElement("canvas"),i=e.naturalWidth/e.width,a=e.naturalHeight/e.height;r.width=t.width*i,r.height=t.height*a;let n=r.getContext("2d");return n?(n.drawImage(e,t.x*i,t.y*a,t.width*i,t.height*a,0,0,t.width*i,t.height*a),new Promise((e,t)=>{r.toBlob(r=>{r?e(r):t(Error("Canvas is empty"))},"image/jpeg")})):null},E=async()=>{if(h&&p.current)try{let e=await R(p.current,h);e&&n(e)}catch(e){y.f.error("[ImageCropper]","Crop failed",{error:e})}else if(!h&&e)try{let t=await fetch(e),r=await t.blob();n(r)}catch(e){y.f.error("[ImageCropper]","Failed to load original image",{error:e})}};return(0,t.jsx)(g.N,{open:i,onOpenChange:e=>!e&&a(),children:(0,t.jsxs)(g.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(g.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(g.F,{children:o.common.cropper?.title||"Crop Image"})}),(0,t.jsx)("div",{className:"flex-1 bg-black w-full overflow-auto flex items-center justify-center p-4",children:"multi"===b?(0,t.jsx)(x,{ref:D,imageSrc:e,regions:j,onChange:N}):(0,t.jsx)(u,{crop:l,onChange:(e,t)=>d(t),onComplete:e=>c(e),className:"max-h-full",children:(0,t.jsx)("img",{ref:p,alt:"Crop me",src:e,onLoad:function(e){let{width:t,height:r}=e.currentTarget;d({unit:"%",x:0,y:0,width:100,height:100}),c({unit:"px",x:0,y:0,width:t,height:r})},style:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"}})})}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[s&&(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:w-80",children:["single","multi"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>v(e),className:`rounded px-3 py-1.5 text-sm font-medium transition-colors ${b===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:"single"===e?o.batchImport.singleMode:o.batchImport.multiMode},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===b?`${o.batchImport.hint} ${o.batchImport.regionCount.replace("{count}",String(j.length))}`:o.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===b&&j.length>0&&(0,t.jsx)(m.f,{variant:"ghost",onClick:()=>N([]),children:o.batchImport.clear}),(0,t.jsx)(m.f,{variant:"outline",onClick:a,children:o.common.cancel||"Cancel"}),"multi"===b?(0,t.jsx)(m.f,{onClick:M,disabled:0===j.length,children:o.batchImport.start.replace("{count}",String(j.length))}):(0,t.jsx)(m.f,{onClick:E,children:o.common.confirm||"Confirm"})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),r=e.i(271645);let i=(0,e.i(475254).f)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);var a=e.i(286536),n=e.i(511445),s=e.i(624687),o=e.i(111110),l=e.i(975157);e.s(["f",0,function({value:e,onChange:d,className:h,...c}){let{t:u}=(0,o.b)(),[m,g]=(0,r.useState)("source"),p=(0,r.useId)(),f=[{mode:"source",label:u.markdownEditor.source,icon:i},{mode:"preview",label:u.markdownEditor.preview,icon:a.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:f.map(({mode:e,label:r,icon:i})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,l.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(i,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(s.f,{value:e,onChange:e=>d(e.target.value),className:h,...c}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(n.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),r=e.i(271645),i=e.i(967489),a=e.i(810980),n=e.i(41931),s=e.i(201276),o=e.i(111110);e.s(["f",0,function({value:e,onChange:l,className:d}){let[h,c]=(0,r.useState)([]),{t:u}=(0,o.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await n.f.get("/api/notebooks");c(e)}catch(e){s.f.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(i.d,{value:e,onValueChange:l,children:[(0,t.jsx)(i.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(i.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(i.r,{children:0===h.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):h.map(e=>(0,t.jsx)(i.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),r=e.i(111110),i=e.i(975157);e.s(["f",0,function({svg:e,className:a}){let{t:n}=(0,r.b)();return e?(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",a),children:(0,t.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:n.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360}})}):null}],149704)},574041,e=>{var t=e.i(843476),r=e.i(271645),i=e.i(37727),a=e.i(487486),n=e.i(793479),s=e.i(41931),o=e.i(201276);e.s(["f",0,function({value:e=[],onChange:l,placeholder:d="Enter tags...",className:h="",enterHint:c,subject:u,gradeStage:m}){let[g,p]=(0,r.useState)(""),[f,w]=(0,r.useState)([]),[x,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(0),C=(0,r.useRef)(null),k=(0,r.useRef)(null),j=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});u&&r.append("subject",u),m&&r.append("stage",m);let i=((await s.f.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(i.slice(0,20)),y(i.length>0),v(0)}catch(e){o.f.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,r.useEffect)(()=>{g.trim()&&j(g)},[g,j]);let N=t=>{t.trim()&&!e.includes(t.trim())&&(l([...e,t.trim()]),p(""),w([]),y(!1),v(0))},D=t=>{l(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||C.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${h}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>D(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(i.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&f[b]?N(f[b]):g.trim()&&N(g)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),v(0)):"Backspace"===t.key&&!g&&e.length>0&&D(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===b?"bg-accent":""}`,onClick:()=>N(e),onMouseEnter:()=>v(r),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:c?`${c} "${g}"`:`Press Enter to create "${g}"`})]})}])},515288,e=>{var t=e.i(843476),r=e.i(975157);e.s(["N",0,function({className:e,...i}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,r.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...i})},"O",0,function({className:e,...i}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.f)("px-6",e),...i})},"u",0,function({className:e,...i}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.f)("text-muted-foreground text-sm",e),...i})},"Y",0,function({className:e,...i}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.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",e),...i})},"v",0,function({className:e,...i}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.f)("leading-none font-semibold",e),...i})}])},28928,e=>{var t=e.i(201276);async function r(e,i=1,a=1920,n=.8){return new Promise((r,s)=>{let o=new FileReader;o.onload=o=>{let l=new Image;l.onload=()=>{let o=document.createElement("canvas"),d=o.getContext("2d");if(!d)return void s(Error("无法获取 Canvas 上下文"));let h=l.width,c=l.height;h>a&&(c=c*a/h,h=a),o.width=h,o.height=c,d.drawImage(l,0,0,h,c);let u=n,m=o.toDataURL("image/jpeg",u),g=3*m.length/4/1024/1024;for(;g>i&&u>.1;){u-=.1;let e=3*(m=o.toDataURL("image/jpeg",u)).length/4/1024/1024;if(t.f.info("[ImageCompress]","Compression step",{quality:Number(u.toFixed(1)),sizeMB:Number(e.toFixed(2))},{sendToBackend:!1}),e<=i)break}t.f.info("[ImageCompress]","Compression finished",{originalMB:Number((e.size/1024/1024).toFixed(2)),compressedMB:Number((3*m.length/4/1024/1024).toFixed(2))}),r(m)},l.onerror=()=>s(Error("图片加载失败")),l.src=o.target?.result},o.onerror=()=>s(Error("文件读取失败")),o.readAsDataURL(e)})}async function i(e){let i=e.size/1024/1024;return(t.f.info("[ImageCompress]","File size checked",{sizeMB:Number(i.toFixed(2))},{sendToBackend:!1}),i>1)?(t.f.info("[ImageCompress]","File exceeds threshold, compressing",void 0,{sendToBackend:!1}),await r(e,1)):(t.f.info("[ImageCompress]","File size OK, no compression needed",void 0,{sendToBackend:!1}),new Promise((t,r)=>{let i=new FileReader;i.onload=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)}))}e.s(["f",0,i])},952122,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])},35209,e=>{var t=e.i(271645),r=e.i(111110);e.s(["f",0,function(...e){let{t:i}=(0,r.b)(),a=[i.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=a},[a])}])},943710,e=>{e.s(["f",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<1||e>5?null:e<=3?"a":"b"}])}])})();
@@ -1 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,871689,e=>{let t=(0,e.i(475254).f)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["f",0,t],871689)},463059,e=>{let t=(0,e.i(475254).f)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["f",0,t],463059)},788699,e=>{let t=(0,e.i(475254).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"}]]);e.s(["f",0,t],788699)},666776,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(618566),i=e.i(519455),n=e.i(912505),o=e.i(393842),r=e.i(86963),l=e.i(531278),c=e.i(475254);let d=(0,c.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 m=e.i(793479),h=e.i(111110),u=e.i(833547),x=e.i(747279);function f(){let{t:e}=(0,h.b)(),n=(0,s.useRouter)(),[o,r]=(0,a.useState)(""),[c,f]=(0,a.useState)(null),[b,g]=(0,a.useState)(!1),p=async t=>{t.preventDefault();let a=o.trim();if(!(0,x.f)(a))return void f(e.shortId.invalid);g(!0),f(null);let s=await (0,u.f)(a);g(!1),s?n.push(`/error-items/${s}`):f(e.shortId.notFound)};return(0,t.jsxs)("form",{onSubmit:p,className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(m.f,{value:o,onChange:e=>{r(e.target.value),f(null)},placeholder:e.shortId.locatePlaceholder,maxLength:6,className:"font-mono sm:max-w-xs","aria-label":e.shortId.locateTitle}),(0,t.jsxs)(i.f,{type:"submit",variant:"outline",disabled:b||!o.trim(),children:[b?(0,t.jsx)(l.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(d,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"ml-2",children:e.shortId.locate})]})]}),c&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:c})]})}var b=e.i(810980),g=e.i(107233);let p=(0,c.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"}]]),k=(0,c.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 y=e.i(463059);let j=(0,c.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"}]]),v=(0,c.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"}]]),N=(0,c.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 w=e.i(763639);let C=(0,c.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 M=e.i(788699);let S=(0,c.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"}]]),z=(0,c.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 F=e.i(727612),R=e.i(709830),E=e.i(76824);let D={math:{icon:z,className:"bg-blue-100 text-blue-600 dark:bg-blue-500/15 dark:text-blue-300"},english:{icon:w.f,className:"bg-emerald-100 text-emerald-600 dark:bg-emerald-500/15 dark:text-emerald-300"},chinese:{icon:k,className:"bg-rose-100 text-rose-600 dark:bg-rose-500/15 dark:text-rose-300"},physics:{icon:p,className:"bg-amber-100 text-amber-600 dark:bg-amber-500/15 dark:text-amber-300"},chemistry:{icon:j,className:"bg-teal-100 text-teal-600 dark:bg-teal-500/15 dark:text-teal-300"},biology:{icon:C,className:"bg-lime-100 text-lime-700 dark:bg-lime-500/15 dark:text-lime-300"},history:{icon:N,className:"bg-orange-100 text-orange-600 dark:bg-orange-500/15 dark:text-orange-300"},geography:{icon:v,className:"bg-cyan-100 text-cyan-600 dark:bg-cyan-500/15 dark:text-cyan-300"},politics:{icon:S,className:"bg-red-100 text-red-600 dark:bg-red-500/15 dark:text-red-300"}},H={icon:b.f,className:"bg-accent text-accent-foreground"};function P({id:e,name:a,stage:s,subjectKey:n,errorCount:o,onClick:r,onRename:l,onDelete:c,itemLabel:d="items"}){let m=(0,E.v)({name:a,stage:s,subjectKey:n}),{icon:h,className:u}=m.subject?D[m.subject]:H;return(0,t.jsxs)("div",{role:"link",tabIndex:0,className:"group relative flex cursor-pointer items-center gap-4 rounded-2xl border bg-card p-4 shadow-sm transition-all hover:-translate-y-0.5 hover:border-primary/40 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onClick:r,onKeyDown:e=>{"Enter"===e.key&&r()},children:[(0,t.jsx)("div",{className:`flex h-12 w-12 shrink-0 items-center justify-center rounded-xl ${u}`,children:(0,t.jsx)(h,{className:"h-6 w-6"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"truncate font-semibold",children:a}),(0,t.jsxs)("p",{className:"mt-0.5 flex items-center gap-1.5 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-medium tabular-nums text-foreground",children:o}),d,(0,t.jsx)("span",{className:"text-border",children:"|"}),(0,t.jsx)(R.E,{notebook:{name:a,stage:s,subjectKey:n},className:"truncate"})]})]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100",children:[l&&(0,t.jsx)(i.f,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:e=>{e.stopPropagation(),l()},children:(0,t.jsx)(M.f,{className:"h-4 w-4"})}),c&&(0,t.jsx)(i.f,{variant:"ghost",size:"icon-sm",onClick:t=>{t.stopPropagation(),c(e)},children:(0,t.jsx)(F.f,{className:`h-4 w-4 ${o>0?"text-muted-foreground":"text-destructive"}`})})]}),(0,t.jsx)(y.f,{className:"hidden h-4 w-4 shrink-0 text-muted-foreground sm:block"})]})}var L=e.i(776639),K=e.i(110204),I=e.i(967489),T=e.i(294114),$=e.i(201276);function A({open:e,onOpenChange:s,onCreate:n}){let[o,r]=(0,a.useState)(""),[l,c]=(0,a.useState)(E.j),[d,u]=(0,a.useState)(E.W[E.j][0]),[x,f]=(0,a.useState)(!1),{t:b}=(0,h.b)(),{stageLabel:g,subjectLabel:p}=(0,R.O)(),k=async()=>{if(!o.trim())return void T.c.warning(b.notebooks?.dialog?.enterName||"Please enter notebook name");f(!0);try{await n({name:o.trim(),stage:l,subjectKey:d}),r(""),s(!1)}catch(e){$.f.error("[CreateNotebook]","Failed to create notebook",{error:e})}finally{f(!1)}};return(0,t.jsx)(L.N,{open:e,onOpenChange:s,children:(0,t.jsxs)(L.d,{children:[(0,t.jsxs)(L.s,{children:[(0,t.jsx)(L.F,{children:b.notebooks?.dialog?.title||"Create New Notebook"}),(0,t.jsx)(L.C,{children:b.notebooks?.dialog?.desc||"Create separate notebooks for different subjects or chapters"})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(K.f,{htmlFor:"notebook-stage",children:b.notebooks.dialog.stageLabel}),(0,t.jsxs)(I.d,{value:l,onValueChange:e=>{c(e),E.W[e].includes(d)||u(E.W[e][0])},children:[(0,t.jsx)(I.P,{id:"notebook-stage",children:(0,t.jsx)(I.U,{})}),(0,t.jsx)(I.r,{children:E.c.map(e=>(0,t.jsx)(I.T,{value:e,children:g(e)},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(K.f,{htmlFor:"notebook-subject",children:b.notebooks.dialog.subjectLabel}),(0,t.jsxs)(I.d,{value:d,onValueChange:e=>u(e),children:[(0,t.jsx)(I.P,{id:"notebook-subject",children:(0,t.jsx)(I.U,{})}),(0,t.jsx)(I.r,{children:E.W[l].map(e=>(0,t.jsx)(I.T,{value:e,children:p(e)},e))})]})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:b.notebooks.dialog.scopeHint}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(K.f,{htmlFor:"name",children:b.notebooks?.dialog?.nameLabel||"Notebook Name"}),(0,t.jsx)(m.f,{id:"name",placeholder:b.notebooks?.dialog?.placeholder||"e.g. Math, Physics, Chemistry...",value:o,onChange:e=>r(e.target.value),onKeyDown:e=>"Enter"===e.key&&k()})]})]}),(0,t.jsxs)(L.c,{children:[(0,t.jsx)(i.f,{variant:"outline",onClick:()=>s(!1),children:b.common.cancel}),(0,t.jsx)(i.f,{onClick:k,disabled:x||!o.trim(),children:x?b.notebooks?.dialog?.creating||"Creating...":b.notebooks?.dialog?.create||"Create"})]})]})})}var O=e.i(67153),_=e.i(41931),U=e.i(35209),V=e.i(303163);e.s(["default",0,function(){let e=(0,s.useRouter)(),{t:l}=(0,h.b)();(0,U.f)(l.notebooks.title);let[c,d]=(0,a.useState)([]),[m,u]=(0,a.useState)(!0),[x,p]=(0,a.useState)(!1),[k,y]=(0,a.useState)(null),j=(0,a.useCallback)(async()=>{try{let e=await _.f.get("/api/notebooks");d(e)}catch(e){$.f.error("[Notebooks]","Failed to fetch notebooks",{error:e})}finally{u(!1)}},[]);(0,a.useEffect)(()=>{j()},[j]);let v=async e=>{try{await _.f.post("/api/notebooks",e),await j()}catch(t){$.f.error("[Notebooks]","Failed to create notebook",{error:t});let e=(0,V.d)(t)||l.notebooks?.createError||"Failed to create";T.c.error(e)}},N=async e=>{k&&(await _.f.put(`/api/notebooks/${k.id}`,{name:e}),y(null),await j())},w=async(e,t,a)=>{if(t>0)return void T.c.warning(l.notebooks?.deleteNotEmpty||"Please clear all items in this notebook first.");if(await (0,T.u)((l.notebooks?.deleteConfirm||"Are you sure?").replace("{name}",a),{destructive:!0}))try{await _.f.delete(`/api/notebooks/${e}`),await j()}catch(t){$.f.error("[Notebooks]","Failed to delete notebook",{error:t});let e=(0,V.d)(t)||l.notebooks?.deleteError||"Failed to delete";T.c.error(e)}};return m?(0,t.jsx)(r.f,{label:l.common.loading}):(0,t.jsx)("main",{className:"mx-auto min-h-screen max-w-6xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(o.f,{title:l.notebooks?.title||"My Notebooks",description:l.notebooks?.subtitle||"Manage your mistakes by subject",actions:(0,t.jsxs)(i.f,{onClick:()=>p(!0),"aria-label":l.notebooks?.create||"New Notebook",children:[(0,t.jsx)(g.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:l.notebooks?.create||"New Notebook"})]})}),(0,t.jsx)(f,{}),0===c.length?(0,t.jsx)(n.f,{icon:b.f,title:l.notebooks?.empty||"No notebooks yet.",action:(0,t.jsxs)(i.f,{onClick:()=>p(!0),children:[(0,t.jsx)(g.f,{className:"h-4 w-4"}),l.notebooks?.createFirst||"Create Notebook"]})}):(0,t.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:c.map(a=>(0,t.jsx)(P,{id:a.id,name:a.name,stage:a.stage,subjectKey:a.subjectKey,errorCount:a._count?.errorItems||0,onClick:()=>{var t;return t=a.id,void e.push(`/notebooks/${t}`)},onRename:()=>y(a),onDelete:()=>w(a.id,a._count?.errorItems||0,a.name),itemLabel:l.notebooks?.items||"items"},a.id))}),(0,t.jsx)(A,{open:x,onOpenChange:p,onCreate:v},l.common.loading),(0,t.jsx)(O.f,{open:!!k,onOpenChange:e=>{e||y(null)},currentName:k?.name||"",onRename:N})]})})}],666776)},709830,76824,e=>{var t=e.i(843476),a=e.i(111110),s=e.i(952122);let i=["primary","junior_high","senior_high"],n="primary",o=["math","english","chinese","physics","chemistry","biology","history","geography","politics"];function r(e){return"string"==typeof e&&o.includes(e)}function l(e){var t;let a=r(e.subjectKey)?e.subjectKey:(0,s.f)(e.name);return{stage:"string"==typeof(t=e.stage)&&i.includes(t)?e.stage:n,subject:a&&r(a)?a:null}}function c(){let{t:e}=(0,a.b)();return{stageLabel:t=>({primary:e.auth.primary,junior_high:e.auth.juniorHigh,senior_high:e.auth.seniorHigh})[t],subjectLabel:t=>e.tags.subjects[t]}}e.s(["j",0,n,"c",0,i,"W",0,{primary:["math","english"],junior_high:o,senior_high:o},"v",0,l],76824),e.s(["E",0,function({notebook:e,className:a}){let{stageLabel:s,subjectLabel:i}=c(),n=l(e);return(0,t.jsxs)("span",{className:a,children:[s(n.stage),n.subject?` \xb7 ${i(n.subject)}`:""]})},"O",0,c],709830)},67153,e=>{var t=e.i(843476),a=e.i(271645),s=e.i(776639),i=e.i(519455),n=e.i(793479),o=e.i(110204),r=e.i(111110),l=e.i(294114),c=e.i(201276);e.s(["f",0,function({open:e,onOpenChange:d,currentName:m,onRename:h}){let[u,x]=(0,a.useState)(m),[f,b]=(0,a.useState)(!1),{t:g}=(0,r.b)(),[p,k]=(0,a.useState)(m);m!==p&&(k(m),x(m));let y=async()=>{if(!u.trim())return void l.c.warning(g.notebooks?.renameDialog?.enterName||"Please enter notebook name");b(!0);try{await h(u.trim()),d(!1)}catch(e){c.f.error("[RenameNotebook]","Failed to rename notebook",{error:e})}finally{b(!1)}};return(0,t.jsx)(s.N,{open:e,onOpenChange:d,children:(0,t.jsxs)(s.d,{children:[(0,t.jsx)(s.s,{children:(0,t.jsx)(s.F,{children:g.notebooks?.renameDialog?.title||"Rename Notebook"})}),(0,t.jsx)("div",{className:"space-y-4 py-4",children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o.f,{htmlFor:"rename-name",children:g.notebooks?.renameDialog?.nameLabel||"New Name"}),(0,t.jsx)(n.f,{id:"rename-name",placeholder:g.notebooks?.renameDialog?.placeholder||"Enter new notebook name",value:u,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&y()})]})}),(0,t.jsxs)(s.c,{children:[(0,t.jsx)(i.f,{variant:"outline",onClick:()=>d(!1),children:g.common.cancel}),(0,t.jsx)(i.f,{onClick:y,disabled:f||!u.trim(),children:f?g.notebooks?.renameDialog?.renaming||"Renaming...":g.notebooks?.renameDialog?.rename||"Rename"})]})]})})}])},590546,e=>{var t=e.i(843476),a=e.i(618566),s=e.i(519455),i=e.i(871689);e.s(["f",0,function({fallbackUrl:e,className:n}){let o=(0,a.useRouter)();return(0,t.jsx)(s.f,{variant:"ghost",size:"icon",onClick:()=>{o.push(e)},className:n,children:(0,t.jsx)(i.f,{className:"h-5 w-5"})})}])},912505,e=>{var t=e.i(843476),a=e.i(975157);e.s(["f",0,function({icon:e,title:s,description:i,action:n,className:o}){return(0,t.jsxs)("div",{className:(0,a.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",o),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:s}),i&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:i}),n&&(0,t.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var t=e.i(843476),a=e.i(590546),s=e.i(975157);e.s(["f",0,function({title:e,description:i,backHref:n,actions:o,titleAddon:r,className:l}){return(0,t.jsxs)("div",{className:(0,s.f)("flex items-start gap-3",l),children:[n&&(0,t.jsx)(a.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),r]}),i&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:i})]}),o&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:o})]})}])},86963,e=>{var t=e.i(843476),a=e.i(531278);e.s(["f",0,function({label:e}){return(0,t.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,t.jsx)(a.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,t.jsx)("p",{className:"text-sm",children:e})]})}])},952122,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])},35209,e=>{var t=e.i(271645),a=e.i(111110);e.s(["f",0,function(...e){let{t:s}=(0,a.b)(),i=[s.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=i},[i])}])},833547,747279,e=>{var t=e.i(41931);async function a(e){try{return(await t.f.get(`/api/error-items/short/${encodeURIComponent(e)}`)).id}catch{return null}}e.s(["f",0,a],833547);let s=RegExp("^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{6}$");e.s(["f",0,function(e){return"string"==typeof e&&s.test(e)}],747279)}])})();
@@ -1 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,981140,e=>{var t=Object.defineProperty,r=(e,r)=>t(e,"name",{value:r,configurable:!0}),n=!!("u">typeof window&&window.document&&window.document.createElement);function o(e,t,{checkForDefaultPrevented:n=!0}={}){return r(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function i(e){if(!n)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function l(e){return"IFRAME"===e.tagName}r(o,"composeEventHandlers"),r(function(e){if(!n)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),r(i,"getOwnerDocument"),r(function e(t,r=!1){let{activeElement:n}=i(t);if(!n?.nodeName)return null;if(l(n)&&n.contentDocument)return e(n.contentDocument.body,r);if(r){let e=n.getAttribute("aria-activedescendant");if(e){let t=i(n).getElementById(e);if(t)return t}}return n},"getActiveElement"),r(l,"isFrame"),e.s(["f",0,o])},705844,e=>{e.s(["f",0,!1])},75830,e=>{var t=e.i(271645),r=e.i(30030),n=e.i(820783),o=e.i(991918),i=e.i(843476),l=e.i(934620),s=Object.defineProperty,u=(e,t)=>s(e,"name",{value:t,configurable:!0});function a(e){let l=e+"CollectionProvider",[s,a]=(0,r.f)(l),[f,c]=s(l,{collectionRef:{current:null},itemMap:new Map}),d=u(e=>{let{scope:r,children:n}=e,o=t.useRef(null),l=t.useRef(new Map).current;return(0,i.jsx)(f,{scope:r,itemMap:l,collectionRef:o,children:n})},"CollectionProvider");d.displayName=l;let p=e+"CollectionSlot",m=(0,o.B)(p),h=t.forwardRef((e,t)=>{let{scope:r,children:o}=e,l=c(p,r),s=(0,n.f)(t,l.collectionRef);return(0,i.jsx)(m,{ref:s,children:o})});h.displayName=p;let y=e+"CollectionItemSlot",g="data-radix-collection-item",v=(0,o.B)(y),b=t.forwardRef((e,r)=>{let{scope:o,children:l,...s}=e,u=t.useRef(null),a=(0,n.f)(r,u),f=c(y,o);return t.useEffect(()=>(f.itemMap.set(u,{ref:u,...s}),()=>void f.itemMap.delete(u))),(0,i.jsx)(v,{...{[g]:""},ref:a,children:l})});function x(r){let n=c(e+"CollectionConsumer",r);return t.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[n.collectionRef,n.itemMap])}return b.displayName=y,u(x,"useCollection"),[{Provider:d,Slot:h,ItemSlot:b},x,a]}u(a,"createCollection");var f=new WeakMap,c=class e extends Map{static{u(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],f.set(this,!0)}set(e,t){return f.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,r){let n=this.has(t),o=n?this.size:this.size+1,i=m(e),l=i>=0?Math.min(i,o-1):Math.max(o+i,0);if(n?this.#e.indexOf(t)===l:l===this.size)return this.set(t,r),this;let s=this.#e.filter(e=>e!==t);s.splice(l,0,t);let u=s.map(e=>[e,e===t?r:this.get(e)]);for(let[e,t]of(this.clear(),u))this.set(e,t);return this}with(t,r,n){let o=new e(this);return o.insert(t,r,n),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let n=this.#e.indexOf(e);if(-1===n)return this;let o=this.#e.indexOf(t);return this.insert(-1!==o&&o<n?n-1:n,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let n=this.#e.indexOf(e);if(-1===n)return this;let o=this.#e.indexOf(t);return this.insert(-1!==o&&o<=n?n:n+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=d(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=d(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return d(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&n.push(e),o++;return new e(n)}map(t,r){let n=[],o=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(n)}reduce(...e){let[t,r]=e,n=e.length>1;if(!n&&0===this.size)throw TypeError("Reduce of empty OrderedDict with no initial value");let o=0,i=r;for(let e of this)i=0!==o||n?Reflect.apply(t,this,[i,e,o,this]):e,o++;return i}reduceRight(...e){let[t,r]=e,n=e.length>1;if(!n&&0===this.size)throw TypeError("Reduce of empty OrderedDict with no initial value");let o=r;for(let e=this.size-1;e>=0;e--){let r=this.entryAt(e);o=e!==this.size-1||n?Reflect.apply(t,this,[o,r,e,this]):r}return o}sort(e){if("function"!=typeof e)throw TypeError("OrderedDict.sort requires a compare function");let t=[...this.entries()].sort(e);for(let[e,r]of(this.clear(),t))this.set(e,r);return this}toSorted(t){if("function"!=typeof t)throw TypeError("OrderedDict.toSorted requires a compare function");return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e;for(let e of this.#e.slice(t,r))n.set(e,this.get(e));return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}};function d(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let r=p(e,t);return -1===r?void 0:e[r]}function p(e,t){let r=e.length,n=m(t),o=n>=0?n:r+n;return o<0||o>=r?-1:o}function m(e){return e!=e||0===e?0:Math.trunc(e)}function h(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(!Object.prototype.hasOwnProperty.call(t,n)||e[n]!==t[n])return!1;return!0}function y(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function g(e){let t;for(let r of e.keys()){if(t){let e=t.compareDocumentPosition(r);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=r}return!0}function v(e,t){return e[1].element&&t[1].element?y(e[1].element,t[1].element)?-1:1:0}function b(e){return new MutationObserver(t=>{for(let r of t)if("childList"===r.type)return void e()})}u(d,"at"),u(p,"toSafeIndex"),u(m,"toSafeInteger"),u(function(e){let s=e+"CollectionProvider",[a,f]=(0,r.f)(s),[d,p]=a(s);d.displayName=e+"CollectionStableContextProvider";let[m,y]=a(s);m.displayName=e+"CollectionStatefulContextProvider";let x=u(({state:e,...t})=>e?(0,i.jsx)(C,{...t,state:e}):(0,i.jsx)(w,{...t}),"CollectionProvider");x.displayName=s;let w=u(e=>{let t=S();return(0,i.jsx)(C,{...e,state:t})},"CollectionInit");w.displayName=e+"CollectionInit";let C=u(e=>{let{scope:r,children:o,state:l}=e,s=t.useRef(null),[u,a]=t.useState(null),f=(0,n.f)(s,a),[p,h]=l,y=t.useRef(new c),x=t.useCallback(()=>{let e=y.current;return g(e)||e.sort(v),e},[]);return t.useEffect(()=>{if(!u)return;let e=b(()=>{h(e=>{let t=e.toSorted(v);return t.some(([t],r)=>e.keyAt(r)!==t)?t:e})});return e.observe(u,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[u,h]),(0,i.jsx)(d,{scope:r,collectionElementRef:f,collectionElementRefObject:s,getCollection:x,setCollection:h,registryRef:y,children:(0,i.jsx)(m,{scope:r,collectionElement:u,collection:p,children:o})})},"CollectionProviderImpl");C.displayName=e+"CollectionProviderImpl";let O=e+"CollectionSlot",R=(0,o.B)(O),N=t.forwardRef((e,t)=>{let{scope:r,children:o}=e,l=p(O,r),s=(0,n.f)(t,l.collectionElementRef);return(0,i.jsx)(R,{ref:s,children:o})});N.displayName=O;let D=e+"CollectionItemSlot",j=(0,o.B)(D),E=t.forwardRef((e,r)=>{let{scope:o,children:s,...u}=e,a=t.useRef(null),{setCollection:f,registryRef:d}=p(D,o),m=t.useRef(u);h(m.current,u)||(m.current=u);let y=m.current,g=t.useCallback(e=>{let t=d.current;e?t.set(e,{...m.current,element:e}):a.current&&t.delete(a.current)},[d]),b=(0,n.f)(r,g,a);(0,l.f)(()=>{let e=a.current,t=d.current;e&&t.has(e)&&t.set(e,{...y,element:e})},[y,d]);let x=t.useRef(null);return t.useEffect(()=>{let e=a.current,t=x.current;((t?.element??null)!==e||e&&t?.itemData!==y)&&(x.current=e?{element:e,itemData:y}:null,f(r=>{let n=new c(r);return t&&t.element!==e&&n.delete(t.element),e&&n.set(e,{...y,element:e}),n.sort(v)}))}),t.useEffect(()=>()=>{let e=x.current;x.current=null,e&&f(t=>{if(!t.has(e.element))return t;let r=new c(t);return r.delete(e.element),r})},[f]),(0,i.jsx)(j,{"data-radix-collection-item":"",ref:b,children:s})});function S(){return t.useState(new c)}function P(t){let{collection:r}=y(e+"CollectionConsumer",t);return r}function k(t){let{getCollection:r}=p(e+"CollectionConsumer",t);return r}return E.displayName=D,u(S,"useInitCollection"),u(P,"useCollection"),u(k,"useGetCollection"),[{Provider:x,Slot:N,ItemSlot:E},{createCollectionScope:f,useCollection:P,useGetCollection:k,useInitCollection:S}]},"createCollection"),u(h,"shallowEqual"),u(y,"isElementPreceding"),u(g,"isInDocumentOrder"),u(v,"sortByDocumentPosition"),u(b,"getChildListObserver"),e.s(["f",0,a])},30030,e=>{var t=e.i(271645),r=e.i(843476),n=Object.defineProperty,o=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,n=[]){let s=[];function u(n,i){let l=t.createContext(i);l.displayName=n+"Context";let u=s.length;s=[...s,i];let a=o(n=>{let{scope:o,children:i,...s}=n,a=o?.[e]?.[u]||l,f=t.useMemo(()=>s,Object.values(s));return(0,r.jsx)(a.Provider,{value:f,children:i})},"Provider");function f(r,o,s={}){let{optional:a=!1}=s,c=o?.[e]?.[u]||l,d=t.useContext(c);if(d)return d;if(void 0!==i)return i;if(!a)throw Error(`\`${r}\` must be used within \`${n}\``)}return a.displayName=n+"Provider",o(f,"useContext"),[a,f]}o(u,"createContext");let a=o(()=>{let r=s.map(e=>t.createContext(e));return o(function(n){let o=n?.[e]||r;return t.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])},"useScope")},"createScope");return a.scopeName=e,[u,l(a,...n)]}function l(...e){let r=e[0];if(1===e.length)return r;let n=o(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return o(function(e){let o=n.reduce((t,{useScope:r,scopeName:n})=>{let o=r(e)[`__scope${n}`];return{...t,...o}},{});return t.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=r.scopeName,n}o(function(e,n){let i=t.createContext(n);i.displayName=e+"Context";let l=o(e=>{let{children:n,...o}=e,l=t.useMemo(()=>o,Object.values(o));return(0,r.jsx)(i.Provider,{value:l,children:n})},"Provider");function s(r,o={}){let{optional:l=!1}=o,u=t.useContext(i);if(u)return u;if(void 0!==n)return n;if(!l)throw Error(`\`${r}\` must be used within \`${e}\``)}return l.displayName=e+"Provider",o(s,"useContext"),[l,s]},"createContext"),o(i,"createContextScope"),o(l,"composeContextScopes"),e.s(["f",0,i])},586318,e=>{var t=e.i(271645),r=(e.i(843476),Object.defineProperty),n=t.createContext(void 0);function o(e){let r=t.useContext(n);return e||r||"ltr"}r(o,"name",{value:"useDirection",configurable:!0}),e.s(["f",0,o])},610772,e=>{var t=e.i(271645),r=e.i(934620),n=Object.defineProperty,o=t[" useId ".trim().toString()]||(()=>void 0),i=0;function l(e){let[n,l]=t.useState(o());return(0,r.f)(()=>{e||l(e=>e??String(i++))},[e]),e||(n?`radix-${n}`:"")}n(l,"name",{value:"useId",configurable:!0}),e.s(["f",0,l])},296626,e=>{var t=e.i(271645),r=e.i(934620),n=Object.defineProperty,o=(e,t)=>n(e,"name",{value:t,configurable:!0});function i(e,r){return t.useReducer((e,t)=>r[e][t]??e,e)}o(i,"useStateMachine");var l=o(e=>{let{present:r,children:n}=e,o=s(r),i="function"==typeof n?n({present:o.isPresent}):t.Children.only(n),l=a(o.ref,c(i));return"function"==typeof n||o.isPresent?t.cloneElement(i,{ref:l}):null},"Presence");function s(e){let[n,l]=t.useState(),s=t.useRef(null),u=t.useRef(e),a=t.useRef("none"),c=t.useRef(void 0),[d,p]=i(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return t.useEffect(()=>{"mounted"===d?(a.current=c.current??f(s.current),c.current=void 0):a.current="none"},[d]),(0,r.f)(()=>{let t=s.current,r=u.current;if(r!==e){let n=a.current,o=f(t);e?(c.current=o,p("MOUNT")):"none"===o||t?.display==="none"?p("UNMOUNT"):r&&n!==o?p("ANIMATION_OUT"):p("UNMOUNT"),u.current=e}},[e,p]),(0,r.f)(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=o(r=>{let o=f(s.current).includes(CSS.escape(r.animationName));if(r.target===n&&o&&(p("ANIMATION_END"),!u.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},"handleAnimationEnd"),i=o(e=>{e.target===n&&(a.current=f(s.current))},"handleAnimationStart");return n.addEventListener("animationstart",i),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",i),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}p("ANIMATION_END")},[n,p]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:t.useCallback(e=>{if(e){let t=getComputedStyle(e);s.current=t,c.current=f(t)}else s.current=null;l(e)},[])}}function u(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function a(...e){let r=t.useRef(e);return r.current=e,t.useCallback(e=>{let t=r.current,n=!1,o=t.map(t=>{let r=u(t,e);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let e=0;e<o.length;e++){let r=o[e];"function"==typeof r?r():u(t[e],null)}}},[])}function f(e){return e?.animationName||"none"}function c(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}o(s,"usePresence"),o(u,"setRef"),o(a,"useStableComposedRefs"),o(f,"getAnimationName"),o(c,"getElementRef"),e.s(["f",0,l])},248425,e=>{var t=e.i(271645),r=e.i(174080),n=e.i(991918),o=e.i(843476),i=Object.defineProperty,l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let i=(0,n.B)(`Primitive.${r}`),l=t.forwardRef((e,t)=>{let{asChild:n,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(n?i:r,{...l,ref:t})});return l.displayName=`Primitive.${r}`,{...e,[r]:l}},{});function s(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}i(s,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),e.s(["V",0,l,"u",0,s])},30207,e=>{var t=e.i(934620),r=e.i(271645),n=Object.defineProperty,o=r[" useInsertionEffect ".trim().toString()];function i(e){let n=r.useRef(e);return"function"==typeof o?o(()=>{n.current=e}):(0,t.f)(()=>{n.current=e}),r.useMemo(()=>(...e)=>n.current?.(...e),[])}n(i,"name",{value:"useCallbackRef",configurable:!0}),e.s(["f",0,i])},369340,e=>{var t=e.i(271645),r=e.i(705844),n=e.i(934620),o=Object.defineProperty,i=t[" useEffectEvent ".trim().toString()],l=t[" useInsertionEffect ".trim().toString()];function s(e){if("function"==typeof i)return i(e);let r=t.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof l?l(()=>{r.current=e}):(0,n.f)(()=>{r.current=e}),t.useMemo(()=>(...e)=>r.current?.(...e),[])}o(s,"name",{value:"useEffectEvent",configurable:!0});var u=Object.defineProperty,a=(e,t)=>u(e,"name",{value:t,configurable:!0}),f=t[" useInsertionEffect ".trim().toString()]||n.f;function c({prop:e,defaultProp:n,onChange:o=a(()=>{},"onChange"),caller:i}){let[l,s,u]=d({defaultProp:n,onChange:o}),f=void 0!==e,m=f?e:l;if(r.f){let r=t.useRef(void 0!==e);t.useEffect(()=>{let e=r.current;if(e!==f){let t=f?"controlled":"uncontrolled";console.warn(`${i} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}r.current=f},[f,i])}return[m,t.useCallback(t=>{if(f){let r=p(t)?t(e):t;r!==e&&u.current?.(r)}else s(t)},[f,e,s,u])]}function d({defaultProp:e,onChange:r}){let[n,o]=t.useState(e),i=t.useRef(n),l=t.useRef(r);return f(()=>{l.current=r},[r]),t.useEffect(()=>{i.current!==n&&(l.current?.(n),i.current=n)},[n,i]),[n,o,l]}function p(e){return"function"==typeof e}a(c,"useControllableState"),a(d,"useUncontrolledState"),a(p,"isFunction");var m=Symbol("RADIX:SYNC_STATE");a(function(e,n,o,i){let{prop:l,defaultProp:u,onChange:a,caller:f}=n,c=void 0!==l,d=s(a);if(r.f){let e=t.useRef(void 0!==l);t.useEffect(()=>{let t=e.current;if(t!==c){let e=c?"controlled":"uncontrolled";console.warn(`${f} is changing from ${t?"controlled":"uncontrolled"} to ${e}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}e.current=c},[c,f])}let p=[{...o,state:u}];i&&p.push(i);let[h,y]=t.useReducer((t,r)=>{if(r.type===m)return{...t,state:r.state};let n=e(t,r);return c&&!Object.is(n.state,t.state)&&d(n.state),n},...p),g=h.state,v=t.useRef(g);t.useEffect(()=>{v.current!==g&&(v.current=g,c||d(g))},[g,v,c]);let b=t.useMemo(()=>void 0!==l?{...h,state:l}:h,[h,l]);return t.useEffect(()=>{c&&!Object.is(l,h.state)&&y({type:m,state:l})},[l,h.state,c]),[b,y]},"useControllableStateReducer"),e.s(["f",0,c],369340)},934620,e=>{var t=e.i(271645),r=globalThis?.document?t.useLayoutEffect:()=>{};e.s(["f",0,r])},635804,643531,e=>{var t=e.i(271645),r=e.i(934620);function n(e){let[n,o]=t.useState(void 0);return(0,r.f)(()=>{if(e){o({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let n=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if("borderBoxSize"in n){let e=n.borderBoxSize,o=Array.isArray(e)?e[0]:e;t=o.inlineSize,r=o.blockSize}else t=e.offsetWidth,r=e.offsetHeight;o({width:t,height:r})})});return r.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}o(void 0)},[e]),n}(0,Object.defineProperty)(n,"name",{value:"useSize",configurable:!0}),e.s(["f",0,n],635804);let o=(0,e.i(475254).f)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["f",0,o],643531)},664659,655900,e=>{var t=e.i(475254);let r=(0,t.f)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["f",0,r],664659);let n=(0,t.f)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["f",0,n],655900)},727612,e=>{let t=(0,e.i(475254).f)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["f",0,t],727612)},37727,e=>{let t=(0,e.i(475254).f)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],37727)},776639,e=>{var t=e.i(843476),r=e.i(271645),n=e.i(981140),o=e.i(820783),i=e.i(30030),l=e.i(610772),s=e.i(369340),u=e.i(726330),a=e.i(765491),f=e.i(774606),c=e.i(296626),d=e.i(248425),p=e.i(303536),m=e.i(934620),h=e.i(985369),y=e.i(186312),g=e.i(991918),v=Object.defineProperty,b=(e,t)=>v(e,"name",{value:t,configurable:!0}),x="Dialog",[w,C]=(0,i.f)(x),[O,R]=w(x),N=b(e=>{let{__scopeDialog:n,children:o,open:i,defaultOpen:u,onOpenChange:f,modal:c=!0}=e,d=r.useRef(null),p=r.useRef(null),{nodes:m,registry:h}=(0,a.D)(),[y,g]=(0,s.f)({prop:i,defaultProp:u??!1,onChange:f,caller:x}),[v,b]=r.useState(0),[w,C]=r.useState(0);return(0,t.jsx)(O,{scope:n,triggerRef:d,contentRef:p,contentId:(0,l.f)(),titleId:(0,l.f)(),descriptionId:(0,l.f)(),titlePresent:v>0,descriptionPresent:w>0,setTitleCount:b,setDescriptionCount:C,open:y,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),modal:c,branchNodes:m,branchRegistry:h,children:o})},"Dialog"),D=r.forwardRef(b(function(e,r){let{__scopeDialog:i,...l}=e,s=R("DialogTrigger",i),u=(0,o.f)(r,s.triggerRef);return(0,t.jsx)(d.V.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":W(s.open),...l,ref:u,onClick:(0,n.f)(e.onClick,s.onOpenToggle)})},"DialogTrigger")),j="DialogPortal",[E,S]=w(j,{forceMount:void 0}),P=b(e=>{let{__scopeDialog:n,forceMount:o,children:i,container:l}=e,s=R(j,n);return(0,t.jsx)(E,{scope:n,forceMount:o,children:r.Children.map(i,e=>(0,t.jsx)(c.f,{present:o||s.open,children:(0,t.jsx)(f.f,{asChild:!0,container:l,children:e})}))})},"DialogPortal"),k="DialogOverlay",M=r.forwardRef(b(function(e,r){let n=S(k,e.__scopeDialog),{forceMount:o=n.forceMount,...i}=e,l=R(k,e.__scopeDialog);return l.modal?(0,t.jsx)(c.f,{present:o||l.open,children:(0,t.jsx)(I,{...i,ref:r})}):null},"DialogOverlay")),A=(0,g.B)("DialogOverlay.RemoveScroll"),I=r.forwardRef(b(function(e,n){let{__scopeDialog:i,...l}=e,s=R(k,i),a=(0,u.y)(),f=(0,o.f)(n,a);return(0,t.jsx)(h.f,{as:A,allowPinchZoom:!0,shards:r.useMemo(()=>[s.contentRef,...s.branchNodes.map(e=>({current:e}))],[s.contentRef,s.branchNodes]),children:(0,t.jsx)(d.V.div,{"data-state":W(s.open),...l,ref:f,style:{pointerEvents:"auto",...l.style}})})},"DialogOverlayImpl")),T="DialogContent",_=r.forwardRef(b(function(e,r){let n=S(T,e.__scopeDialog),{forceMount:o=n.forceMount,...i}=e,l=R(T,e.__scopeDialog);return(0,t.jsx)(c.f,{present:o||l.open,children:l.modal?(0,t.jsx)(z,{...i,ref:r}):(0,t.jsx)(F,{...i,ref:r})})},"DialogContent")),z=r.forwardRef(b(function(e,i){let l=R(T,e.__scopeDialog),s=r.useRef(null),u=(0,o.f)(i,l.contentRef,s);return r.useEffect(()=>{let e=s.current;if(e)return(0,y.f)(e)},[]),(0,t.jsx)(U,{...e,ref:u,trapFocus:l.open,disableOutsidePointerEvents:l.open,onCloseAutoFocus:(0,n.f)(e.onCloseAutoFocus,e=>{e.preventDefault(),l.triggerRef.current?.focus()}),onPointerDownOutside:(0,n.f)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,n.f)(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),F=r.forwardRef(b(function(e,n){let o=R(T,e.__scopeDialog),i=r.useRef(!1),l=r.useRef(!1);return(0,t.jsx)(U,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,l.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(l.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&l.current&&t.preventDefault()}})},"DialogContentNonModal")),U=r.forwardRef(b(function(e,r){let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:l,"aria-describedby":s,children:f,...c}=e,d=R(T,n);return(0,p.f)(),(0,t.jsx)(a.l,{registry:d.branchRegistry,children:(0,t.jsx)(a.v,{asChild:!0,loop:!0,trapped:o,branches:d.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:l,children:(0,t.jsx)(u.V,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?L(s,d.descriptionId):s,"data-state":W(d.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:f})})})},"DialogContentImpl")),$=r.forwardRef(b(function(e,r){let{__scopeDialog:n,...o}=e,i=R("DialogTitle",n),{setTitleCount:l}=i;return(0,m.f)(()=>(l(e=>e+1),()=>l(e=>e-1)),[l]),(0,t.jsx)(d.V.h2,{id:i.titleId,...o,ref:r})},"DialogTitle")),B=r.forwardRef(b(function(e,r){let{__scopeDialog:n,...o}=e,i=R("DialogDescription",n),{setDescriptionCount:l}=i;return(0,m.f)(()=>(l(e=>e+1),()=>l(e=>e-1)),[l]),(0,t.jsx)(d.V.p,{id:i.descriptionId,...o,ref:r})},"DialogDescription")),V=r.forwardRef(b(function(e,r){let{__scopeDialog:o,...i}=e,l=R("DialogClose",o);return(0,t.jsx)(d.V.button,{type:"button",...i,ref:r,onClick:(0,n.f)(e.onClick,()=>l.onOpenChange(!1))})},"DialogClose"));function L(...e){let t=new Set;for(let r of e)if("string"==typeof r)for(let e of String(r).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(" "):void 0}function W(e){return e?"open":"closed"}b(L,"concatAriaDescribedby"),b(W,"getState");var q=e.i(37727),H=e.i(975157);let G=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(M,{ref:n,className:(0,H.f)("fixed inset-0 z-50 bg-black/50 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));G.displayName=M.displayName;let K=r.forwardRef(({className:e,children:r,...n},o)=>(0,t.jsxs)(P,{children:[(0,t.jsx)(G,{}),(0,t.jsxs)(_,{ref:o,onPointerDownOutside:e=>{e.preventDefault()},className:(0,H.f)("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border bg-card p-6 shadow-xl duration-200 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",e),...n,children:[r,(0,t.jsxs)(V,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,t.jsx)(q.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));K.displayName=_.displayName;let X=({className:e,...r})=>(0,t.jsx)("div",{className:(0,H.f)("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});X.displayName="DialogHeader";let Y=({className:e,...r})=>(0,t.jsx)("div",{className:(0,H.f)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});Y.displayName="DialogFooter";let Z=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)($,{ref:n,className:(0,H.f)("text-lg font-semibold leading-none tracking-tight",e),...r}));Z.displayName=$.displayName;let J=r.forwardRef(({className:e,...r},n)=>(0,t.jsx)(B,{ref:n,className:(0,H.f)("text-sm text-muted-foreground",e),...r}));J.displayName=B.displayName,e.s(["N",0,N,"d",0,K,"C",0,J,"c",0,Y,"s",0,X,"F",0,Z,"a",0,D],776639)}])})();
@@ -1 +0,0 @@
1
- (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,72664,3198,e=>{var t=e.i(475254);let r=(0,t.f)("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);e.s(["f",0,r],72664);var i=e.i(843476),a=e.i(271645),n=e.i(531278);let s=(0,t.f)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),o=(0,t.f)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);var l=e.i(367240),d=e.i(16715),h=e.i(727612),c=e.i(519455),u=e.i(111110),m=e.i(294114),g=e.i(201276);let p=null,f=["setcoordsystem","setaxesvisible","setgridvisible","setcolor","setlinethickness","setlinestyle","setpointsize","setpointstyle","setlabelvisible","setcaption","setvisible","setfilling","setvalue","setfixed","setbackgroundcolor"];function w(e,t,r){let i=e?.firstElementChild;i&&(i.style.width="100%",i.style.height=`${r}px`,t?.setSize(e?.offsetWidth||i.offsetWidth||800,r))}function x(e,t){for(let r of t)try{if(function(e){let t=e.toLowerCase().trim();return f.some(e=>t.startsWith(e+"("))}(r)){let t=function(e){let t=e.match(/^(\w+)\(([\s\S]+)\)$/);if(!t)return null;try{let e=t[2].trim();if(e.startsWith("[")&&e.endsWith("]"))return{m:t[1],a:JSON.parse(e)};if(/^-?\d+(\.\d+)?$/.test(e))return{m:t[1],a:[Number(e)]};if("true"===e||"false"===e)return{m:t[1],a:["true"===e]};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{m:t[1],a:[e.slice(1,-1)]};let r=e.split(",").map(e=>e.trim()).map(e=>/^-?\d+(\.\d+)?$/.test(e)?Number(e):"true"===e||"false"===e?"true"===e:e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e);return{m:t[1],a:r}}catch{return null}}(r),i=t?e[t.m]:void 0;t&&"function"==typeof i&&i.apply(e,t.a)}else{let t=r.trim();t&&!/[<>'"]/.test(t)?e.evalCommand(t):g.f.warn("[GGB]","Blocked potentially unsafe command",{command:r.substring(0,50)})}}catch(e){g.f.warn("[GGB]","Command failed",{command:r,error:e})}}e.s(["f",0,function({commands:e,height:t=700,showToolBar:r=!1,showAlgebraInput:f=!1,showMenuBar:y=!1,className:b="",onRegenerate:v,onDelete:C}){let{t:k}=(0,u.b)(),j=(0,a.useRef)(null),D=(0,a.useRef)(null),N=(0,a.useId)(),M=(0,a.useRef)(`ggb-${N.replace(/[^a-zA-Z0-9_-]/g,"")}`),[R,E]=(0,a.useState)(!0),[S,$]=(0,a.useState)(null),[I,_]=(0,a.useState)(!0),[P,B]=(0,a.useState)(!1),[H,A]=(0,a.useState)(!1),z=(0,a.useMemo)(()=>(function(e){if(!e?.trim())return[];let t=e.trim();if(t.startsWith("["))try{let e=JSON.parse(t);if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&""!==e.trim())}catch{}return t.split("\n").map(e=>e.trim()).filter(e=>e&&!e.startsWith("//"))})(e),[e]);(0,a.useEffect)(()=>{if(0===z.length)return;let e=!1,i=M.current,a=j.current;return(p||(p=new Promise((e,t)=>{if(window.GGBApplet)return void e();let r=document.createElement("script");r.src="https://www.geogebra.org/apps/deployggb.js",r.async=!0,r.onload=()=>e(),r.onerror=()=>{p=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(r)}))).then(()=>{if(e)return;let n=window.GGBApplet;if(!n){$(k.geogebra.notLoaded),E(!1);return}if(a){a.innerHTML=`<div id="${i}" style="width:100%;height:${t}px"></div>`;try{new n({appName:"classic",width:"100%",height:t,showToolBar:r,showAlgebraInput:f,showMenuBar:y,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:r=>{e||(D.current=r,w(a,r,t),x(r,z),E(!1))}},!0).inject(i)}catch(t){g.f.error("[GGB]","Init failed",{error:t}),e||($(k.geogebra.initFailed),E(!1))}}}).catch(t=>{g.f.error("[GGB]","Script load failed",{error:t}),e||($(k.geogebra.scriptFailed),E(!1))}),()=>{e=!0;try{let e=D.current;e?.remove&&e.remove()}catch(e){g.f.warn("[GGB]","Cleanup failed",{error:e})}D.current=null,a&&(a.innerHTML="")}},[z,r,f,y]),(0,a.useEffect)(()=>{w(j.current,D.current,I?700:t)},[I,t]);let L=(0,a.useCallback)(()=>{let e=D.current;if(e)try{e.resetConstruction(),setTimeout(()=>{D.current&&x(D.current,z)},300)}catch(e){g.f.warn("[GGB]","Reset failed",{error:e})}},[z]),X=(0,a.useCallback)(async()=>{if(v&&!P){B(!0);try{await v()}finally{B(!1)}}},[v,P]),K=(0,a.useCallback)(async()=>{if(C&&!H&&await (0,m.u)(k.geogebra.confirmDelete,{destructive:!0})){A(!0);try{await C()}catch{m.c.error(k.geogebra.deleteFailed)}finally{A(!1)}}},[C,H,k]);return 0===z.length?null:(0,i.jsxs)("div",{className:`relative rounded-lg border bg-card ${b}`,children:[(0,i.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:k.geogebra.title}),R&&(0,i.jsx)(n.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[v&&(0,i.jsxs)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:X,title:k.geogebra.regenerate,disabled:P||R,children:[P?(0,i.jsx)(n.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(d.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.regenerate})]}),C&&(0,i.jsxs)(c.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:K,title:k.geogebra.delete,disabled:H||P,children:[H?(0,i.jsx)(n.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,i.jsx)(h.f,{className:"h-3.5 w-3.5"}),(0,i.jsx)("span",{children:k.geogebra.delete})]}),(0,i.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:L,title:k.geogebra.reset,disabled:R,children:(0,i.jsx)(l.f,{className:"h-3.5 w-3.5"})}),(0,i.jsx)(c.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>_(e=>!e),title:I?k.geogebra.shrink:k.geogebra.enlarge,children:I?(0,i.jsx)(o,{className:"h-3.5 w-3.5"}):(0,i.jsx)(s,{className:"h-3.5 w-3.5"})})]})]}),(0,i.jsx)("div",{ref:j,style:{width:"100%"}}),R&&(0,i.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,i.jsx)(n.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm text-muted-foreground",children:k.geogebra.loading})]})}),S&&(0,i.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:S})]})}],3198)},356909,e=>{let t=(0,e.i(475254).f)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["f",0,t],356909)},283086,e=>{let t=(0,e.i(475254).f)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["f",0,t],283086)},469937,62825,e=>{var t=e.i(843476);let r=(0,e.i(475254).f)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var i=e.i(111110),a=e.i(975157);let n=[1,2,3,4,5];function s(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["f",0,function({value:e,onChange:s,disabled:o,size:l="sm",showUnrated:d=!0,className:h}){let{t:c}=(0,i.b)(),u=e??0,m="sm"===l?"h-3.5 w-3.5":"h-5 w-5",g=u?c.difficulty.starsLabel.replace("{n}",String(u)):c.difficulty.unrated;return s?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",h),role:"group","aria-label":`${c.difficulty.label}:${g}`,title:c.difficulty.clearHint,children:[n.map(e=>(0,t.jsx)("button",{type:"button",disabled:o,onClick:()=>s(e===u?null:e),"aria-label":c.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(r,{className:(0,a.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:c.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",h),role:"img","aria-label":`${c.difficulty.label}:${g}`,title:g,children:n.map(e=>(0,t.jsx)(r,{className:(0,a.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",h),children:c.difficulty.unrated}):null}],469937),e.s(["i",0,function(e,t="zh"){return("en"===t?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[s(e)]},"h",0,s,"x",0,function(e,t){return(t||"").trim()?"wrong_attempt":s(e)}],62825)},12130,e=>{var t=e.i(843476),r=e.i(271645),i=r,a={x:0,y:0,width:0,height:0,unit:"px"},n=(e,t,r)=>Math.min(Math.max(e,t),r),s=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function o(e,t,r){return"%"===e.unit?{...a,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function l(e,t,r){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...a,...e,unit:"px"}}function d(e,t,r,i,a,n=0,s=0,o=i,l=a){let h={...e},c=Math.min(n,i),u=Math.min(s,a),m=Math.min(o,i),g=Math.min(l,a);t&&(t>1?(u=(c=s?s*t:c)/t,m=o*t):(c=(u=n?n/t:u)*t,g=l/t)),h.y<0&&(h.height=Math.max(h.height+h.y,u),h.y=0),h.x<0&&(h.width=Math.max(h.width+h.x,c),h.x=0);let p=i-(h.x+h.width);p<0&&(h.x=Math.min(h.x,i-c),h.width+=p);let f=a-(h.y+h.height);if(f<0&&(h.y=Math.min(h.y,a-u),h.height+=f),h.width<c&&(("sw"===r||"nw"==r)&&(h.x-=c-h.width),h.width=c),h.height<u&&(("nw"===r||"ne"==r)&&(h.y-=u-h.height),h.height=u),h.width>m&&(("sw"===r||"nw"==r)&&(h.x-=m-h.width),h.width=m),h.height>g&&(("nw"===r||"ne"==r)&&(h.y-=g-h.height),h.height=g),t){let e=h.width/h.height;if(e<t){let e=Math.max(h.width/t,u);("nw"===r||"ne"==r)&&(h.y-=e-h.height),h.height=e}else if(e>t){let e=Math.max(h.height*t,c);("sw"===r||"nw"==r)&&(h.x-=e-h.width),h.width=e}}return h}var h={capture:!0,passive:!1},c=0,u=class e extends i.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,i.createRef)();mediaRef=(0,i.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${c++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:r,width:i,height:a}=e.getBoundingClientRect();return{x:t,y:r,width:i,height:a}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:i}=this.getBox();e&&i&&r(l(t,e,i),o(t,e,i))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,h),this.document.addEventListener("pointerup",this.onDocPointerDone,h),this.document.addEventListener("pointercancel",this.onDocPointerDone,h),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,h),this.document.removeEventListener("pointerup",this.onDocPointerDone,h),this.document.removeEventListener("pointercancel",this.onDocPointerDone,h),!1)}onCropPointerDown=e=>{let{crop:t,disabled:r}=this.props,i=this.getBox();if(!t)return;let a=l(t,i.width,i.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let n=e.target.dataset.ord,s=e.clientX,o=e.clientY,d=a.x,h=a.y;if(n){let t=e.clientX-i.x,r=e.clientY-i.y,l=0,c=0;"ne"===n||"e"==n?(l=t-(a.x+a.width),c=r-a.y,d=a.x,h=a.y+a.height):"se"===n||"s"===n?(l=t-(a.x+a.width),c=r-(a.y+a.height),d=a.x,h=a.y):"sw"===n||"w"==n?(l=t-a.x,c=r-(a.y+a.height),d=a.x+a.width,h=a.y):("nw"===n||"n"==n)&&(l=t-a.x,c=r-a.y,d=a.x+a.width,h=a.y+a.height),s=d+i.x+l,o=h+i.y+c}this.evData={startClientX:s,startClientY:o,startCropX:d,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!!n,ord:n},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:r,locked:i,keepSelection:a,onChange:n}=this.props,s=this.getBox();if(r||i||a&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let d=e.clientX-s.x,h=e.clientY-s.y,c={unit:"px",x:d,y:h,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:d,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,n(l(c,s.width,s.height),o(c,s.width,s.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:r,disabled:i,onChange:a,onDragStart:n}=this.props,d=this.getBox();if(i||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,n&&n(e));let{evData:h}=this;h.clientX=e.clientX,h.clientY=e.clientY,s(r,t=h.isResize?this.resizeCrop():this.dragCrop())||a(l(t,d.width,d.height),o(t,d.width,d.height))};onComponentKeyDown=t=>{let{crop:r,disabled:i,onChange:a,onComplete:s}=this.props;if(i)return;let d=t.key,h=!1;if(!r)return;let c=this.getBox(),u=this.makePixelCrop(c),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===d?(u.x-=m,h=!0):"ArrowRight"===d?(u.x+=m,h=!0):"ArrowUp"===d?(u.y-=m,h=!0):"ArrowDown"===d&&(u.y+=m,h=!0),h){t.cancelable&&t.preventDefault(),u.x=n(u.x,0,c.width-u.width),u.y=n(u.y,0,c.height-u.height);let e=l(u,c.width,c.height),r=o(u,c.width,c.height);a(e,r),s&&s(e,r)}};onHandlerKeyDown=(t,r)=>{var i,a;let n,{aspect:h=0,crop:c,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(u||!c||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=d((i=l(c,y.width,y.height),a=t.key,n={...i},"ArrowLeft"===a?"nw"===r?(n.x-=b,n.y-=b,n.width+=b,n.height+=b):"w"===r?(n.x-=b,n.width+=b):"sw"===r?(n.x-=b,n.width+=b,n.height+=b):"ne"===r?(n.y+=b,n.width-=b,n.height-=b):"e"===r?n.width-=b:"se"===r&&(n.width-=b,n.height-=b):"ArrowRight"===a&&("nw"===r?(n.x+=b,n.y+=b,n.width-=b,n.height-=b):"w"===r?(n.x+=b,n.width-=b):"sw"===r?(n.x+=b,n.width-=b,n.height-=b):"ne"===r?(n.y-=b,n.width+=b,n.height+=b):"e"===r?n.width+=b:"se"===r&&(n.width+=b,n.height+=b)),"ArrowUp"===a?"nw"===r?(n.x-=b,n.y-=b,n.width+=b,n.height+=b):"n"===r?(n.y-=b,n.height+=b):"ne"===r?(n.y-=b,n.width+=b,n.height+=b):"sw"===r?(n.x+=b,n.width-=b,n.height-=b):"s"===r?n.height-=b:"se"===r&&(n.width-=b,n.height-=b):"ArrowDown"===a&&("nw"===r?(n.x+=b,n.y+=b,n.width-=b,n.height-=b):"n"===r?(n.y+=b,n.height-=b):"ne"===r?(n.y+=b,n.width-=b,n.height-=b):"sw"===r?(n.x-=b,n.width+=b,n.height+=b):"s"===r?n.height+=b:"se"===r&&(n.width+=b,n.height+=b)),n),h,r,y.width,y.height,m,g,p,f);if(!s(c,v)){let e=o(v,y.width,y.height);w(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:r,onComplete:i,onDragEnd:a}=this.props,n=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,a&&a(e),i&&i(l(t,n.width,n.height),o(t,n.width,n.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),i=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return r.x=n(e.startCropX+i,0,t.width-r.width),r.y=n(e.startCropY+a,0,t.height-r.height),r}getPointRegion(e,t,r,i){let{evData:a}=this,n=a.clientX-e.x,s=a.clientY-e.y,o;return o=i&&t?"nw"===t||"n"===t||"ne"===t:s<a.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:n<a.startCropX)?o?"nw":"sw":o?"ne":"se"}resolveMinDimensions(e,t,r=0,i=0){let a=Math.min(r,e.width),n=Math.min(i,e.height);return t&&(a||n)?t>1?a?[a,a/t]:[n*t,n]:n?[n*t,n]:[a,a/t]:[a,n]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:i,maxHeight:a}=this.props,s=this.getBox(),[o,l]=this.resolveMinDimensions(s,r,this.props.minWidth,this.props.minHeight),h=this.makePixelCrop(s),c=this.getPointRegion(s,t.ord,o,l),u=t.ord||c,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(o&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-o)),(l&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-l));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===c?(p.x=t.startCropX,p.width=m,r?p.height=p.width/r:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===c?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,r?p.height=p.width/r:p.height=g):"sw"===c?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),r?p.height=p.width/r:p.height=g):"nw"===c&&(p.x=t.startCropX+m,p.width=Math.abs(m),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=d(p,r,c,s.width,s.height,o,l,i,a);return r||e.xyOrds.indexOf(u)>-1?h=f:e.xOrds.indexOf(u)>-1?(h.x=f.x,h.width=f.width):e.yOrds.indexOf(u)>-1&&(h.y=f.y,h.height=f.height),h.x=n(h.x,0,s.width-h.width),h.y=n(h.y,0,s.height-h.height),h}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:a,renderSelectionAddon:n,ruleOfThirds:s,crop:o}=this.props,l=this.getCropStyle();if(o)return i.default.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!a&&i.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},i.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),n&&i.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},n(this.state)),s&&i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return l({...a,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:a,crop:n,disabled:s,locked:o,style:l,ruleOfThirds:d}=this.props,{cropIsActive:h,newCropIsBeingDrawn:c}=this.state,u=n?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",a,h&&"ReactCrop--active",s&&"ReactCrop--disabled",o&&"ReactCrop--locked",c&&"ReactCrop--new-crop",n&&e&&"ReactCrop--fixed-aspect",n&&r&&"ReactCrop--circular-crop",n&&d&&"ReactCrop--rule-of-thirds",!this.dragStarted&&n&&!n.width&&!n.height&&"ReactCrop--invisible-crop",r&&"ReactCrop--no-animate");return i.default.createElement("div",{ref:this.componentRef,className:m,style:l},i.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),n?i.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},i.default.createElement("defs",null,i.default.createElement("mask",{id:`hole-${this.instanceId}`},i.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),r?i.default.createElement("ellipse",{cx:`${n.x+n.width/2}${n.unit}`,cy:`${n.y+n.height/2}${n.unit}`,rx:`${n.width/2}${n.unit}`,ry:`${n.height/2}${n.unit}`,fill:"black"}):i.default.createElement("rect",{x:`${n.x}${n.unit}`,y:`${n.y}${n.unit}`,width:`${n.width}${n.unit}`,height:`${n.height}${n.unit}`,fill:"black"}))),i.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}},m=e.i(519455),g=e.i(776639),p=e.i(37727),f=e.i(111110);async function w(e,t){let{naturalWidth:r,naturalHeight:i}=e;return Promise.all(t.map(t=>new Promise((a,n)=>{let s=document.createElement("canvas"),o=Math.round(t.x*r),l=Math.round(t.y*i);s.width=Math.max(1,Math.round(t.width*r)),s.height=Math.max(1,Math.round(t.height*i));let d=s.getContext("2d");d?(d.drawImage(e,o,l,s.width,s.height,0,0,s.width,s.height),s.toBlob(e=>e?a(e):n(Error("Canvas is empty")),"image/jpeg",.95)):n(Error("Canvas is not supported"))})))}let x=(0,r.forwardRef)(function({imageSrc:e,regions:i,onChange:a},n){let{t:s}=(0,f.b)(),o=(0,r.useRef)(null),l=(0,r.useRef)(null),[d,h]=(0,r.useState)(null),c=e=>{let t=o.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},u=()=>{d&&d.width>=.02&&d.height>=.02&&a([...i,d]),l.current=null,h(null)},m=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:n,src:e,alt:"",draggable:!1,style:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},className:"block"}),(0,t.jsxs)("div",{ref:o,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(o.current?.setPointerCapture(e.pointerId),l.current=c(e),h(null))},onPointerMove:e=>{var t,r,i,a;let n,s,o;if(!l.current)return;let d=c(e);h((t=l.current.x,r=l.current.y,i=d.x,a=d.y,s=(n=e=>Math.min(1,Math.max(0,e)))(Math.min(t,i)),o=n(Math.min(r,a)),{x:s,y:o,width:n(Math.max(t,i))-s,height:n(Math.max(r,a))-o}))},onPointerUp:u,onPointerCancel:u,children:[i.map((e,r)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:m(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:r+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":s.batchImport.removeRegion.replace("{index}",String(r+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>a(i.filter((e,t)=>t!==r)),children:(0,t.jsx)(p.X,{className:"h-3 w-3"})})]},r)),d&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:m(d)})]})]})});var y=e.i(201276);e.s(["f",0,function({imageSrc:e,open:i,onClose:a,onCropComplete:n,onMultiCropComplete:s}){let{t:o}=(0,f.b)(),[l,d]=(0,r.useState)(),[h,c]=(0,r.useState)(),p=(0,r.useRef)(null),[b,v]=(0,r.useState)("single"),[C,k]=(0,r.useState)({src:e,regions:[]}),j=C.src===e?C.regions:[],D=t=>k({src:e,regions:t}),N=(0,r.useRef)(null),M=async()=>{if(N.current&&0!==j.length&&s)try{s(await w(N.current,j)),D([])}catch(e){y.f.error("[ImageCropper]","Multi-image crop failed",{error:e})}},R=async(e,t)=>{let r=document.createElement("canvas"),i=e.naturalWidth/e.width,a=e.naturalHeight/e.height;r.width=t.width*i,r.height=t.height*a;let n=r.getContext("2d");return n?(n.drawImage(e,t.x*i,t.y*a,t.width*i,t.height*a,0,0,t.width*i,t.height*a),new Promise((e,t)=>{r.toBlob(r=>{r?e(r):t(Error("Canvas is empty"))},"image/jpeg")})):null},E=async()=>{if(h&&p.current)try{let e=await R(p.current,h);e&&n(e)}catch(e){y.f.error("[ImageCropper]","Crop failed",{error:e})}else if(!h&&e)try{let t=await fetch(e),r=await t.blob();n(r)}catch(e){y.f.error("[ImageCropper]","Failed to load original image",{error:e})}};return(0,t.jsx)(g.N,{open:i,onOpenChange:e=>!e&&a(),children:(0,t.jsxs)(g.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(g.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(g.F,{children:o.common.cropper?.title||"Crop Image"})}),(0,t.jsx)("div",{className:"flex-1 bg-black w-full overflow-auto flex items-center justify-center p-4",children:"multi"===b?(0,t.jsx)(x,{ref:N,imageSrc:e,regions:j,onChange:D}):(0,t.jsx)(u,{crop:l,onChange:(e,t)=>d(t),onComplete:e=>c(e),className:"max-h-full",children:(0,t.jsx)("img",{ref:p,alt:"Crop me",src:e,onLoad:function(e){let{width:t,height:r}=e.currentTarget;d({unit:"%",x:0,y:0,width:100,height:100}),c({unit:"px",x:0,y:0,width:t,height:r})},style:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"}})})}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[s&&(0,t.jsx)("div",{className:"grid grid-cols-2 gap-1 rounded-md bg-muted p-1 sm:w-80",children:["single","multi"].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>v(e),className:`rounded px-3 py-1.5 text-sm font-medium transition-colors ${b===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:"single"===e?o.batchImport.singleMode:o.batchImport.multiMode},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===b?`${o.batchImport.hint} ${o.batchImport.regionCount.replace("{count}",String(j.length))}`:o.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex gap-2 justify-end",children:["multi"===b&&j.length>0&&(0,t.jsx)(m.f,{variant:"ghost",onClick:()=>D([]),children:o.batchImport.clear}),(0,t.jsx)(m.f,{variant:"outline",onClick:a,children:o.common.cancel||"Cancel"}),"multi"===b?(0,t.jsx)(m.f,{onClick:M,disabled:0===j.length,children:o.batchImport.start.replace("{count}",String(j.length))}):(0,t.jsx)(m.f,{onClick:E,children:o.common.confirm||"Confirm"})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),r=e.i(271645);let i=(0,e.i(475254).f)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);var a=e.i(286536),n=e.i(511445),s=e.i(624687),o=e.i(111110),l=e.i(975157);e.s(["f",0,function({value:e,onChange:d,className:h,...c}){let{t:u}=(0,o.b)(),[m,g]=(0,r.useState)("source"),p=(0,r.useId)(),f=[{mode:"source",label:u.markdownEditor.source,icon:i},{mode:"preview",label:u.markdownEditor.preview,icon:a.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:f.map(({mode:e,label:r,icon:i})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,l.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(i,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(s.f,{value:e,onChange:e=>d(e.target.value),className:h,...c}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(n.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),r=e.i(271645),i=e.i(967489),a=e.i(810980),n=e.i(41931),s=e.i(201276),o=e.i(111110);e.s(["f",0,function({value:e,onChange:l,className:d}){let[h,c]=(0,r.useState)([]),{t:u}=(0,o.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await n.f.get("/api/notebooks");c(e)}catch(e){s.f.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(i.d,{value:e,onValueChange:l,children:[(0,t.jsx)(i.P,{className:d,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(i.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(i.r,{children:0===h.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):h.map(e=>(0,t.jsx)(i.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),r=e.i(111110),i=e.i(975157);e.s(["f",0,function({svg:e,className:a}){let{t:n}=(0,r.b)();return e?(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",a),children:(0,t.jsx)("img",{src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`,alt:n.figure.alt,className:"mx-auto block h-auto max-w-full rounded border bg-white p-2",style:{maxHeight:360}})}):null}],149704)},574041,e=>{var t=e.i(843476),r=e.i(271645),i=e.i(37727),a=e.i(487486),n=e.i(793479),s=e.i(41931),o=e.i(201276);e.s(["f",0,function({value:e=[],onChange:l,placeholder:d="Enter tags...",className:h="",enterHint:c,subject:u,gradeStage:m}){let[g,p]=(0,r.useState)(""),[f,w]=(0,r.useState)([]),[x,y]=(0,r.useState)(!1),[b,v]=(0,r.useState)(0),C=(0,r.useRef)(null),k=(0,r.useRef)(null),j=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});u&&r.append("subject",u),m&&r.append("stage",m);let i=((await s.f.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(i.slice(0,20)),y(i.length>0),v(0)}catch(e){o.f.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,r.useEffect)(()=>{g.trim()&&j(g)},[g,j]);let D=t=>{t.trim()&&!e.includes(t.trim())&&(l([...e,t.trim()]),p(""),w([]),y(!1),v(0))},N=t=>{l(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||C.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${h}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>N(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(i.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(n.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&f[b]?D(f[b]):g.trim()&&D(g)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),v(0)):"Backspace"===t.key&&!g&&e.length>0&&N(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?d:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===b?"bg-accent":""}`,onClick:()=>D(e),onMouseEnter:()=>v(r),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:c?`${c} "${g}"`:`Press Enter to create "${g}"`})]})}])},28928,e=>{var t=e.i(201276);async function r(e,i=1,a=1920,n=.8){return new Promise((r,s)=>{let o=new FileReader;o.onload=o=>{let l=new Image;l.onload=()=>{let o=document.createElement("canvas"),d=o.getContext("2d");if(!d)return void s(Error("无法获取 Canvas 上下文"));let h=l.width,c=l.height;h>a&&(c=c*a/h,h=a),o.width=h,o.height=c,d.drawImage(l,0,0,h,c);let u=n,m=o.toDataURL("image/jpeg",u),g=3*m.length/4/1024/1024;for(;g>i&&u>.1;){u-=.1;let e=3*(m=o.toDataURL("image/jpeg",u)).length/4/1024/1024;if(t.f.info("[ImageCompress]","Compression step",{quality:Number(u.toFixed(1)),sizeMB:Number(e.toFixed(2))},{sendToBackend:!1}),e<=i)break}t.f.info("[ImageCompress]","Compression finished",{originalMB:Number((e.size/1024/1024).toFixed(2)),compressedMB:Number((3*m.length/4/1024/1024).toFixed(2))}),r(m)},l.onerror=()=>s(Error("图片加载失败")),l.src=o.target?.result},o.onerror=()=>s(Error("文件读取失败")),o.readAsDataURL(e)})}async function i(e){let i=e.size/1024/1024;return(t.f.info("[ImageCompress]","File size checked",{sizeMB:Number(i.toFixed(2))},{sendToBackend:!1}),i>1)?(t.f.info("[ImageCompress]","File exceeds threshold, compressing",void 0,{sendToBackend:!1}),await r(e,1)):(t.f.info("[ImageCompress]","File size OK, no compression needed",void 0,{sendToBackend:!1}),new Promise((t,r)=>{let i=new FileReader;i.onload=()=>t(i.result),i.onerror=r,i.readAsDataURL(e)}))}e.s(["f",0,i])},952122,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])},943710,e=>{e.s(["f",0,function(e){return"number"!=typeof e||!Number.isInteger(e)||e<1||e>5?null:e<=3?"a":"b"}])}])})();