wrong-notebook 2026.11.5-2 → 2026.11.5-3

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 (915) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +5 -0
  3. package/.next/build-manifest.json +64 -53
  4. package/.next/prerender-manifest.json +4 -4
  5. package/.next/required-server-files.json +6 -3
  6. package/.next/routes-manifest.json +30 -0
  7. package/.next/server/app/_global-error/page/build-manifest.json +3 -3
  8. package/.next/server/app/_global-error/page.js +7 -7
  9. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  10. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_global-error.html +1 -1
  12. package/.next/server/app/_global-error.rsc +3 -3
  13. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  14. package/.next/server/app/_global-error.segments/_full.segment.rsc +3 -3
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page/build-manifest.json +3 -3
  17. package/.next/server/app/_not-found/page.js +5 -4
  18. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/admin/page/build-manifest.json +3 -3
  21. package/.next/server/app/admin/page.js +7 -6
  22. package/.next/server/app/admin/page.js.nft.json +1 -1
  23. package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  24. package/.next/server/app/admin/user/[id]/page/build-manifest.json +3 -3
  25. package/.next/server/app/admin/user/[id]/page.js +7 -6
  26. package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
  27. package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
  28. package/.next/server/app/api/admin/cnm-tags/route.js +10 -7
  29. package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
  30. package/.next/server/app/api/admin/dashboard/route.js +17 -16
  31. package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
  32. package/.next/server/app/api/admin/debug-logs/export/route.js +10 -8
  33. package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
  34. package/.next/server/app/api/admin/debug-logs/route.js +9 -6
  35. package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
  36. package/.next/server/app/api/admin/eula/accept/route/app-paths-manifest.json +3 -0
  37. package/.next/server/app/api/admin/eula/accept/route/build-manifest.json +12 -0
  38. package/.next/server/app/api/admin/eula/accept/route/server-reference-manifest.json +4 -0
  39. package/.next/server/app/api/admin/eula/accept/route.js +17 -0
  40. package/.next/server/app/api/admin/eula/accept/route.js.map +5 -0
  41. package/.next/server/app/api/admin/eula/accept/route.js.nft.json +1 -0
  42. package/.next/server/app/api/admin/eula/accept/route_client-reference-manifest.js +3 -0
  43. package/.next/server/app/api/admin/migrate-tags/route.js +6 -5
  44. package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
  45. package/.next/server/app/api/admin/system-reset/route.js +9 -3
  46. package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
  47. package/.next/server/app/api/admin/telemetry/route/app-paths-manifest.json +3 -0
  48. package/.next/server/app/api/admin/telemetry/route/build-manifest.json +12 -0
  49. package/.next/server/app/api/admin/telemetry/route/server-reference-manifest.json +4 -0
  50. package/.next/server/app/api/admin/telemetry/route.js +17 -0
  51. package/.next/server/app/api/admin/telemetry/route.js.map +5 -0
  52. package/.next/server/app/api/admin/telemetry/route.js.nft.json +1 -0
  53. package/.next/server/app/api/admin/telemetry/route_client-reference-manifest.js +3 -0
  54. package/.next/server/app/api/admin/users/[id]/detail/route.js +17 -16
  55. package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
  56. package/.next/server/app/api/admin/users/[id]/route.js +10 -6
  57. package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
  58. package/.next/server/app/api/admin/users/route.js +10 -8
  59. package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
  60. package/.next/server/app/api/ai/models/route.js +13 -14
  61. package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
  62. package/.next/server/app/api/ai/test/route.js +15 -15
  63. package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
  64. package/.next/server/app/api/analytics/route.js +21 -19
  65. package/.next/server/app/api/analytics/route.js.nft.json +1 -1
  66. package/.next/server/app/api/analyze/route.js +21 -19
  67. package/.next/server/app/api/analyze/route.js.nft.json +1 -1
  68. package/.next/server/app/api/auth/[...nextauth]/route.js +3 -3
  69. package/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  70. package/.next/server/app/api/error-items/[id]/delete/route.js +10 -5
  71. package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
  72. package/.next/server/app/api/error-items/[id]/figure/route.js +18 -17
  73. package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
  74. package/.next/server/app/api/error-items/[id]/fix-latex/route.js +18 -17
  75. package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
  76. package/.next/server/app/api/error-items/[id]/geogebra/route.js +19 -18
  77. package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
  78. package/.next/server/app/api/error-items/[id]/image/route.js +10 -7
  79. package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
  80. package/.next/server/app/api/error-items/[id]/notes/route.js +7 -4
  81. package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
  82. package/.next/server/app/api/error-items/[id]/practice-records/route.js +10 -6
  83. package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
  84. package/.next/server/app/api/error-items/[id]/reanswer/route.js +16 -15
  85. package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
  86. package/.next/server/app/api/error-items/[id]/retag/route.js +18 -17
  87. package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
  88. package/.next/server/app/api/error-items/[id]/route.js +12 -10
  89. package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
  90. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +18 -17
  91. package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
  92. package/.next/server/app/api/error-items/[id]/svg-animation/route.js +18 -17
  93. package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
  94. package/.next/server/app/api/error-items/answer-space/route.js +8 -5
  95. package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -1
  96. package/.next/server/app/api/error-items/batch-delete/route.js +7 -4
  97. package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
  98. package/.next/server/app/api/error-items/clear/route.js +10 -5
  99. package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
  100. package/.next/server/app/api/error-items/export-questions/route.js +10 -9
  101. package/.next/server/app/api/error-items/export-questions/route.js.nft.json +1 -1
  102. package/.next/server/app/api/error-items/list/route.js +12 -10
  103. package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
  104. package/.next/server/app/api/error-items/route.js +23 -22
  105. package/.next/server/app/api/error-items/route.js.nft.json +1 -1
  106. package/.next/server/app/api/error-items/short/[shortId]/route.js +10 -6
  107. package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
  108. package/.next/server/app/api/error-items/similarity/route.js +10 -7
  109. package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
  110. package/.next/server/app/api/eula/status/route/app-paths-manifest.json +3 -0
  111. package/.next/server/app/api/eula/status/route/build-manifest.json +12 -0
  112. package/.next/server/app/api/eula/status/route/server-reference-manifest.json +4 -0
  113. package/.next/server/app/api/eula/status/route.js +17 -0
  114. package/.next/server/app/api/eula/status/route.js.map +5 -0
  115. package/.next/server/app/api/eula/status/route.js.nft.json +1 -0
  116. package/.next/server/app/api/eula/status/route_client-reference-manifest.js +3 -0
  117. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +19 -18
  118. package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
  119. package/.next/server/app/api/exams/[id]/results/route.js +20 -19
  120. package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
  121. package/.next/server/app/api/exams/[id]/retry/route.js +21 -19
  122. package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
  123. package/.next/server/app/api/exams/[id]/route.js +21 -20
  124. package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
  125. package/.next/server/app/api/exams/route.js +20 -18
  126. package/.next/server/app/api/exams/route.js.nft.json +1 -1
  127. package/.next/server/app/api/export/route.js +11 -11
  128. package/.next/server/app/api/export/route.js.nft.json +1 -1
  129. package/.next/server/app/api/geogebra-analyze/route.js +20 -19
  130. package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
  131. package/.next/server/app/api/health/route.js +2 -2
  132. package/.next/server/app/api/health/route.js.nft.json +1 -1
  133. package/.next/server/app/api/import/route.js +22 -21
  134. package/.next/server/app/api/import/route.js.nft.json +1 -1
  135. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +26 -25
  136. package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
  137. package/.next/server/app/api/import-batches/[id]/fix-text/route.js +18 -17
  138. package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
  139. package/.next/server/app/api/import-batches/[id]/read/route.js +27 -26
  140. package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
  141. package/.next/server/app/api/import-batches/[id]/retry/route.js +26 -25
  142. package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
  143. package/.next/server/app/api/import-batches/[id]/route.js +27 -26
  144. package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
  145. package/.next/server/app/api/import-batches/[id]/start/route.js +27 -26
  146. package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
  147. package/.next/server/app/api/import-batches/route.js +27 -26
  148. package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
  149. package/.next/server/app/api/import-tasks/[id]/confirm/route.js +24 -23
  150. package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
  151. package/.next/server/app/api/import-tasks/[id]/read/route.js +24 -23
  152. package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
  153. package/.next/server/app/api/import-tasks/[id]/retry/route.js +26 -25
  154. package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
  155. package/.next/server/app/api/import-tasks/[id]/route.js +24 -23
  156. package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
  157. package/.next/server/app/api/import-tasks/route.js +27 -26
  158. package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
  159. package/.next/server/app/api/initialize/route.js +9 -6
  160. package/.next/server/app/api/initialize/route.js.nft.json +1 -1
  161. package/.next/server/app/api/logs/frontend/route.js +9 -6
  162. package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
  163. package/.next/server/app/api/minimax-code/checkin/route.js +10 -8
  164. package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
  165. package/.next/server/app/api/minimax-code/login/route.js +11 -7
  166. package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
  167. package/.next/server/app/api/minimax-code/route.js +8 -6
  168. package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
  169. package/.next/server/app/api/notebooks/[id]/retag/route.js +18 -16
  170. package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
  171. package/.next/server/app/api/notebooks/[id]/route.js +7 -5
  172. package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
  173. package/.next/server/app/api/notebooks/route.js +7 -5
  174. package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
  175. package/.next/server/app/api/openclaw/batch-upload/route.js +20 -20
  176. package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
  177. package/.next/server/app/api/paper-groups/[id]/route.js +10 -7
  178. package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
  179. package/.next/server/app/api/paper-groups/route.js +11 -8
  180. package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
  181. package/.next/server/app/api/practice/generate/route.js +18 -17
  182. package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
  183. package/.next/server/app/api/practice/grade/route.js +18 -16
  184. package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
  185. package/.next/server/app/api/practice/record/[id]/route.js +19 -18
  186. package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
  187. package/.next/server/app/api/practice/record/route.js +20 -19
  188. package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
  189. package/.next/server/app/api/reanswer/route.js +19 -17
  190. package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
  191. package/.next/server/app/api/register/route.js +5 -6
  192. package/.next/server/app/api/register/route.js.nft.json +1 -1
  193. package/.next/server/app/api/register/status/route.js +8 -7
  194. package/.next/server/app/api/register/status/route.js.nft.json +1 -1
  195. package/.next/server/app/api/requests/[id]/route.js +10 -6
  196. package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
  197. package/.next/server/app/api/review/due/route.js +18 -17
  198. package/.next/server/app/api/review/due/route.js.nft.json +1 -1
  199. package/.next/server/app/api/settings/route.js +9 -8
  200. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  201. package/.next/server/app/api/setup/route.js +10 -8
  202. package/.next/server/app/api/setup/route.js.nft.json +1 -1
  203. package/.next/server/app/api/stats/activity/route.js +11 -9
  204. package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
  205. package/.next/server/app/api/stats/practice/clear/route.js +9 -4
  206. package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
  207. package/.next/server/app/api/stats/practice/route.js +9 -8
  208. package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
  209. package/.next/server/app/api/stats/repeated-mistakes/route.js +19 -17
  210. package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
  211. package/.next/server/app/api/stats/weak-tags/route.js +19 -17
  212. package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
  213. package/.next/server/app/api/tags/route.js +9 -6
  214. package/.next/server/app/api/tags/route.js.nft.json +1 -1
  215. package/.next/server/app/api/tags/stats/route.js +9 -4
  216. package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
  217. package/.next/server/app/api/tags/suggestions/route.js +3 -3
  218. package/.next/server/app/api/tags/suggestions/route.js.nft.json +1 -1
  219. package/.next/server/app/api/tasks/route.js +11 -7
  220. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  221. package/.next/server/app/api/telemetry/route/app-paths-manifest.json +3 -0
  222. package/.next/server/app/api/telemetry/route/build-manifest.json +12 -0
  223. package/.next/server/app/api/telemetry/route/server-reference-manifest.json +4 -0
  224. package/.next/server/app/api/telemetry/route.js +15 -0
  225. package/.next/server/app/api/telemetry/route.js.map +5 -0
  226. package/.next/server/app/api/telemetry/route.js.nft.json +1 -0
  227. package/.next/server/app/api/telemetry/route_client-reference-manifest.js +3 -0
  228. package/.next/server/app/api/tts/[id]/route.js +10 -8
  229. package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
  230. package/.next/server/app/api/tts/batch/route.js +14 -12
  231. package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
  232. package/.next/server/app/api/tts/route.js +12 -11
  233. package/.next/server/app/api/tts/route.js.nft.json +1 -1
  234. package/.next/server/app/api/tts/status/route.js +12 -11
  235. package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
  236. package/.next/server/app/api/user/ai-consent/route.js +10 -5
  237. package/.next/server/app/api/user/ai-consent/route.js.nft.json +1 -1
  238. package/.next/server/app/api/user/route.js +18 -17
  239. package/.next/server/app/api/user/route.js.nft.json +1 -1
  240. package/.next/server/app/api/version/route.js +3 -3
  241. package/.next/server/app/api/version/route.js.nft.json +1 -1
  242. package/.next/server/app/error-items/[id]/page/build-manifest.json +3 -3
  243. package/.next/server/app/error-items/[id]/page.js +7 -6
  244. package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
  245. package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
  246. package/.next/server/app/eula/page/app-paths-manifest.json +3 -0
  247. package/.next/server/app/eula/page/build-manifest.json +22 -0
  248. package/.next/server/app/eula/page/next-font-manifest.json +11 -0
  249. package/.next/server/app/eula/page/react-loadable-manifest.json +1 -0
  250. package/.next/server/app/eula/page/server-reference-manifest.json +4 -0
  251. package/.next/server/app/eula/page.js +15 -0
  252. package/.next/server/app/eula/page.js.map +5 -0
  253. package/.next/server/app/eula/page.js.nft.json +1 -0
  254. package/.next/server/app/eula/page_client-reference-manifest.js +3 -0
  255. package/.next/server/app/exams/[id]/page/build-manifest.json +3 -3
  256. package/.next/server/app/exams/[id]/page.js +7 -6
  257. package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
  258. package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
  259. package/.next/server/app/exams/[id]/print/page/build-manifest.json +3 -3
  260. package/.next/server/app/exams/[id]/print/page.js +7 -6
  261. package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
  262. package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
  263. package/.next/server/app/exams/page/build-manifest.json +3 -3
  264. package/.next/server/app/exams/page.js +7 -6
  265. package/.next/server/app/exams/page.js.nft.json +1 -1
  266. package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
  267. package/.next/server/app/favicon.ico/route.js +2 -2
  268. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  269. package/.next/server/app/import-batches/[id]/page/build-manifest.json +3 -3
  270. package/.next/server/app/import-batches/[id]/page.js +7 -6
  271. package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
  272. package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
  273. package/.next/server/app/import-tasks/[id]/page/build-manifest.json +3 -3
  274. package/.next/server/app/import-tasks/[id]/page.js +7 -6
  275. package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
  276. package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
  277. package/.next/server/app/import-tasks/page/build-manifest.json +3 -3
  278. package/.next/server/app/import-tasks/page.js +7 -6
  279. package/.next/server/app/import-tasks/page.js.nft.json +1 -1
  280. package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
  281. package/.next/server/app/initialize/page/build-manifest.json +3 -3
  282. package/.next/server/app/initialize/page.js +7 -6
  283. package/.next/server/app/initialize/page.js.nft.json +1 -1
  284. package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
  285. package/.next/server/app/login/page/build-manifest.json +3 -3
  286. package/.next/server/app/login/page.js +7 -6
  287. package/.next/server/app/login/page.js.nft.json +1 -1
  288. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  289. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  290. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  291. package/.next/server/app/notebooks/[id]/add/page/build-manifest.json +3 -3
  292. package/.next/server/app/notebooks/[id]/add/page.js +7 -6
  293. package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
  294. package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
  295. package/.next/server/app/notebooks/[id]/page/build-manifest.json +3 -3
  296. package/.next/server/app/notebooks/[id]/page.js +7 -6
  297. package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
  298. package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
  299. package/.next/server/app/notebooks/page/build-manifest.json +3 -3
  300. package/.next/server/app/notebooks/page.js +7 -6
  301. package/.next/server/app/notebooks/page.js.nft.json +1 -1
  302. package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
  303. package/.next/server/app/page/build-manifest.json +3 -3
  304. package/.next/server/app/page.js +7 -6
  305. package/.next/server/app/page.js.nft.json +1 -1
  306. package/.next/server/app/page_client-reference-manifest.js +1 -1
  307. package/.next/server/app/practice/page/build-manifest.json +3 -3
  308. package/.next/server/app/practice/page.js +7 -6
  309. package/.next/server/app/practice/page.js.nft.json +1 -1
  310. package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
  311. package/.next/server/app/print-preview/page/build-manifest.json +3 -3
  312. package/.next/server/app/print-preview/page.js +7 -6
  313. package/.next/server/app/print-preview/page.js.nft.json +1 -1
  314. package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
  315. package/.next/server/app/register/page/build-manifest.json +3 -3
  316. package/.next/server/app/register/page.js +7 -6
  317. package/.next/server/app/register/page.js.nft.json +1 -1
  318. package/.next/server/app/register/page_client-reference-manifest.js +1 -1
  319. package/.next/server/app/review/page/build-manifest.json +3 -3
  320. package/.next/server/app/review/page.js +7 -6
  321. package/.next/server/app/review/page.js.nft.json +1 -1
  322. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  323. package/.next/server/app/setup/page/build-manifest.json +3 -3
  324. package/.next/server/app/setup/page.js +7 -6
  325. package/.next/server/app/setup/page.js.nft.json +1 -1
  326. package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  327. package/.next/server/app/stats/page/build-manifest.json +3 -3
  328. package/.next/server/app/stats/page.js +7 -6
  329. package/.next/server/app/stats/page.js.nft.json +1 -1
  330. package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
  331. package/.next/server/app/tags/page/build-manifest.json +3 -3
  332. package/.next/server/app/tags/page.js +6 -5
  333. package/.next/server/app/tags/page.js.nft.json +1 -1
  334. package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
  335. package/.next/server/app-paths-manifest.json +5 -0
  336. package/.next/server/chunks/[externals]__0474k1hipw6rt._.js +3 -0
  337. package/.next/server/chunks/{[externals]__1_ij0r5wb4t30._.js → [externals]__0bh0f5epkjz_a._.js} +1 -1
  338. package/.next/server/chunks/[externals]__0ojjzq4kzrq1o._.js +3 -0
  339. package/.next/server/chunks/{[externals]__1i7c9m3y35e80._.js → [externals]__13nx5i-mvmw8a._.js} +1 -1
  340. package/.next/server/chunks/{[externals]__0fgpzedhhntg9._.js → [externals]__1_vx733h4gtoh._.js} +1 -1
  341. package/.next/server/chunks/{[externals]__0t1do1irr2px5._.js → [externals]__1egv8vt0vbzl9._.js} +1 -1
  342. package/.next/server/chunks/[externals]__1rtk9r0kf_2k2._.js +3 -0
  343. package/.next/server/chunks/{[root-of-the-server]__06-v15r8ror-q._.js → [root-of-the-server]__0-fpl-4ce-iyj._.js} +1 -1
  344. package/.next/server/chunks/[root-of-the-server]__017-5vo1u87jc._.js +3 -0
  345. package/.next/server/chunks/[root-of-the-server]__0191d7zm1bh5y._.js +3 -0
  346. package/.next/server/chunks/{[root-of-the-server]__0hcbw1sliw973._.js → [root-of-the-server]__04g1e8vi5hfmd._.js} +1 -1
  347. package/.next/server/chunks/[root-of-the-server]__063yyz_9kliuv._.js +3 -0
  348. package/.next/server/chunks/{[root-of-the-server]__05pxdy586nh8a._.js → [root-of-the-server]__06p98x_tv1foa._.js} +1 -1
  349. package/.next/server/chunks/[root-of-the-server]__06zr2kkbkdddm._.js +3 -0
  350. package/.next/server/chunks/{[root-of-the-server]__0-zi_nkxp9dof._.js → [root-of-the-server]__07fsx1y8aa-7l._.js} +1 -1
  351. package/.next/server/chunks/{[root-of-the-server]__0ef-17j7yp2n5._.js → [root-of-the-server]__07tka5n0kbed7._.js} +1 -1
  352. package/.next/server/chunks/[root-of-the-server]__09jqnx_673l93._.js +1 -1
  353. package/.next/server/chunks/{[root-of-the-server]__05wem-_dvlzug._.js → [root-of-the-server]__09re9q5tsyprr._.js} +1 -1
  354. package/.next/server/chunks/{[root-of-the-server]__032tjseth76z3._.js → [root-of-the-server]__09tf4b1-063yn._.js} +1 -1
  355. package/.next/server/chunks/[root-of-the-server]__0abb0_151j5sb._.js +3 -0
  356. package/.next/server/chunks/[root-of-the-server]__0c7btjinzvmj3._.js +3 -0
  357. package/.next/server/chunks/[root-of-the-server]__0dpk56pxg3xh0._.js +3 -0
  358. package/.next/server/chunks/{[root-of-the-server]__02kuxxv4mod1v._.js → [root-of-the-server]__0dqk6jms3f_58._.js} +2 -2
  359. package/.next/server/chunks/{[root-of-the-server]__0_e69dt7jrpui._.js → [root-of-the-server]__0e6jc57nsnwz0._.js} +2 -2
  360. package/.next/server/chunks/[root-of-the-server]__0ehmpofr_lag1._.js +3 -0
  361. package/.next/server/chunks/[root-of-the-server]__0eksw09qkfp-z._.js +3 -0
  362. package/.next/server/chunks/[root-of-the-server]__0euaxkmzk9kv8._.js +3 -0
  363. package/.next/server/chunks/[root-of-the-server]__0evv12a34qcy6._.js +2 -2
  364. package/.next/server/chunks/[root-of-the-server]__0g-4jw7pw15nc._.js +3 -0
  365. package/.next/server/chunks/[root-of-the-server]__0h82l-5c5x36d._.js +3 -0
  366. package/.next/server/chunks/{[root-of-the-server]__08iizowhy6p3l._.js → [root-of-the-server]__0haqb2u-0wd6e._.js} +2 -2
  367. package/.next/server/chunks/{[root-of-the-server]__094ybs6y_fmt5._.js → [root-of-the-server]__0hiv6ho-1ced7._.js} +2 -2
  368. package/.next/server/chunks/[root-of-the-server]__0hypc-hsxhr5m._.js +3 -0
  369. package/.next/server/chunks/{[root-of-the-server]__0eyqs-2hri164._.js → [root-of-the-server]__0hzh1vkuuv1uk._.js} +2 -2
  370. package/.next/server/chunks/[root-of-the-server]__0k0-c4brxlw-a._.js +3 -0
  371. package/.next/server/chunks/[root-of-the-server]__0k_gflpw7m236._.js +3 -0
  372. package/.next/server/chunks/[root-of-the-server]__0km5gt590jg97._.js +3 -0
  373. package/.next/server/chunks/[root-of-the-server]__0llcnfms-yrs4._.js +3 -0
  374. package/.next/server/chunks/[root-of-the-server]__0mgpyw67pdn1h._.js +3 -0
  375. package/.next/server/chunks/[root-of-the-server]__0mztg1mhr7xw2._.js +3 -0
  376. package/.next/server/chunks/[root-of-the-server]__0n9xugvjq0zol._.js +3 -0
  377. package/.next/server/chunks/[root-of-the-server]__0ni89i2lbtpir._.js +3 -0
  378. package/.next/server/chunks/[root-of-the-server]__0nqc3uu_4-moq._.js +3 -0
  379. package/.next/server/chunks/[root-of-the-server]__0nu-b-ap5ix-i._.js +3 -0
  380. package/.next/server/chunks/[root-of-the-server]__0o72hu-jqh_kc._.js +3 -0
  381. package/.next/server/chunks/[root-of-the-server]__0obmdl7r6pt9d._.js +3 -0
  382. package/.next/server/chunks/[root-of-the-server]__0q6of-nw_4lh-._.js +3 -0
  383. package/.next/server/chunks/[root-of-the-server]__0qyqo6m38w5z7._.js +3 -0
  384. package/.next/server/chunks/{[root-of-the-server]__0v3y7_fc4q7mu._.js → [root-of-the-server]__0rxdei7la2kkf._.js} +1 -1
  385. package/.next/server/chunks/[root-of-the-server]__0s1-3vrrlq54r._.js +3 -0
  386. package/.next/server/chunks/[root-of-the-server]__0shmk9rqg_zs_._.js +3 -0
  387. package/.next/server/chunks/[root-of-the-server]__0sr8vnpwvch60._.js +3 -0
  388. package/.next/server/chunks/[root-of-the-server]__0szw35uwpyccm._.js +3 -0
  389. package/.next/server/chunks/[root-of-the-server]__0u2_7w3b4f_c1._.js +3 -0
  390. package/.next/server/chunks/{[root-of-the-server]__0g3w0_9__ljck._.js → [root-of-the-server]__0u_jxskyhdl4l._.js} +1 -1
  391. package/.next/server/chunks/[root-of-the-server]__0v1-d_ribj2jd._.js +3 -0
  392. package/.next/server/chunks/[root-of-the-server]__0w_dr_s2zzqcd._.js +3 -0
  393. package/.next/server/chunks/[root-of-the-server]__0wpt1mx3kryp7._.js +3 -0
  394. package/.next/server/chunks/[root-of-the-server]__0wug5gswjt2zt._.js +3 -0
  395. package/.next/server/chunks/[root-of-the-server]__0xj4u1plpkmot._.js +3 -0
  396. package/.next/server/chunks/{[root-of-the-server]__1ve60byz8pq4j._.js → [root-of-the-server]__0y0v79zd4u8g0._.js} +2 -2
  397. package/.next/server/chunks/[root-of-the-server]__0y82146_dftio._.js +3 -0
  398. package/.next/server/chunks/{[root-of-the-server]__1edbiu94nqqym._.js → [root-of-the-server]__0yf1e2v3dwhh5._.js} +2 -2
  399. package/.next/server/chunks/{[root-of-the-server]__1w_yq12h-kxx0._.js → [root-of-the-server]__0yxdic8niq68m._.js} +2 -2
  400. package/.next/server/chunks/[root-of-the-server]__0z6act451-e8y._.js +3 -0
  401. package/.next/server/chunks/[root-of-the-server]__0zqnlrgdhvyvb._.js +3 -0
  402. package/.next/server/chunks/[root-of-the-server]__1-4kz5lwzu127._.js +3 -0
  403. package/.next/server/chunks/{[root-of-the-server]__0llbkrw8l2ib9._.js → [root-of-the-server]__1-gpls663uhw2._.js} +1 -1
  404. package/.next/server/chunks/[root-of-the-server]__1-ityr2iq9e-w._.js +3 -0
  405. package/.next/server/chunks/[root-of-the-server]__1-sow_jqu0ca5._.js +3 -0
  406. package/.next/server/chunks/[root-of-the-server]__1-uyaylss8lu0._.js +3 -0
  407. package/.next/server/chunks/[root-of-the-server]__1-w4-6dnik6p3._.js +3 -0
  408. package/.next/server/chunks/[root-of-the-server]__1027cegzwspbv._.js +3 -0
  409. package/.next/server/chunks/[root-of-the-server]__106c17t6fe2s5._.js +3 -0
  410. package/.next/server/chunks/[root-of-the-server]__11jqvp7ydid38._.js +3 -0
  411. package/.next/server/chunks/[root-of-the-server]__11qp83z3-uyy2._.js +3 -0
  412. package/.next/server/chunks/[root-of-the-server]__11r530r-p2-n1._.js +3 -0
  413. package/.next/server/chunks/[root-of-the-server]__11vx3bv6nef_u._.js +3 -0
  414. package/.next/server/chunks/[root-of-the-server]__123mmhkfg7y-y._.js +3 -0
  415. package/.next/server/chunks/[root-of-the-server]__128lq-3z36850._.js +3 -0
  416. package/.next/server/chunks/[root-of-the-server]__14g_ger_h73lc._.js +3 -0
  417. package/.next/server/chunks/[root-of-the-server]__15auml0twano9._.js +3 -0
  418. package/.next/server/chunks/[root-of-the-server]__1752yqg4c8167._.js +3 -0
  419. package/.next/server/chunks/[root-of-the-server]__189bp--__jedg._.js +3 -0
  420. package/.next/server/chunks/[root-of-the-server]__19iyo44u41f6y._.js +3 -0
  421. package/.next/server/chunks/[root-of-the-server]__1a6hu09up7_co._.js +3 -0
  422. package/.next/server/chunks/[root-of-the-server]__1a_qtu7129ho6._.js +3 -0
  423. package/.next/server/chunks/[root-of-the-server]__1add4tef8riya._.js +3 -0
  424. package/.next/server/chunks/[root-of-the-server]__1assq-8cgzn69._.js +3 -0
  425. package/.next/server/chunks/[root-of-the-server]__1bdwqmj_bolrp._.js +3 -0
  426. package/.next/server/chunks/[root-of-the-server]__1c6ti0495jkvs._.js +3 -0
  427. package/.next/server/chunks/[root-of-the-server]__1c7b35-fdxgfn._.js +3 -0
  428. package/.next/server/chunks/[root-of-the-server]__1cda8yccka8pg._.js +3 -0
  429. package/.next/server/chunks/[root-of-the-server]__1d7_aw9ogigrd._.js +3 -0
  430. package/.next/server/chunks/[root-of-the-server]__1drgctbrp51zt._.js +3 -0
  431. package/.next/server/chunks/[root-of-the-server]__1dxi3-rtvg91t._.js +3 -0
  432. package/.next/server/chunks/[root-of-the-server]__1e8_j43j1t1m3._.js +2 -2
  433. package/.next/server/chunks/[root-of-the-server]__1edl3mpo9urp-._.js +3 -0
  434. package/.next/server/chunks/[root-of-the-server]__1g-_sfdjkcyjn._.js +3 -0
  435. package/.next/server/chunks/{[root-of-the-server]__0kehix4ojdnhw._.js → [root-of-the-server]__1goozrpjh5dhf._.js} +1 -1
  436. package/.next/server/chunks/[root-of-the-server]__1hdm1t67mdd4k._.js +3 -0
  437. package/.next/server/chunks/[root-of-the-server]__1iy2ggxzd3waf._.js +3 -0
  438. package/.next/server/chunks/[root-of-the-server]__1j749v4z8i78u._.js +3 -0
  439. package/.next/server/chunks/[root-of-the-server]__1jxcq-zd_xo0q._.js +3 -0
  440. package/.next/server/chunks/[root-of-the-server]__1kucx2jgzzdfv._.js +3 -0
  441. package/.next/server/chunks/[root-of-the-server]__1kwxq6h_s1nw5._.js +3 -0
  442. package/.next/server/chunks/[root-of-the-server]__1l63lc79i6lzk._.js +3 -0
  443. package/.next/server/chunks/[root-of-the-server]__1lvrzjzsadms_._.js +3 -0
  444. package/.next/server/chunks/[root-of-the-server]__1m6lbueple6ww._.js +3 -0
  445. package/.next/server/chunks/[root-of-the-server]__1o2w0n3t390ih._.js +3 -0
  446. package/.next/server/chunks/[root-of-the-server]__1oynoaepf6enj._.js +3 -0
  447. package/.next/server/chunks/[root-of-the-server]__1p1k9cmts3crw._.js +3 -0
  448. package/.next/server/chunks/[root-of-the-server]__1purwqhaw584e._.js +3 -0
  449. package/.next/server/chunks/[root-of-the-server]__1pvdepfrlr1-e._.js +3 -0
  450. package/.next/server/chunks/[root-of-the-server]__1qe3_j74hbt45._.js +3 -0
  451. package/.next/server/chunks/[root-of-the-server]__1qmbbudn1-e1n._.js +3 -0
  452. package/.next/server/chunks/[root-of-the-server]__1qp07f8m-pjqu._.js +3 -0
  453. package/.next/server/chunks/[root-of-the-server]__1qr9n5maimy60._.js +3 -0
  454. package/.next/server/chunks/[root-of-the-server]__1qzw098fzq6r4._.js +3 -0
  455. package/.next/server/chunks/[root-of-the-server]__1r2swm8swgb8u._.js +3 -0
  456. package/.next/server/chunks/[root-of-the-server]__1s4kh7tqvbssy._.js +3 -0
  457. package/.next/server/chunks/[root-of-the-server]__1socdh68x-_68._.js +3 -0
  458. package/.next/server/chunks/[root-of-the-server]__1t9nlkh7u11c9._.js +3 -0
  459. package/.next/server/chunks/[root-of-the-server]__1th48iu_ygy4m._.js +3 -0
  460. package/.next/server/chunks/[root-of-the-server]__1tznn8iry7lns._.js +3 -0
  461. package/.next/server/chunks/[root-of-the-server]__1u64nidrg-gwq._.js +3 -0
  462. package/.next/server/chunks/[root-of-the-server]__1uxhodktwnw08._.js +3 -0
  463. package/.next/server/chunks/[root-of-the-server]__1uxxzcdw7avod._.js +3 -0
  464. package/.next/server/chunks/[root-of-the-server]__1v6k289his7kx._.js +3 -0
  465. package/.next/server/chunks/[root-of-the-server]__1y-867werf6-u._.js +3 -0
  466. package/.next/server/chunks/[root-of-the-server]__20an2fcjw_r3_._.js +3 -0
  467. package/.next/server/chunks/[root-of-the-server]__20vr6ko8apn2_._.js +3 -0
  468. package/.next/server/chunks/[root-of-the-server]__2113u3fu2bhjr._.js +3 -0
  469. package/.next/server/chunks/_0-cbnx3g3djb0._.js +3 -0
  470. package/.next/server/chunks/_00vu1-junzbq-._.js +3 -0
  471. package/.next/server/chunks/_011-ll5i30j2e._.js +1 -1
  472. package/.next/server/chunks/_029zt0rilrwvt._.js +1 -1
  473. package/.next/server/chunks/_02h2mvtyvz-d4._.js +3 -0
  474. package/.next/server/chunks/{_0tkov27xr068i._.js → _02qwqg9i39x4_._.js} +3 -3
  475. package/.next/server/chunks/_03ovgh1-4xf3f._.js +1 -1
  476. package/.next/server/chunks/_04yszb9aq_8-5._.js +3 -0
  477. package/.next/server/chunks/_06pseal2zu-71._.js +1 -1
  478. package/.next/server/chunks/_07_mi9-a9cp01._.js +3 -0
  479. package/.next/server/chunks/_08i9pskmlafnp._.js +1 -1
  480. package/.next/server/chunks/_0_3_65z6ak-5i._.js +1 -1
  481. package/.next/server/chunks/_0_5s2mrhxb3-u._.js +1 -1
  482. package/.next/server/chunks/_0b2q7l141kz7e._.js +3 -0
  483. package/.next/server/chunks/_0d66myj_8567o._.js +1 -1
  484. package/.next/server/chunks/_0dnqbyfo7_68d._.js +3 -0
  485. package/.next/server/chunks/_0fvn09pm56f5c._.js +3 -0
  486. package/.next/server/chunks/_0h1rbua_hqkox._.js +1 -1
  487. package/.next/server/chunks/_0i58-g30ox5-8._.js +1 -1
  488. package/.next/server/chunks/_0ji5ibtw-dxaz._.js +3 -0
  489. package/.next/server/chunks/_0l_1b3meaox2k._.js +3 -0
  490. package/.next/server/chunks/_0ljzic33s4u5j._.js +3 -0
  491. package/.next/server/chunks/_0mq_6jxyfb22z._.js +3 -0
  492. package/.next/server/chunks/_0msz759j3_j49._.js +3 -0
  493. package/.next/server/chunks/_0mt2ctbvzfero._.js +1 -1
  494. package/.next/server/chunks/_0oppr1mpoh25l._.js +3 -0
  495. package/.next/server/chunks/_0pthtmszsqkbw._.js +3 -0
  496. package/.next/server/chunks/_0qabe5g22z5te._.js +3 -0
  497. package/.next/server/chunks/_0qsv4bj01yqql._.js +3 -0
  498. package/.next/server/chunks/_0r8u30vd4lix4._.js +1 -1
  499. package/.next/server/chunks/_0t2z6hqe_64cx._.js +3 -0
  500. package/.next/server/chunks/_0tl0cy5j96d7h._.js +1 -1
  501. package/.next/server/chunks/_0vl9yb309ero1._.js +3 -0
  502. package/.next/server/chunks/_0xrmor_-l-mb7._.js +3 -0
  503. package/.next/server/chunks/_0zs7jfzzshbfq._.js +1 -1
  504. package/.next/server/chunks/_12dxzk9gyci2a._.js +3 -0
  505. package/.next/server/chunks/_12i51zlq-xxrl._.js +1 -1
  506. package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
  507. package/.next/server/chunks/_12xi_xqvtrn3k._.js +1 -1
  508. package/.next/server/chunks/_14l8uqb__fhx_._.js +3 -0
  509. package/.next/server/chunks/_18hm5aaxkr500._.js +1 -1
  510. package/.next/server/chunks/_1a1aqmie1d3u_._.js +1 -1
  511. package/.next/server/chunks/_1a1udq0c4_6ad._.js +1 -1
  512. package/.next/server/chunks/_1ahi8466v1b3l._.js +1 -1
  513. package/.next/server/chunks/_1b0269xt-c8f7._.js +1 -1
  514. package/.next/server/chunks/{_1638xaazsmf2m._.js → _1csx8ckltgali._.js} +3 -3
  515. package/.next/server/chunks/_1cydcmia78z15._.js +1 -1
  516. package/.next/server/chunks/_1ds1oiznivdbk._.js +3 -0
  517. package/.next/server/chunks/_1e8w9uuebtrcb._.js +1 -1
  518. package/.next/server/chunks/_1eixvuh0vryjo._.js +3 -0
  519. package/.next/server/chunks/_1eqnx6dcz6a03._.js +57 -0
  520. package/.next/server/chunks/{_1vddun9dxzaqo._.js → _1gtuhmdu6udof._.js} +3 -3
  521. package/.next/server/chunks/_1h650rc49jtvn._.js +3 -0
  522. package/.next/server/chunks/_1hj7iit2u6xez._.js +1 -1
  523. package/.next/server/chunks/_1iqu8im2_w245._.js +3 -0
  524. package/.next/server/chunks/_1llkon9veg476._.js +3 -0
  525. package/.next/server/chunks/_1muwmr6j76v3m._.js +1 -1
  526. package/.next/server/chunks/_1ooq1_fguyb4w._.js +57 -0
  527. package/.next/server/chunks/_1op7hx6zu6ybj._.js +3 -0
  528. package/.next/server/chunks/_1pvqo-qnv-nqm._.js +1 -1
  529. package/.next/server/chunks/_1pzo4q3yg5f57._.js +3 -0
  530. package/.next/server/chunks/_1q65ai1_dwgjp._.js +1 -1
  531. package/.next/server/chunks/_1q6syu3thw-it._.js +3 -0
  532. package/.next/server/chunks/_1s5-ldt8xhtpp._.js +1 -1
  533. package/.next/server/chunks/_1sp0xk1c5jx5r._.js +1 -1
  534. package/.next/server/chunks/_1u9u2jcj407s4._.js +3 -0
  535. package/.next/server/chunks/_1yk4m2dpf3g7z._.js +3 -0
  536. package/.next/server/chunks/_1yvd01woddaxt._.js +16 -0
  537. package/.next/server/chunks/_1z1uutzmdk81m._.js +3 -0
  538. package/.next/server/chunks/_1z_ujac_e_65s._.js +1 -1
  539. package/.next/server/chunks/_next-internal_server_app_api_admin_eula_accept_route_actions_20oa2r1dtaq8b.js +3 -0
  540. package/.next/server/chunks/_next-internal_server_app_api_admin_telemetry_route_actions_0tkd4wktkie81.js +3 -0
  541. package/.next/server/chunks/_next-internal_server_app_api_eula_status_route_actions_1aquilgqufvjg.js +3 -0
  542. package/.next/server/chunks/_next-internal_server_app_api_telemetry_route_actions_1w3amzmkajq41.js +3 -0
  543. package/.next/server/chunks/node_modules_zod_v4_classic_external_0yua5dbpvcjkf.js +57 -0
  544. package/.next/server/chunks/src_1m8nu0emt57j7._.js +3 -0
  545. package/.next/server/chunks/src_lib_01gngn1m9i35_._.js +3 -0
  546. package/.next/server/chunks/src_lib_02gzfin88m7_c._.js +3 -0
  547. package/.next/server/chunks/src_lib_02ktrqkdh6_xt._.js +1 -1
  548. package/.next/server/chunks/src_lib_0iplyaedosuse._.js +3 -0
  549. package/.next/server/chunks/src_lib_0uv8inw48qq9_._.js +3 -0
  550. package/.next/server/chunks/src_lib_1-tyfr__vw2-e._.js +3 -0
  551. package/.next/server/chunks/src_lib_112p9x7kbw8a7._.js +3 -0
  552. package/.next/server/chunks/src_lib_11y241q--pwf_._.js +3 -0
  553. package/.next/server/chunks/src_lib_152-vqegmmtew._.js +3 -0
  554. package/.next/server/chunks/src_lib_17vggusj2wk07._.js +3 -0
  555. package/.next/server/chunks/src_lib_17ww8fw26k_5c._.js +3 -0
  556. package/.next/server/chunks/{src_lib_mastery-status_ts_0e9jnp-14tby5._.js → src_lib_19wyrgsqc6869._.js} +2 -2
  557. package/.next/server/chunks/src_lib_1bzw3hjm_9u2p._.js +3 -0
  558. package/.next/server/chunks/src_lib_1je9q_qxmd-z0._.js +3 -0
  559. package/.next/server/chunks/src_lib_1x_55q3hwt0z5._.js +3 -0
  560. package/.next/server/chunks/src_lib_1yw_vc01va60_._.js +3 -0
  561. package/.next/server/chunks/src_lib_1z24jdjfkbdxm._.js +3 -0
  562. package/.next/server/chunks/src_lib_ai_index_ts_0m0hlq4d9zy9i._.js +1 -1
  563. package/.next/server/chunks/src_lib_config_index_ts_14-9cq9wn5r30._.js +3 -0
  564. package/.next/server/chunks/src_lib_exam_exam_ts_18c3t7bnr1z5k._.js +1 -1
  565. package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +1 -1
  566. package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +1 -1
  567. package/.next/server/chunks/src_lib_initialization_ts_0uk331d512nu-._.js +1 -55
  568. package/.next/server/chunks/src_lib_mastery_ts_0ybi94uxn8ut6._.js +1 -1
  569. package/.next/server/chunks/src_lib_minimax-code_checkin_ts_1j1mpuxc1vgoz._.js +1 -1
  570. package/.next/server/chunks/src_lib_question_0uw17e6at-i_h._.js +1 -1
  571. package/.next/server/chunks/src_lib_question_question-analysis_ts_1-3x2cfxlr3fs._.js +1 -1
  572. package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +1 -1
  573. package/.next/server/chunks/src_lib_tags_retag_ts_09s5xwrzcy144._.js +1 -1
  574. package/.next/server/chunks/src_lib_telemetry_scheduler_ts_1tjvqtggkqnd3._.js +3 -0
  575. package/.next/server/chunks/src_lib_telemetry_server_ts_03e7c8dt4slbj._.js +3 -0
  576. package/.next/server/chunks/src_lib_telemetry_server_ts_04s9gvl8y_-5j._.js +3 -0
  577. package/.next/server/chunks/src_lib_telemetry_server_ts_0f78qhte267bg._.js +3 -0
  578. package/.next/server/chunks/src_lib_telemetry_server_ts_0hbu8_zacpzfj._.js +3 -0
  579. package/.next/server/chunks/src_lib_telemetry_server_ts_0k44kaxm3s7b7._.js +3 -0
  580. package/.next/server/chunks/src_lib_telemetry_server_ts_0mdq-bx1yd8hn._.js +3 -0
  581. package/.next/server/chunks/src_lib_telemetry_server_ts_0ptn-gkeht1dg._.js +3 -0
  582. package/.next/server/chunks/src_lib_telemetry_server_ts_0rul_098wmjn7._.js +3 -0
  583. package/.next/server/chunks/src_lib_telemetry_server_ts_10dl7t48m7u9e._.js +3 -0
  584. package/.next/server/chunks/src_lib_telemetry_server_ts_12x72t_dxd7w6._.js +3 -0
  585. package/.next/server/chunks/src_lib_telemetry_server_ts_15p258rq4wt4n._.js +3 -0
  586. package/.next/server/chunks/src_lib_telemetry_server_ts_15u7_y30fkz4t._.js +3 -0
  587. package/.next/server/chunks/src_lib_telemetry_server_ts_19h24quae1zdn._.js +3 -0
  588. package/.next/server/chunks/src_lib_telemetry_server_ts_1gl12ssni1itx._.js +3 -0
  589. package/.next/server/chunks/src_lib_telemetry_server_ts_20_hb8la0053f._.js +3 -0
  590. package/.next/server/chunks/ssr/{[root-of-the-server]__1ynp6nm1gttsf._.js → [root-of-the-server]__07r0cyk2wiaod._.js} +1 -1
  591. package/.next/server/chunks/ssr/{[root-of-the-server]__0u9zu26bwv2sw._.js → [root-of-the-server]__09gavo7zzj_er._.js} +1 -1
  592. package/.next/server/chunks/ssr/{[root-of-the-server]__1y--gqu4r-u7n._.js → [root-of-the-server]__0_9dwjra-hhyw._.js} +1 -1
  593. package/.next/server/chunks/ssr/{[root-of-the-server]__11oag3aoydip3._.js → [root-of-the-server]__0fu4zixj0-za9._.js} +1 -1
  594. package/.next/server/chunks/ssr/[root-of-the-server]__0hwe448u3jb_t._.js +3 -0
  595. package/.next/server/chunks/ssr/{[root-of-the-server]__1u0_l34j65qiv._.js → [root-of-the-server]__0jbcpiby6tjob._.js} +1 -1
  596. package/.next/server/chunks/ssr/{[root-of-the-server]__0p9ee02rz9njl._.js → [root-of-the-server]__0r3n71d2cj4e3._.js} +1 -1
  597. package/.next/server/chunks/ssr/{[root-of-the-server]__1zupg0zigit-2._.js → [root-of-the-server]__0wggrh44x0vrr._.js} +1 -1
  598. package/.next/server/chunks/ssr/{[root-of-the-server]__09gkts39mwkt7._.js → [root-of-the-server]__0xdwwljmlu85-._.js} +1 -1
  599. package/.next/server/chunks/ssr/[root-of-the-server]__0xqrflqcz8t4j._.js +3 -0
  600. package/.next/server/chunks/ssr/[root-of-the-server]__0yizeg1yyhfse._.js +3 -0
  601. package/.next/server/chunks/ssr/{[root-of-the-server]__0qtqn7_slrnax._.js → [root-of-the-server]__0yr8no1v_1u-s._.js} +1 -1
  602. package/.next/server/chunks/ssr/{[root-of-the-server]__0oytrwzt_5qpb._.js → [root-of-the-server]__134g2tnpaqb56._.js} +1 -1
  603. package/.next/server/chunks/ssr/{[root-of-the-server]__0g3m2_o67ezes._.js → [root-of-the-server]__14--hf0oqh14t._.js} +1 -1
  604. package/.next/server/chunks/ssr/{[root-of-the-server]__1l68oxzjvj18_._.js → [root-of-the-server]__14_jos-hb89g5._.js} +1 -1
  605. package/.next/server/chunks/ssr/[root-of-the-server]__15pyhznlctw50._.js +3 -0
  606. package/.next/server/chunks/ssr/{[root-of-the-server]__09nzl4il765_h._.js → [root-of-the-server]__16l14wrfwv1gc._.js} +1 -1
  607. package/.next/server/chunks/ssr/{[root-of-the-server]__1ojkbjq8khldj._.js → [root-of-the-server]__17dyox02mhv1s._.js} +1 -1
  608. package/.next/server/chunks/ssr/{[root-of-the-server]__06epb5zt8i9nl._.js → [root-of-the-server]__17i6rp91oy5vo._.js} +1 -1
  609. package/.next/server/chunks/ssr/{[root-of-the-server]__1upuqpqeyi3o6._.js → [root-of-the-server]__18fxrwlkwgqei._.js} +1 -1
  610. package/.next/server/chunks/ssr/{[root-of-the-server]__0imb483i37k9-._.js → [root-of-the-server]__1am3lapew6zvw._.js} +1 -1
  611. package/.next/server/chunks/ssr/{[root-of-the-server]__0l_a_z149v59o._.js → [root-of-the-server]__1d9g9805jzj0h._.js} +1 -1
  612. package/.next/server/chunks/ssr/[root-of-the-server]__1de5zmmw9_i_0._.js +3 -0
  613. package/.next/server/chunks/ssr/{[root-of-the-server]__19q4cpy9jtu0k._.js → [root-of-the-server]__1ee8a1_v1nc_2._.js} +1 -1
  614. package/.next/server/chunks/ssr/{[root-of-the-server]__0gpba1ifag5cz._.js → [root-of-the-server]__1fc1plx5cvx-o._.js} +1 -1
  615. package/.next/server/chunks/ssr/{[root-of-the-server]__0lhmylur63dzg._.js → [root-of-the-server]__1hwfsg__jf-6s._.js} +1 -1
  616. package/.next/server/chunks/ssr/{[root-of-the-server]__12upjtzbfyt0p._.js → [root-of-the-server]__1lvng26o_-n10._.js} +1 -1
  617. package/.next/server/chunks/ssr/{[root-of-the-server]__1exslx8xrlonp._.js → [root-of-the-server]__1r7wmu7cq9bc5._.js} +1 -1
  618. package/.next/server/chunks/ssr/{[root-of-the-server]__1qkpcqb6ewk9r._.js → [root-of-the-server]__212x4ujehvgfr._.js} +1 -1
  619. package/.next/server/chunks/ssr/_05k02824g2tpo._.js +1 -1
  620. package/.next/server/chunks/ssr/_0xlbgtld9_r3o._.js +1 -1
  621. package/.next/server/chunks/ssr/_0znwyf0_b8ia6._.js +3 -0
  622. package/.next/server/chunks/ssr/_18c4g09vqhp-3._.js +3 -0
  623. package/.next/server/chunks/ssr/_1dx7u1_w4db4k._.js +3 -0
  624. package/.next/server/chunks/ssr/_1dzto-s5j-b6b._.js +3 -0
  625. package/.next/server/chunks/ssr/_1fx20-rihohax._.js +3 -0
  626. package/.next/server/chunks/ssr/{_0j-r3zhz2ucmg._.js → _1h4fhwg03wbzm._.js} +2 -2
  627. package/.next/server/chunks/ssr/{_0fp_p60hb9ex8._.js → _1qft_czd2ss62._.js} +2 -2
  628. package/.next/server/chunks/ssr/_next-internal_server_app_eula_page_actions_18tq_576rljb3.js +3 -0
  629. package/.next/server/chunks/ssr/{node_modules_0v4btraw_y7x2._.js → node_modules_0fzknrrqq1bjz._.js} +2 -2
  630. package/.next/server/chunks/ssr/{node_modules_1cm5684hz1o51._.js → node_modules_1m0t7n1f8dlgz._.js} +1 -1
  631. package/.next/server/chunks/ssr/{node_modules_next_dist_1gey_lsf9b_wo._.js → node_modules_1nyc7rcdp-qyz._.js} +2 -2
  632. package/.next/server/chunks/ssr/{node_modules_1im5by828hg3r._.js → node_modules_1rxrrb2v6tutq._.js} +1 -1
  633. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_064ewwu8t3acv.js → node_modules_heic-to_dist_csp_heic-to_0mr1-2rg_ae47.js} +1 -1
  634. package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_1xp1ys7qrz7uh.js → node_modules_heic-to_dist_csp_heic-to_1m3ywmnbpcnde.js} +1 -1
  635. package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_play_mjs_1al5hft92dlrg._.js +2 -2
  636. package/.next/server/chunks/ssr/node_modules_next_1uutai47hzn8q._.js +32 -0
  637. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03wom3p0uk-9v.js +3 -0
  638. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_06g_36yw1w8hx.js +3 -0
  639. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0_e9pmhugyjn5.js +3 -0
  640. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0_sqodejj4l1-.js +3 -0
  641. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0ab3lk0549xld.js +3 -0
  642. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0ea7gndnxen5c.js +3 -0
  643. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0loue6y_0xsqm.js +3 -0
  644. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0srx187o85d67.js +3 -0
  645. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0zs2ei_cj_z60.js +3 -0
  646. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19g6es93ste47.js +3 -0
  647. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1aqwesdat2m1c.js +3 -0
  648. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1f4rp6x19w0vu.js +3 -0
  649. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1gap3wxqz0gtc.js +3 -0
  650. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1hmcb0hk2i14y.js +3 -0
  651. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1jhcfycewcquz.js +3 -0
  652. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1k7tflkgmqhi6.js +3 -0
  653. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1kb_ff04m4p78.js +3 -0
  654. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1kxecu5ukdyhb.js +3 -0
  655. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1lr4m6vwu8-gh.js +3 -0
  656. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1rw8e8leurt4c.js +3 -0
  657. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1w0trita-felf.js +3 -0
  658. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1whku467x2as5.js +3 -0
  659. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1wxysr9vu7w8g.js +3 -0
  660. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_20dal1y611l3i.js +3 -0
  661. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_20yzxgilgne8r.js +3 -0
  662. package/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_0veaboc415l0m.js +1 -1
  663. package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
  664. package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdmyh7_9q._.js +1 -1
  665. package/.next/server/chunks/ssr/src_app_error_tsx_0ac07bj196djj._.js +3 -0
  666. package/.next/server/chunks/ssr/src_app_error_tsx_1gs2ol2a9g-a6._.js +3 -0
  667. package/.next/server/chunks/ssr/src_app_eula_page_tsx_1_xs2xki0wk_k._.js +113 -0
  668. package/.next/server/chunks/ssr/src_app_global-error_tsx_009xrx8nk64k0._.js +3 -0
  669. package/.next/server/chunks/ssr/src_app_global-error_tsx_0w4-lfw52j65b._.js +3 -0
  670. package/.next/server/chunks/ssr/src_app_import-batches_[id]_page_tsx_0mhg_vriwmkkw._.js +1 -1
  671. package/.next/server/chunks/ssr/src_app_initialize_page_tsx_0v79s64spkms8._.js +1 -1
  672. package/.next/server/chunks/ssr/src_components_correction-editor_tsx_1p7z02t66tndx._.js +3 -3
  673. package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +12 -12
  674. package/.next/server/chunks/ssr/src_components_ui_dialog_tsx_1tn-i_6d3rhzt._.js +1 -1
  675. package/.next/server/chunks/ssr/src_contexts_LanguageContext_tsx_0r6xucmeu1k5z._.js +3 -0
  676. package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.js +1 -1
  677. package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +1 -1
  678. package/.next/server/instrumentation.js +1 -1
  679. package/.next/server/middleware-build-manifest.js +64 -53
  680. package/.next/server/middleware.js +1 -1
  681. package/.next/server/next-font-manifest.js +1 -1
  682. package/.next/server/next-font-manifest.json +4 -0
  683. package/.next/server/pages/500.html +1 -1
  684. package/.next/server/preview-props.json +3 -3
  685. package/.next/server/server-reference-manifest.js +1 -1
  686. package/.next/server/server-reference-manifest.json +1 -1
  687. package/.next/static/chunks/04d8bsqt1kisy.js +1 -0
  688. package/.next/static/chunks/059tntkmkgtf4.js +1 -0
  689. package/.next/static/chunks/05ag8rqhwn73b.js +31 -0
  690. package/.next/static/chunks/05o2so3pmerou.js +38 -0
  691. package/.next/static/chunks/06-rkidj4bq0l.js +1 -0
  692. package/.next/static/chunks/08s9mla4gkon2.js +1 -0
  693. package/.next/static/chunks/0b49hpru2gjb1.js +111 -0
  694. package/.next/static/chunks/{0ddn90rrjkr7y.js → 0bufg6cl_1x2h.js} +4 -4
  695. package/.next/static/chunks/0li0d9ufsgsk-.js +1 -0
  696. package/.next/static/chunks/{1ogj95u4nfqgm.js → 0lnx4h7lv4ev5.js} +7 -7
  697. package/.next/static/chunks/{01zokrwums-fz.js → 0zesew8nd2ekz.js} +1 -1
  698. package/.next/static/chunks/1797q5c62e7um.js +1 -0
  699. package/.next/static/chunks/{2eieglv-e8e1j.js → 1ti8akix3yalf.js} +1 -1
  700. package/.next/static/chunks/{3gdidqib5e1mw.js → 1u6m54j807_cw.js} +1 -1
  701. package/.next/static/chunks/26r74vzqszcs5.js +2 -0
  702. package/.next/static/chunks/{07a3zn8uvj2i0.js → 2aifo9g5v8kaq.js} +1 -1
  703. package/.next/static/chunks/2bk5f71d5ke2y.js +1 -0
  704. package/.next/static/chunks/{1bcso9y60vl1j.js → 2da48dkivw_8a.js} +1 -1
  705. package/.next/static/chunks/2e4y6sq3k0g-g.js +1 -0
  706. package/.next/static/chunks/2fkobtei061tq.js +1 -0
  707. package/.next/static/chunks/2hroxfe_3_b0q.js +1 -0
  708. package/.next/static/chunks/2n2hvugnmgoy3.js +16 -0
  709. package/.next/static/chunks/{1-qu_z3i5b8ul.js → 34wzp7ret_83-.js} +1 -1
  710. package/.next/static/chunks/3bq587l754kfc.js +198 -0
  711. package/.next/static/chunks/3bv2u8mcme1z4.css +3 -0
  712. package/.next/static/chunks/3g-l81pwd4ggm.js +1 -0
  713. package/.next/static/chunks/3m5wl0uzrt4sz.js +2 -0
  714. package/.next/static/chunks/3x6gp12gnmsl2.js +1 -0
  715. package/.next/static/chunks/446h22_i8bm1_.js +1 -0
  716. package/launcher.js +2 -0
  717. package/package.json +1 -1
  718. package/prisma/migrations/20261105060458_ai_completion/migration.sql +23 -0
  719. package/prisma/migrations/20261105065127_external_account/migration.sql +17 -0
  720. package/prisma/migrations/20261105135634_add_telemetry_tables/migration.sql +45 -0
  721. package/prisma/schema.prisma +75 -0
  722. package/prisma/seed.db +0 -0
  723. package/server.js +1 -1
  724. package/.next/server/chunks/[externals]__1anmfgb7av8ou._.js +0 -3
  725. package/.next/server/chunks/[externals]__1j5vgk-wr4vpe._.js +0 -3
  726. package/.next/server/chunks/[externals]_fs_0pplqgcyv2l7l._.js +0 -3
  727. package/.next/server/chunks/[root-of-the-server]__0-d_vh1kcmw7g._.js +0 -3
  728. package/.next/server/chunks/[root-of-the-server]__00cl_lnn-40t3._.js +0 -3
  729. package/.next/server/chunks/[root-of-the-server]__00x5ad3w5zwfp._.js +0 -3
  730. package/.next/server/chunks/[root-of-the-server]__06i2kswg2zb80._.js +0 -3
  731. package/.next/server/chunks/[root-of-the-server]__06irm2njvcb2a._.js +0 -3
  732. package/.next/server/chunks/[root-of-the-server]__07twbtie04xx6._.js +0 -3
  733. package/.next/server/chunks/[root-of-the-server]__08wrx5aay9znc._.js +0 -3
  734. package/.next/server/chunks/[root-of-the-server]__092b1e081ocu6._.js +0 -3
  735. package/.next/server/chunks/[root-of-the-server]__092h03ec6f_1u._.js +0 -3
  736. package/.next/server/chunks/[root-of-the-server]__09aolocrwucnt._.js +0 -3
  737. package/.next/server/chunks/[root-of-the-server]__0_icvdlc-nqy_._.js +0 -3
  738. package/.next/server/chunks/[root-of-the-server]__0_uup9ppknahw._.js +0 -3
  739. package/.next/server/chunks/[root-of-the-server]__0aynxvfd9wp_r._.js +0 -3
  740. package/.next/server/chunks/[root-of-the-server]__0cgpuhmu87blm._.js +0 -3
  741. package/.next/server/chunks/[root-of-the-server]__0dv_e-7ip1wts._.js +0 -3
  742. package/.next/server/chunks/[root-of-the-server]__0ej9lsrmus5m4._.js +0 -3
  743. package/.next/server/chunks/[root-of-the-server]__0f8kzoc_gaf8y._.js +0 -3
  744. package/.next/server/chunks/[root-of-the-server]__0fembrq8pciz5._.js +0 -3
  745. package/.next/server/chunks/[root-of-the-server]__0g0van70ibkrj._.js +0 -3
  746. package/.next/server/chunks/[root-of-the-server]__0g2s86ce159k0._.js +0 -3
  747. package/.next/server/chunks/[root-of-the-server]__0g848ha1gy56h._.js +0 -3
  748. package/.next/server/chunks/[root-of-the-server]__0gankrx12ee4n._.js +0 -3
  749. package/.next/server/chunks/[root-of-the-server]__0hxujtysw2kwx._.js +0 -3
  750. package/.next/server/chunks/[root-of-the-server]__0ilrqq68_5wg5._.js +0 -3
  751. package/.next/server/chunks/[root-of-the-server]__0jh610iscvrmp._.js +0 -3
  752. package/.next/server/chunks/[root-of-the-server]__0ky9-3kyba1lu._.js +0 -3
  753. package/.next/server/chunks/[root-of-the-server]__0l3io0vyav4if._.js +0 -3
  754. package/.next/server/chunks/[root-of-the-server]__0lgbdth9-z6qg._.js +0 -3
  755. package/.next/server/chunks/[root-of-the-server]__0lwuci8tnhggb._.js +0 -3
  756. package/.next/server/chunks/[root-of-the-server]__0m4dmn-gj2fnm._.js +0 -3
  757. package/.next/server/chunks/[root-of-the-server]__0mfr1ne23y4yo._.js +0 -3
  758. package/.next/server/chunks/[root-of-the-server]__0mslax132s9jp._.js +0 -3
  759. package/.next/server/chunks/[root-of-the-server]__0ntfbtwf-s7a6._.js +0 -3
  760. package/.next/server/chunks/[root-of-the-server]__0of02idkcau3l._.js +0 -3
  761. package/.next/server/chunks/[root-of-the-server]__0ohg2cyilt44e._.js +0 -3
  762. package/.next/server/chunks/[root-of-the-server]__0p8cwd_go8pid._.js +0 -3
  763. package/.next/server/chunks/[root-of-the-server]__0rsgnrk2qy8wo._.js +0 -3
  764. package/.next/server/chunks/[root-of-the-server]__0si2-m5an9zl7._.js +0 -3
  765. package/.next/server/chunks/[root-of-the-server]__0svdqovwfpro2._.js +0 -3
  766. package/.next/server/chunks/[root-of-the-server]__0tsi6_qmtro9q._.js +0 -3
  767. package/.next/server/chunks/[root-of-the-server]__0tvp4sm4zx3wt._.js +0 -3
  768. package/.next/server/chunks/[root-of-the-server]__0u1fu9dvxmlxd._.js +0 -3
  769. package/.next/server/chunks/[root-of-the-server]__0ukr4xnposhv9._.js +0 -3
  770. package/.next/server/chunks/[root-of-the-server]__0v0tr1bn12xyu._.js +0 -3
  771. package/.next/server/chunks/[root-of-the-server]__0vazs1dmyut7b._.js +0 -3
  772. package/.next/server/chunks/[root-of-the-server]__0vrag-4p6eznc._.js +0 -3
  773. package/.next/server/chunks/[root-of-the-server]__0w9f5-xtpane-._.js +0 -3
  774. package/.next/server/chunks/[root-of-the-server]__0w9x80vsjqsbt._.js +0 -3
  775. package/.next/server/chunks/[root-of-the-server]__0x76w78-o6bfn._.js +0 -3
  776. package/.next/server/chunks/[root-of-the-server]__0xobqdj2u2s67._.js +0 -3
  777. package/.next/server/chunks/[root-of-the-server]__0xwm-4fhj8j--._.js +0 -3
  778. package/.next/server/chunks/[root-of-the-server]__0y3ui5-k9baec._.js +0 -3
  779. package/.next/server/chunks/[root-of-the-server]__1-6r_3pmgkz13._.js +0 -3
  780. package/.next/server/chunks/[root-of-the-server]__10ngcci8pf29l._.js +0 -3
  781. package/.next/server/chunks/[root-of-the-server]__13u9cd4f8_gva._.js +0 -3
  782. package/.next/server/chunks/[root-of-the-server]__14e45mqzb1vjt._.js +0 -3
  783. package/.next/server/chunks/[root-of-the-server]__14jf33wwjqbw1._.js +0 -3
  784. package/.next/server/chunks/[root-of-the-server]__15dipxocczlvx._.js +0 -3
  785. package/.next/server/chunks/[root-of-the-server]__16j73gw0vaw81._.js +0 -3
  786. package/.next/server/chunks/[root-of-the-server]__176zyagwjex4i._.js +0 -3
  787. package/.next/server/chunks/[root-of-the-server]__17_lgezg_8k4-._.js +0 -3
  788. package/.next/server/chunks/[root-of-the-server]__17ed9rw-rhun-._.js +0 -3
  789. package/.next/server/chunks/[root-of-the-server]__17qr9lkc0h9ta._.js +0 -3
  790. package/.next/server/chunks/[root-of-the-server]__18axi_zdc2uzr._.js +0 -3
  791. package/.next/server/chunks/[root-of-the-server]__19kic_glbz32b._.js +0 -3
  792. package/.next/server/chunks/[root-of-the-server]__19larrqj6rokv._.js +0 -3
  793. package/.next/server/chunks/[root-of-the-server]__1ae5zzeo8_c2s._.js +0 -3
  794. package/.next/server/chunks/[root-of-the-server]__1cno0cu053una._.js +0 -3
  795. package/.next/server/chunks/[root-of-the-server]__1cowc49z-6tny._.js +0 -3
  796. package/.next/server/chunks/[root-of-the-server]__1dqb3qtykno2z._.js +0 -3
  797. package/.next/server/chunks/[root-of-the-server]__1drs4rr5x286d._.js +0 -3
  798. package/.next/server/chunks/[root-of-the-server]__1f-ve8idsq57l._.js +0 -3
  799. package/.next/server/chunks/[root-of-the-server]__1f_ztllkdhd1g._.js +0 -3
  800. package/.next/server/chunks/[root-of-the-server]__1g_f4opcfnwwl._.js +0 -3
  801. package/.next/server/chunks/[root-of-the-server]__1h0tye6lfskvl._.js +0 -3
  802. package/.next/server/chunks/[root-of-the-server]__1hnyj47zdzrxo._.js +0 -3
  803. package/.next/server/chunks/[root-of-the-server]__1iysogl93kyqq._.js +0 -3
  804. package/.next/server/chunks/[root-of-the-server]__1k0fuhrt1iiad._.js +0 -3
  805. package/.next/server/chunks/[root-of-the-server]__1ka1feeszq3gt._.js +0 -3
  806. package/.next/server/chunks/[root-of-the-server]__1ke-yb4v9knf4._.js +0 -3
  807. package/.next/server/chunks/[root-of-the-server]__1kp5acqtrdysf._.js +0 -3
  808. package/.next/server/chunks/[root-of-the-server]__1kxewr0hve3xs._.js +0 -3
  809. package/.next/server/chunks/[root-of-the-server]__1l47_6jece7bq._.js +0 -3
  810. package/.next/server/chunks/[root-of-the-server]__1m8m5io-tr21e._.js +0 -3
  811. package/.next/server/chunks/[root-of-the-server]__1nb3q3vglx569._.js +0 -3
  812. package/.next/server/chunks/[root-of-the-server]__1o42aqttqc3b8._.js +0 -3
  813. package/.next/server/chunks/[root-of-the-server]__1o9pbkx7ejxu0._.js +0 -3
  814. package/.next/server/chunks/[root-of-the-server]__1pw5kygb6kibs._.js +0 -3
  815. package/.next/server/chunks/[root-of-the-server]__1qy_fxhx5yu1t._.js +0 -3
  816. package/.next/server/chunks/[root-of-the-server]__1s-y00c3-nc_-._.js +0 -3
  817. package/.next/server/chunks/[root-of-the-server]__1sokwptzp3b3m._.js +0 -3
  818. package/.next/server/chunks/[root-of-the-server]__1vg8sj020j9pp._.js +0 -3
  819. package/.next/server/chunks/[root-of-the-server]__1vwlmzqz2r0yr._.js +0 -3
  820. package/.next/server/chunks/[root-of-the-server]__1x6r0_9_fqoy-._.js +0 -3
  821. package/.next/server/chunks/[root-of-the-server]__1xx-czpwd_ny7._.js +0 -3
  822. package/.next/server/chunks/[root-of-the-server]__1yyezurgy7e3k._.js +0 -3
  823. package/.next/server/chunks/[root-of-the-server]__1z9hl9qdokxpu._.js +0 -3
  824. package/.next/server/chunks/[root-of-the-server]__1zkrlusy_cbtj._.js +0 -3
  825. package/.next/server/chunks/[root-of-the-server]__20bo6axxlug5q._.js +0 -3
  826. package/.next/server/chunks/_04vbgvl2gl5bc._.js +0 -3
  827. package/.next/server/chunks/_05-ouasholjra._.js +0 -3
  828. package/.next/server/chunks/_0lepv-j_r8kfv._.js +0 -3
  829. package/.next/server/chunks/_0lo1_vwfiel-b._.js +0 -3
  830. package/.next/server/chunks/_0s8v0xiwcw6od._.js +0 -3
  831. package/.next/server/chunks/_1ab7h8-how0le._.js +0 -3
  832. package/.next/server/chunks/_1ad8i3ukisj99._.js +0 -3
  833. package/.next/server/chunks/_1lz-5f4_92l2u._.js +0 -3
  834. package/.next/server/chunks/_1qcv4muwnx82-._.js +0 -3
  835. package/.next/server/chunks/_1t632kndbc0tj._.js +0 -3
  836. package/.next/server/chunks/_1xx5l4x084brt._.js +0 -3
  837. package/.next/server/chunks/_1zbkha-v5mkk0._.js +0 -3
  838. package/.next/server/chunks/node_modules_zod_v4_classic_external_0qoqh-q5drsgn.js +0 -57
  839. package/.next/server/chunks/node_modules_zod_v4_classic_external_14kwlambv9opd.js +0 -3
  840. package/.next/server/chunks/node_modules_zod_v4_classic_external_17gmk506tz413.js +0 -3
  841. package/.next/server/chunks/node_modules_zod_v4_classic_external_1b_q1zc0x8d76.js +0 -3
  842. package/.next/server/chunks/node_modules_zod_v4_classic_external_1exeae-p81c94.js +0 -3
  843. package/.next/server/chunks/node_modules_zod_v4_classic_external_1giv406od1whf.js +0 -3
  844. package/.next/server/chunks/node_modules_zod_v4_classic_external_1wq100x5o7-hi.js +0 -3
  845. package/.next/server/chunks/node_modules_zod_v4_classic_external_1x8fhte3frhrw.js +0 -3
  846. package/.next/server/chunks/src_0bhf345rd7jho._.js +0 -3
  847. package/.next/server/chunks/src_lib_0dxltm34zaclb._.js +0 -3
  848. package/.next/server/chunks/src_lib_0g4wu08m-gibu._.js +0 -3
  849. package/.next/server/chunks/src_lib_0l0j89xrerf8m._.js +0 -3
  850. package/.next/server/chunks/src_lib_0n6nhl7_avcme._.js +0 -3
  851. package/.next/server/chunks/src_lib_0so-2topfosjo._.js +0 -3
  852. package/.next/server/chunks/src_lib_0z4je8wchtdws._.js +0 -3
  853. package/.next/server/chunks/src_lib_15op6xa369-51._.js +0 -3
  854. package/.next/server/chunks/src_lib_1_p9kz6i8to9n._.js +0 -3
  855. package/.next/server/chunks/src_lib_1d0nldjpxxl8t._.js +0 -3
  856. package/.next/server/chunks/src_lib_1oc3awtm80lqn._.js +0 -3
  857. package/.next/server/chunks/src_lib_1t_-lm7x_gu08._.js +0 -3
  858. package/.next/server/chunks/src_lib_constants_pagination_ts_0tz3fg9ib3b-w._.js +0 -3
  859. package/.next/server/chunks/src_lib_recoverable-response_ts_00y54idhlj_0e._.js +0 -3
  860. package/.next/server/chunks/src_lib_short-id_0adg7-htn2dq_._.js +0 -3
  861. package/.next/server/chunks/ssr/[root-of-the-server]__0py1t7q9ntzgc._.js +0 -3
  862. package/.next/server/chunks/ssr/[root-of-the-server]__12_3pzn1_i3p7._.js +0 -3
  863. package/.next/server/chunks/ssr/[root-of-the-server]__1vwegr-t8j6qe._.js +0 -3
  864. package/.next/server/chunks/ssr/_0_m51opjnip8x._.js +0 -32
  865. package/.next/server/chunks/ssr/_0qs44fqs7b5wd._.js +0 -3
  866. package/.next/server/chunks/ssr/_1cpvkaqiyve6g._.js +0 -3
  867. package/.next/server/chunks/ssr/_1d3pxsso6zv_w._.js +0 -3
  868. package/.next/server/chunks/ssr/_1ore70w45768b._.js +0 -3
  869. package/.next/server/chunks/ssr/_1sztendo5e5tf._.js +0 -3
  870. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0bew68i643j53._.js +0 -33
  871. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892nagajq.js +0 -3
  872. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0-4c5fuxx178f.js +0 -3
  873. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0-620erc29b8l.js +0 -3
  874. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_02t4jbzz34_x5.js +0 -3
  875. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_06zp_1r4dyujd.js +0 -3
  876. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_07zpyh6_aix9e.js +0 -3
  877. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_08b8vpe4ydv2l.js +0 -3
  878. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0927yli_zsjiv.js +0 -3
  879. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0ab39qicq17ku.js +0 -3
  880. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0d5g5-w_y282q.js +0 -3
  881. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0dq5iwc4xesq1.js +0 -3
  882. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0g591s5nyuj20.js +0 -3
  883. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0mfa8uq-ofoud.js +0 -3
  884. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0pdc0gl8iqtfa.js +0 -3
  885. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0tz1eth8tnoyx.js +0 -3
  886. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_14rvnul2svrv8.js +0 -3
  887. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_15yshykizhy_t.js +0 -3
  888. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_17vx074zs1h7f.js +0 -3
  889. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_18uzvmzy5tpu_.js +0 -3
  890. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_196bmtjcgr159.js +0 -3
  891. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1a9z9hjfg293y.js +0 -3
  892. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1aq9r3iw9g7qi.js +0 -3
  893. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1e1odqisoi2pv.js +0 -3
  894. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1l6unubiwsg9f.js +0 -3
  895. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1ya73f4o4_7mr.js +0 -3
  896. package/.next/static/chunks/0a-rekt06v0sv.js +0 -1
  897. package/.next/static/chunks/0mnb66hvp3czv.js +0 -2
  898. package/.next/static/chunks/0mun2h4uaj4eh.js +0 -1
  899. package/.next/static/chunks/0qb4cgf04m6y_.js +0 -1
  900. package/.next/static/chunks/0ykhi6pk49so-.js +0 -1
  901. package/.next/static/chunks/0zx49lemqph3o.js +0 -1
  902. package/.next/static/chunks/185736qwog1ar.js +0 -1
  903. package/.next/static/chunks/1jsd1qdcjh3ht.js +0 -198
  904. package/.next/static/chunks/1k2m_f0nu22fb.js +0 -1
  905. package/.next/static/chunks/1nef598mkxf9g.js +0 -1
  906. package/.next/static/chunks/2-m8at3d9m9fl.js +0 -38
  907. package/.next/static/chunks/21jkvmvb2mzaa.js +0 -1
  908. package/.next/static/chunks/21qaa-gzvurvc.js +0 -1
  909. package/.next/static/chunks/263d57goy87o4.js +0 -31
  910. package/.next/static/chunks/343yopry-myz8.js +0 -2
  911. package/.next/static/chunks/3_5fscrh8uxav.css +0 -3
  912. package/.next/static/chunks/3lvul9moygg-1.js +0 -16
  913. /package/.next/static/{oMYEAS-Ug2KhwHuve1br9 → T6hfqhqpSQ_GF78vCYl3P}/_buildManifest.js +0 -0
  914. /package/.next/static/{oMYEAS-Ug2KhwHuve1br9 → T6hfqhqpSQ_GF78vCYl3P}/_clientMiddlewareManifest.js +0 -0
  915. /package/.next/static/{oMYEAS-Ug2KhwHuve1br9 → T6hfqhqpSQ_GF78vCYl3P}/_ssgManifest.js +0 -0
@@ -52,4 +52,4 @@ ${t.join("\n")}
52
52
 
53
53
  `)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),c=n(c,d),l)?rg([],f,c,d,r,e,d?.abortEarly===!0):c:i(c,d):(c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c)}});function rz(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let i=e.filter(e=>!ep(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>e_(e,r,eH())))}),t)}let rw=eV("$ZodUnion",(e,t)=>{nA.init(e,t),eM(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),eM(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eM(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),eM(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>k(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,a=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>rz(t,r,e,i)):rz(a,r,e,i)}});function rk(e,t,n,r){let i=[];for(let t=0;t<e.length;t++)0===e[t].issues.length&&i.push(t);return 1===i.length?t.value=e[i[0]].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>e_(e,r,eH())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:i}),t}(e,t)=>{rw.init(e,t),t.inclusive=!1;let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let o=!1,a=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(a.push(t),o=!0):a.push(t)}return o?Promise.all(a).then(t=>rk(t,r,e,i)):rk(a,r,e,i)}},(e,t)=>{t.inclusive=!1,rw.init(e,t);let n=e._zod.parse;eM(e,"propValues",e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);for(let[r,o]of(i[e.def.discriminator]?.has(void 0)&&n++,Object.entries(i)))for(let e of(Object.prototype.hasOwnProperty.call(t,r)||x(t,r,new Set),o))t[r].add(e)}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=A(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=z(()=>(function(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||0===r.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t})(t));e._zod.parse=(i,o)=>{let a=i.value;if(!J(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let s=a?.[t.discriminator],u=r.value.get(s);return u&&(void 0!==s||"backward"!==o.direction)?u._zod.run(i,o):t.unionFallback||"backward"===o.direction?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>null!==r.value.get(e)),input:a,path:[t.discriminator],inst:e}),i)}};let r$=eV("$ZodIntersection",(e,t)=>{nA.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,n])=>rO(e,t,n)):rO(e,i,o)}});function rO(e,t,n){let r,i=new Map,o=new Map,a=(e,t)=>{let n;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);o.has(t)||o.set(t,e),n=[t]}else r??(r=e),n=e.keys;for(let e of n)i.has(e)||i.set(e,{}),i.get(e)[t]=!0;return!0};for(let n of t.issues)a(n,"l")||e.issues.push(n);for(let t of n.issues)a(t,"r")||e.issues.push(t);let s=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=r?s.filter(e=>r.keys.includes(e)):[];for(let n of(t.length&&e.issues.push({...r,keys:t}),s))!t.includes(n)&&o.has(n)&&e.issues.push(o.get(n))}let u=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(B(t)&&B(n)){let r=Object.keys(n),i=Object.keys(t).filter(e=>-1!==r.indexOf(e)),o={...t,...n};for(let r of(Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__,i)){if("__proto__"===r)continue;let i=e(t[r],n[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};o[r]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let o=e(t[i],n[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!u.valid){if(ep(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}let rS=eV("$ZodTuple",(e,t)=>{nA.init(e,t);let n=t.items,r=eX.memoizer;r?.attach(e),e._zod.parse=(i,o)=>{let a=i.value;if(!Array.isArray(a))return i.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=r?r.alloc(e,i,[],o):[];let s=[],u=rP(n,"optin"),l=rP(n,"optout");if(!t.rest){if(a.length<u)return i.issues.push({code:"too_small",minimum:u,inclusive:!0,input:a,inst:e,origin:"array"}),i;a.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:a,inst:e,origin:"array"})}let c=Array(n.length),d=t.rest?o?.abortEarly:void 0,f=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},o);t instanceof Promise?s.push(t.then(t=>{c[e]=t})):(c[e]=t,d&&!f&&t.issues.length&&(f=ep(t)))}if(t.rest&&!f){let e=n.length-1,r=a.slice(n.length),u=i.issues.length;for(let n of r){if(d&&i.issues.length!==u){if(ep(i,u))break;u=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},o);r instanceof Promise?s.push(r.then(t=>rx(t,i,e))):rx(r,i,e)}}return s.length?Promise.all(s).then(()=>rA(c,i,n,a,l)):rA(c,i,n,a,l)}});function rP(e,t){for(let n=e.length-1;n>=0;n--)if(!("optin"===t?void 0!==e[n]._zod.optin:"optional"===e[n]._zod.optout))return n+1;return 0}function rx(e,t,n){e.issues.length&&t.issues.push(...em(n,e.issues)),t.value[n]=e.value}function rA(e,t,n,r,i){for(let o=0;o<n.length;o++){let a=e[o],s=o<r.length;if(!s&&o>=i&&"optional"===n[o]._zod.optin){t.value.length=o;break}if(a.issues.length){if(!s&&o>=i){t.value.length=o;break}t.issues.push(...em(o,a.issues))}t.value[o]=a.value}for(let e=t.value.length-1;e>=r.length;e--)if("optional"===n[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}let rZ=eV("$ZodRecord",(e,t)=>{nA.init(e,t);let n=eX.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!B(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let a=[],s=t.keyType._zod.values;if(s&&!t.partial){let u;r.value=n?n.alloc(e,r,{},i):{};let l=new Set;for(let n of s)if("string"==typeof n||"number"==typeof n||"symbol"==typeof n){if(l.add("number"==typeof n?n.toString():n),"__proto__"===n)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>e_(e,i,eH())),input:n,path:[n],inst:e});continue}let u=s.value;if("__proto__"===u)continue;let c=t.valueType._zod.run({value:o[n],issues:[]},i);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&r.issues.push(...em(n,e.issues)),r.value[u]=e.value})):(c.issues.length&&r.issues.push(...em(n,c.issues)),r.value[u]=c.value)}for(let e in o)if(!l.has(e))if("loose"===t.mode){if("__proto__"===e)continue;r.value[e]=o[e]}else(u=u??[]).push(e);u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:u,continue:!0})}else{let u;for(let l of(r.value=n?n.alloc(e,r,{},i):{},Reflect.ownKeys(o))){if("__proto__"===l||!Object.prototype.propertyIsEnumerable.call(o,l))continue;let n=t.keyType._zod.run({value:l,issues:[]},i);if(n instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof l&&tE.test(l)&&n.issues.length){let e=t.keyType._zod.run({value:Number(l),issues:[]},i);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(n=e)}if(n.issues.length){"loose"===t.mode?r.value[l]=o[l]:s?(u=u??[]).push(l):r.issues.push({code:"invalid_key",origin:"record",issues:n.issues.map(e=>e_(e,i,eH())),input:l,path:[l],inst:e});continue}let c=n.value;if("__proto__"===c)continue;let d=t.valueType._zod.run({value:o[l],issues:[]},i);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&r.issues.push(...em(l,e.issues)),r.value[c]=e.value})):(d.issues.length&&r.issues.push(...em(l,d.issues)),r.value[c]=d.value)}u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:u,continue:!0})}return a.length?Promise.all(a).then(()=>r):r}});function rT(e,t,n,r,i,o,a){e.issues.length&&(G.has(typeof r)?n.issues.push(...em(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(e=>e_(e,a,eH()))})),t.issues.length&&(G.has(typeof r)?n.issues.push(...em(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:r,issues:t.issues.map(e=>e_(e,a,eH()))})),n.value.set(e.value,t.value)}function rE(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{nA.init(e,t);let n=eX.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:e}),r;let a=[];r.value=n?n.alloc(e,r,new Map,i):new Map;let s=i?.abortEarly,u=r.issues.length;for(let[n,l]of o){if(s&&r.issues.length!==u){if(ep(r,u))break;u=r.issues.length}let c=t.keyType._zod.run({value:n,issues:[]},i),d=t.valueType._zod.run({value:l,issues:[]},i);c instanceof Promise||d instanceof Promise?a.push(Promise.all([c,d]).then(([t,a])=>{rT(t,a,r,n,o,e,i)})):rT(c,d,r,n,o,e,i)}return a.length?Promise.all(a).then(()=>r):r},rl(e,rd)},(e,t)=>{nA.init(e,t);let n=eX.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:e,expected:"set",code:"invalid_type"}),r;let a=[];r.value=n?n.alloc(e,r,new Set,i):new Set;let s=i?.abortEarly,u=r.issues.length;for(let e of o){if(s&&r.issues.length!==u){if(ep(r,u))break;u=r.issues.length}let n=t.valueType._zod.run({value:e,issues:[]},i);n instanceof Promise?a.push(n.then(e=>rE(e,r))):rE(n,r)}return a.length?Promise.all(a).then(()=>r):r},rl(e,rf)};let rj=eV("$ZodEnum",(e,t)=>{nA.init(e,t);let n=v(t.entries),r=new Set(n);e._zod.values=r,eM(e,"pattern",e=>{let t=v(e.def.entries).filter(e=>G.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>H(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,i)=>{let o=t.value;return r.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),rN=eV("$ZodLiteral",(e,t)=>{nA.init(e,t);let n=new Set(t.values);e._zod.values=n,eM(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?H(e):e?H(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,i)=>{let o=r.value;return n.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),rI=((e,t)=>{nA.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}},eV("$ZodTransform",(e,t)=>{nA.init(e,t),e._zod.optin="optional",eX.memoizer?.guard(e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new eG(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new eW;return n.value=i,n}}));function rD(e,t){return e.value=t.issues.length?void 0:t.value,e}let rR=eV("$ZodOptional",(e,t)=>{nA.init(e,t),eM(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",eM(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),eM(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${k(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>rD(e,t)):rD(e,r)}return t.innerType._zod.run(e,n)}}),rF=eV("$ZodExactOptional",(e,t)=>{rR.init(e,t),eM(e,"values",e=>e.def.innerType._zod.values),eM(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),rC=eV("$ZodNullable",(e,t)=>{nA.init(e,t),eM(e,"optin",e=>e.def.innerType._zod.optin),eM(e,"optout",e=>e.def.innerType._zod.optout),eM(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${k(t.source)}|null)$`):void 0}),eM(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),rM=eV("$ZodDefault",(e,t)=>{nA.init(e,t),e._zod.optin="defaulted",eM(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>rU(e,t)):rU(r,t)}});function rU(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let rJ=eV("$ZodPrefault",(e,t)=>{nA.init(e,t),e._zod.optin="defaulted",eM(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),rL=eV("$ZodNonOptional",(e,t)=>{nA.init(e,t),eM(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>rB(t,e)):rB(i,e)}});function rB(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function rK(e,t,n,r){return t.issues.length?e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>e_(e,r,eH()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}(e,t)=>{nA.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new eG("ZodSuccess");let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}};let rV=eV("$ZodCatch",(e,t)=>{nA.init(e,t),eM(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),eM(e,"optout",e=>e.def.innerType._zod.optout),eM(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>rK(e,r,t,n)):rK(e,r,t,n)}}),rW=((e,t)=>{nA.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},eV("$ZodPipe",(e,t)=>{nA.init(e,t),eM(e,"values",e=>e.def.in._zod.values),eM(e,"optin",e=>e.def.in._zod.optin),eM(e,"optout",e=>e.def.out._zod.optout),eM(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>rG(e,t.in,n)):rG(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>rG(e,t.out,n)):rG(r,t.out,n)}}));function rG(e,t,n){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function rX(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>rH(e,r,t.out,n)):rH(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>rH(e,r,t.in,n)):rH(e,r,t.in,n)}}function rH(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}(e,t)=>{nA.init(e,t),eM(e,"values",e=>e.def.in._zod.values),eM(e,"optin",e=>e.def.in._zod.optin),eM(e,"optout",e=>e.def.out._zod.optout),eM(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>rX(e,t,n)):rX(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>rX(e,t,n)):rX(r,t,n)}}},(e,t)=>{rW.init(e,t)};let rq=eV("$ZodReadonly",(e,t)=>{nA.init(e,t),eM(e,"propValues",e=>e.def.innerType._zod.propValues),eM(e,"values",e=>e.def.innerType._zod.values),eM(e,"optin",e=>e.def.innerType?._zod?.optin),eM(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(rY):rY(r)}});function rY(e){return e.memo||(e.value=Object.freeze(e.value)),e}(e,t)=>{nA.init(e,t);let n=[];for(let e of t.parts)if("object"==typeof e&&null!==e){let t=function e(t){let n=t._zod.def,r=t._zod.pattern?.source,i=n.innerType??t._zod.innerType;if(i){let t=i._zod.pattern?.source,n=e(i);return r&&t&&n&&n!==t?r.replace(k(t),()=>k(n)):r}if(n.options){let t=n.options.map(e);if(t.every(Boolean))return`^(${t.map(e=>k(e)).join("|")})$`}return function(e){let t,n,r=e._zod.def,i=r.pattern,o=!!r.format?.includes("int");for(let e of r.checks??[]){let r=e._zod.def;r.pattern&&(i=r.pattern),o||(o=!!r.format?.includes("int"));let a=r.minimum??r.length,s=r.maximum??r.length;void 0!==a&&(void 0===t||a>t)&&(t=a),void 0!==s&&(void 0===n||s<n)&&(n=s)}if(i)return i.source;if(void 0!==t&&void 0!==n&&t>n)return"(?!)";if(void 0!==t||void 0!==n)return tA({minimum:t,maximum:n}).source;let a=e._zod.pattern;return(o&&a===tE?tT:a)?.source}(t)}(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);n.push(k(t))}else if(null===e||X.has(typeof e))n.push(H(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>("string"!=typeof n.value?n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),n)},(e,t)=>{nA.init(e,t),S(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),eM(e,"pattern",e=>e.innerType?._zod?.pattern),eM(e,"propValues",e=>e.innerType?._zod?.propValues),eM(e,"optin",e=>e.innerType?._zod?.optin??void 0),eM(e,"optout",e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)};let rQ=eV("$ZodCustom",(e,t)=>{tH.init(e,t),nA.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>r0(t,n,r,e));r0(i,n,r,e)}});function r0(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(eO(e))}}function r1(e){return e.checks&&(e.checks=[...e.checks]),e}function r4(e,t){return new t0({check:"less_than",...Y(t),value:e,inclusive:!1})}function r2(e,t){return new t0({check:"less_than",...Y(t),value:e,inclusive:!0})}function r9(e,t){return new t1({check:"greater_than",...Y(t),value:e,inclusive:!1})}function r6(e,t){return new t1({check:"greater_than",...Y(t),value:e,inclusive:!0})}function r3(e,t){return new t4({check:"multiple_of",...Y(t),value:e})}function r5(e,t){return new t8({check:"max_length",...Y(t),maximum:e})}function r8(e,t){return new t7({check:"min_length",...Y(t),minimum:e})}function r7(e,t){return new ne({check:"length_equals",...Y(t),length:e})}function ie(e){return new nl({check:"overwrite",tx:e})}e.i(682358);var it,ir,ii=e.i(922143),ii=ii,io=ii,ia=ii,is=ii,iu=ii,il=ii,ic=ii,id=ii,ip=ii,ih=ii,im=ii,iy=ii,iv=ii,ig=ii,i_=ii,ib=ii;function iz(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&x(e,t,n[t]);return e}function iw(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??e6,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ik(e,t,n,r,i){let o="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if("any"===o)return!1;if(void 0===o||"throw"===o)throw Error(i);return Object.assign(n,o),!0}function i$(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,r);else{let n=a.schema,o=t.processors[i.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,n,r)}let o=e._zod.parent;o&&(a.ref||(a.ref=o),i$(o,t,r),t.seen.get(o).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&iz(a.schema,u),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function iO(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function iS(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:o}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${r}/${iO(o)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:"#"};let o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:i+iO(o)}})(t);r.def={...r.schema},o&&(r.defId=o);let a=r.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
54
54
 
55
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle){i(n);continue}r.count>1&&"ref"===e.reused&&i(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}let iP=new Set(["type","properties","required","additionalProperties"]),ix=["oneOf","anyOf"];function iA(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function iZ(e){let t=[];for(let n of e){if("object"!=typeof n||"object"!==n.type)return null;for(let e in n)if(!iP.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??iA(n);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}x(n,r,1===e.length?e[0]:iZ(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=iA(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function iT(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let i=n.def??n.schema,o={...i},a=n.ref;if(n.ref=null,a){r(a);let n=e.seen.get(a),s=n.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(s)):iz(i,s),iz(i,o),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(s.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==a){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let n=t.anyOf;if(!Array.isArray(n)||0===n.length||void 0!==t.type)return;let r=[];for(let t of n){if(!t||"object"!=typeof t)return;e(t);let n=Object.keys(t);if(1!==n.length||"type"!==n[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;r.includes(e)||r.push(e)}}delete t.anyOf,t.type=1===r.length?r[0]:r}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of iP)if(t in e)return;let n=t.filter(e=>ix.some(t=>Array.isArray(e[t]))),r=null;if(n.length){let e=n[0],i=ix.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let o=t.filter(t=>t!==e),a=e[i].map(e=>iZ([...o,e]));if(a.some(e=>!e))return;r={[i]:a}}else r=iZ(t);r&&(delete e.allOf,iz(e,r))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}iz(i,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&i.id===o&&delete i.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,x(a,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:iE(t,"input",e.processors),output:iE(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let iE=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r??{},a=iw({...i??{},target:o,io:t,processors:n});return i$(e,a),iS(a,e),iT(a,e)},ij=(e,t,n)=>{(void 0===e[t]||n>e[t])&&(e[t]=n)},iN=(e,t,n)=>{(void 0===e[t]||n<e[t])&&(e[t]=n)},iI=(e,t)=>{ij(e,"minimum",t),iN(e,"maximum",t)},iD=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},iR=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},iF=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},iC=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},iM=(e,t)=>ij(e,"minimum",t.minimum),iU=(e,t)=>iN(e,"maximum",t.maximum),iJ=e=>(t,n)=>{iC(t,n.format);let[r,i]=e[n.format];ij(t,"minimum",r),iN(t,"maximum",i)},iL={greater_than:(e,t)=>ij(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>iN(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>iD(e,t.value),number_format:iJ(en),bigint_format:iJ(er),min_length:iM,max_length:iU,length_equals:(e,t)=>iI(e,t.length),min_size:iM,max_size:iU,size_equals:(e,t)=>iI(e,t.size),string_format:(e,t)=>{iC(e,t.format),t.pattern&&iR(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>iF(e,t.mime)};function iB(e){let t={},n=e._zod.def;for(let r of e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[])iL[r._zod.def.check]?.(t,r._zod.def);let r=e._zod.bag;for(let e of(void 0!==r.minimum&&ij(t,"minimum",r.minimum),void 0!==r.exclusiveMinimum&&ij(t,"exclusiveMinimum",r.exclusiveMinimum),void 0!==r.maximum&&iN(t,"maximum",r.maximum),void 0!==r.exclusiveMaximum&&iN(t,"exclusiveMaximum",r.exclusiveMaximum),void 0!==r.multipleOf&&iD(t,r.multipleOf),void 0!==r.format&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&iF(t,r.mime),r.patterns??[]))iR(t,e);return t}let iK={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},iV=new Map([[n3,tv],[n8,tg]]),iW=e=>iV.get(e)??e;function iG(e){let t=e._zod.def;return"pipe"===t.type&&t.in._zod.traits.has("$ZodTransform")?iG(t.out):"catch"===t.type?iG(t.innerType):e._zod.optin}let iX=new WeakMap,iH=Symbol();function iq(e,t,n,r,i){let o=!1,a=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(o=!0,null));return o?(ik(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),iH):JSON.parse(a)}let iY=(e,t,n,r)=>{let i=e._zod.def;i$(i.innerType,t,r),t.seen.get(e).ref=i.innerType},iQ=new WeakSet([Object.prototype,Error.prototype]);function i0(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let i1=eV("ZodError",(e,t)=>{nm.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);iQ.has(n)||(iQ.add(n),i0(n,"format",e=>t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length)n._errors.push(t(o));else{let r=n,i=0;for(;i<e.length;){let n=e[i],a=i===e.length-1;if("_errors"===n){a&&r._errors.push(t(o)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];a&&s._errors.push(t(o)),r=s,i++}}}};return r(e),n})(e,t)),i0(n,"flatten",e=>t=>(function(e,t=e=>e.message){let n={},r=[];for(let a of e.issues)if(a.path.length>0){var i,o;(i=a.path[0],o=()=>[],!Object.prototype.hasOwnProperty.call(n,i)&&("__proto__"===i?Object.defineProperty(n,i,{value:o(),writable:!0,enumerable:!0,configurable:!0}):n[i]=o()),n[i]).push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}})(e,t)),i0(n,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,_,2)}),i0(n,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,_,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error});e.s(["ZodRealError",0,i1],789282);let i4=ng(i1),i2=nb(i1),i9=nw(i1),i6=n$(i1),i3=(r=ng(i1),i=(e,t,n,o)=>r(e,t,n?{...n,direction:"backward"}:{direction:"backward"},nv(i,o))),i5=(o=ng(i1),a=(e,t,n,r)=>o(e,t,n,nv(a,r))),i8=(s=nb(i1),u=async(e,t,n,r)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return await s(e,t,i,nv(u,r))}),i7=(l=nb(i1),c=async(e,t,n,r)=>await l(e,t,n,nv(c,r))),oe=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return nw(i1)(e,t,r)},ot=(e,t,n)=>nw(i1)(e,t,n),on=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return n$(i1)(e,t,r)},or=async(e,t,n)=>n$(i1)(e,t,n);function oi(){eX.memoizer||eH({memoizer:e9})}let oo=eV("ZodType",(e,t)=>(eX.localeError||eH({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function r(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?n[e]??e:String(t)}return n=>{switch(n.code){case"invalid_type":{let e=r(n.expected),t=r(e$(n.input),n.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${ee(n.values[0])}`;return`Invalid option: expected one of ${g(n.values,"|")}`;case"too_big":{let t=n.exact?"exactly ":n.inclusive?"<=":"<",r=e[n.origin]??null;if(r)return`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{let t=n.exact?"exactly ":n.inclusive?">=":">",r=e[n.origin]??null;if(r)return`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${r.unit}`;return`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${t[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${g(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0){let e=n.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===n.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}})()}),nA.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(io.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return q(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new ar({type:"custom",check:"custom",fn:e,...Y(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,i;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(eO(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(eO(e)))},e(t.value,t)),(i=new tH({check:"custom",...Y(t)}))._zod.check=n,r=i}(e,t))},overwrite(e){return this.check(ie(e))},optional(){return o4(this)},exactOptional(){var e;return e=this,new o2({type:"optional",innerType:e})},nullable(){return o6(this)},nullish(){return o4(o6(this))},nonoptional(e){var t,n;return t=this,n=e,new o8({type:"nonoptional",innerType:t,...il.normalizeParams(n)})},array(){return oL(this)},or(e){return new oV({type:"union",options:[this,e],...il.normalizeParams(void 0)})},and(e){var t;return t=this,new oW({type:"intersection",left:t,right:e})},transform(e){return at(this,new o0({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new o3({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():ib.shallowClone(n)}})},prefault(e){var t,n;return t=this,n=e,new o5({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():ib.shallowClone(n)}})},catch(e){var t,n;return t=this,new o7({type:"catch",innerType:t,catchValue:"function"==typeof(n=e)?n:ii.constantCatch(n)})},pipe(e){return at(this,e)},readonly(){var e;return e=this,new an({type:"readonly",innerType:e})},describe(e){let t=this.clone();return e6.add(t,{description:e}),t},meta(...e){if(0===e.length)return e6.get(this);let t=this.clone();return e6.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return ia.hide(this,"~standard",{...nE(this),jsonSchema:{input:iE(this,"input"),output:iE(this,"output")}})},set"~standard"(e){is.own(this,"~standard",e)},parse:function e(t,n){return i4(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await i2(this,t,n,{callee:e})},safeParse(e,t){return i9(this,e,t)},async safeParseAsync(e,t){return i6(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){is.own(this,"spa",e)},validate(e,t){let n=this._zod.bag.validator;if(void 0!==n){if(n(e)!==nO)return!0;if(!0===n.definite&&void 0===t)return!1}return function(e,t,n){let r,i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;if(o?(i[nS]=!0,r=o({value:t,issues:[]},i)):r=e._zod.run({value:t,issues:[]},i),r instanceof Promise)throw new eW;return 0===r.issues.length}(this,e,t)},validateAsync(e,t){return nP(this,e,t)},encode:function e(t,n){return i3(this,t,n,{callee:e})},decode:function e(t,n){return i5(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await i8(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await i7(this,t,n,{callee:e})},safeEncode(e,t){return oe(this,e,t)},safeDecode(e,t){return ot(this,e,t)},async safeEncodeAsync(e,t){return on(this,e,t)},async safeDecodeAsync(e,t){return or(this,e,t)},toJSONSchema(e){return((e,t={})=>n=>{let r=iw({...n,processors:t});return i$(e,r),iS(r,e),iT(r,e)})(this,{})(e)},get description(){return e6.get(this)?.description},get _def(){return this._zod.def}}),oa=eV("_ZodString",(e,t)=>{nj.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{n.type="string";let{minimum:r,maximum:i,format:o,patterns:a,contentEncoding:s,laxFormat:u}=iB(e);if("number"==typeof r&&(n.minLength=r),"number"==typeof i&&(n.maxLength=i),o&&(n.format=iK[o]??o,""===n.format&&delete n.format,("time"===o||u)&&delete n.format),s&&(n.contentEncoding=s),a&&a.size>0){let e=[...a].map(iW);1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n)},iu.derived({format:e=>iB(e).format??null,minLength:e=>iB(e).minimum??null,maxLength:e=>iB(e).maximum??null},{regex(...e){return this.check(function(e,t){return new nn({check:"string_format",format:"regex",...Y(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new no({check:"string_format",format:"includes",...Y(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new na({check:"string_format",format:"starts_with",...Y(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new ns({check:"string_format",format:"ends_with",...Y(t),suffix:e})}(...e))},min(...e){return this.check(r8(...e))},max(...e){return this.check(r5(...e))},length(...e){return this.check(r7(...e))},nonempty(...e){return this.check(r8(1,...e))},lowercase(e){return this.check(new nr({check:"string_format",format:"lowercase",...Y(e)}))},uppercase(e){return this.check(new ni({check:"string_format",format:"uppercase",...Y(e)}))},trim(){return this.check(ie(e=>e.trim()))},normalize(...e){return this.check(function(e){return ie(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(ie(e=>e.toLowerCase()))},toUpperCase(){return this.check(ie(e=>e.toUpperCase()))},slugify(){return this.check(ie(e=>M(e)))}})),os=eV("ZodString",(e,t)=>{nj.init(e,t),oa.init(e,t)},{email(e){return this.check(new oh({type:"string",format:"email",check:"string_format",abort:!1,...Y(e)}))},url(e){return this.check(new ov({type:"string",format:"url",check:"string_format",abort:!1,...Y(e)}))},jwt(e){return this.check(new oE({type:"string",format:"jwt",check:"string_format",abort:!1,...Y(e)}))},emoji(e){return this.check(new og({type:"string",format:"emoji",check:"string_format",abort:!1,...Y(e)}))},guid(e){return this.check(new om({type:"string",format:"guid",check:"string_format",abort:!1,...Y(e)}))},uuid(e){return this.check(new oy({type:"string",format:"uuid",check:"string_format",abort:!1,...Y(e)}))},uuidv4(e){return this.check(new oy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Y(e)}))},uuidv6(e){return this.check(new oy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Y(e)}))},uuidv7(e){return this.check(new oy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Y(e)}))},nanoid(e){return this.check(new o_({type:"string",format:"nanoid",check:"string_format",abort:!1,...Y(e)}))},cuid(e){return this.check(new ob({type:"string",format:"cuid",check:"string_format",abort:!1,...Y(e)}))},cuid2(e){return this.check(new oz({type:"string",format:"cuid2",check:"string_format",abort:!1,...Y(e)}))},ulid(e){return this.check(new ow({type:"string",format:"ulid",check:"string_format",abort:!1,...Y(e)}))},base64(e){return this.check(new oA({type:"string",format:"base64",check:"string_format",abort:!1,...Y(e)}))},base64url(e){return this.check(new oZ({type:"string",format:"base64url",check:"string_format",abort:!1,...Y(e)}))},xid(e){return this.check(new ok({type:"string",format:"xid",check:"string_format",abort:!1,...Y(e)}))},ksuid(e){return this.check(new o$({type:"string",format:"ksuid",check:"string_format",abort:!1,...Y(e)}))},ipv4(e){return this.check(new oO({type:"string",format:"ipv4",check:"string_format",abort:!1,...Y(e)}))},ipv6(e){return this.check(new oS({type:"string",format:"ipv6",check:"string_format",abort:!1,...Y(e)}))},cidrv4(e){return this.check(new oP({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Y(e)}))},cidrv6(e){return this.check(new ox({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Y(e)}))},e164(e){return this.check(new oT({type:"string",format:"e164",check:"string_format",abort:!1,...Y(e)}))},datetime(e){return this.check(new oc({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Y(e)}))},date(e){return this.check(new od({type:"string",format:"date",check:"string_format",...Y(e)}))},time(e){return this.check(new of({type:"string",format:"time",check:"string_format",precision:null,...Y(e)}))},duration(e){return this.check(new op({type:"string",format:"duration",check:"string_format",...Y(e)}))}});function ou(e){return new os(r1({type:"string",...Y(e)}))}let ol=eV("ZodStringFormat",(e,t)=>{nN.init(e,t),oa.init(e,t)}),oc=eV("ZodISODateTime",(e,t)=>{nX.init(e,t),ol.init(e,t)}),od=eV("ZodISODate",(e,t)=>{nH.init(e,t),ol.init(e,t)}),of=eV("ZodISOTime",(e,t)=>{nq.init(e,t),ol.init(e,t)}),op=eV("ZodISODuration",(e,t)=>{nY.init(e,t),ol.init(e,t)}),oh=eV("ZodEmail",(e,t)=>{nR.init(e,t),ol.init(e,t)}),om=eV("ZodGUID",(e,t)=>{nI.init(e,t),ol.init(e,t)}),oy=eV("ZodUUID",(e,t)=>{nD.init(e,t),ol.init(e,t)}),ov=eV("ZodURL",(e,t)=>{nU.init(e,t),ol.init(e,t)}),og=eV("ZodEmoji",(e,t)=>{nJ.init(e,t),ol.init(e,t)}),o_=eV("ZodNanoID",(e,t)=>{nL.init(e,t),ol.init(e,t)}),ob=eV("ZodCUID",(e,t)=>{nB.init(e,t),ol.init(e,t)}),oz=eV("ZodCUID2",(e,t)=>{nK.init(e,t),ol.init(e,t)}),ow=eV("ZodULID",(e,t)=>{nV.init(e,t),ol.init(e,t)}),ok=eV("ZodXID",(e,t)=>{nW.init(e,t),ol.init(e,t)}),o$=eV("ZodKSUID",(e,t)=>{nG.init(e,t),ol.init(e,t)}),oO=eV("ZodIPv4",(e,t)=>{nQ.init(e,t),ol.init(e,t)}),oS=eV("ZodIPv6",(e,t)=>{n4.init(e,t),ol.init(e,t)}),oP=eV("ZodCIDRv4",(e,t)=>{n2.init(e,t),ol.init(e,t)}),ox=eV("ZodCIDRv6",(e,t)=>{n9.init(e,t),ol.init(e,t)}),oA=eV("ZodBase64",(e,t)=>{n5.init(e,t),ol.init(e,t)}),oZ=eV("ZodBase64URL",(e,t)=>{n7.init(e,t),ol.init(e,t)}),oT=eV("ZodE164",(e,t)=>{re.init(e,t),ol.init(e,t)}),oE=eV("ZodJWT",(e,t)=>{rn.init(e,t),ol.init(e,t)}),oj=eV("ZodNumber",(e,t)=>{rr.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:i,maximum:o,multipleOf:a,exclusiveMaximum:s,exclusiveMinimum:u,isInt:l}=iB(e);n.type=l?"integer":"number";let c="number"==typeof u&&u>=(i??-1/0),d="number"==typeof s&&s<=(o??1/0),f="draft-04"===t.target||"openapi-3.0"===t.target;if(c?f?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:"number"==typeof i&&(n.minimum=i),d?f?(n.maximum=s,n.exclusiveMaximum=!0):n.exclusiveMaximum=s:"number"==typeof o&&(n.maximum=o),a){let i=new Set;for(let o of a)Number.isFinite(o)&&0!==o?i.add(Math.abs(o)):ik(e,t,n,r,`A multipleOf divisor of ${o} cannot be represented in JSON Schema`);let[o,...s]=i;void 0!==o&&(n.multipleOf=o),s.length&&(n.allOf=[...n.allOf??[],...s.map(e=>({multipleOf:e}))])}})(e,t,n,r),e.isFinite=!0},iu.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=iB(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=iB(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=iB(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>iB(e).format??null},{gt(e,t){return this.check(r9(e,t))},gte(e,t){return this.check(r6(e,t))},min(e,t){return this.check(r6(e,t))},lt(e,t){return this.check(r4(e,t))},lte(e,t){return this.check(r2(e,t))},max(e,t){return this.check(r2(e,t))},int(e){return this.check(oD(e))},safe(e){return this.check(oD(e))},positive(e){return this.check(r9(0,e))},nonnegative(e){return this.check(r6(0,e))},negative(e){return this.check(r4(0,e))},nonpositive(e){return this.check(r2(0,e))},multipleOf(e,t){return this.check(r3(e,t))},step(e,t){return this.check(r3(e,t))},finite(){return this}}));function oN(e){return new oj(r1({type:"number",checks:[],...Y(e)}))}let oI=eV("ZodNumberFormat",(e,t)=>{ri.init(e,t),oj.init(e,t)});function oD(e){return new oI({type:"number",check:"number_format",abort:!1,format:"safeint",...Y(e)})}let oR=eV("ZodBoolean",(e,t)=>{ro.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function oF(e){return new oR({type:"boolean",...Y(e)})}(e,t)=>{ra.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{ik(e,t,n,r,"BigInt cannot be represented in JSON Schema")}};let oC=eV("ZodUnknown",(e,t)=>{rs.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function oM(){return new oC({type:"unknown"})}let oU=eV("ZodNever",(e,t)=>{ru.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),oJ=eV("ZodArray",(e,t)=>{oi(),rh.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,{minimum:o,maximum:a}=iB(e);"number"==typeof o&&(n.minItems=o),"number"==typeof a&&(n.maxItems=a),n.type="array",n.items=i$(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element},{min(e,t){return this.check(r8(e,t))},nonempty(e){return this.check(r8(1,e))},max(e,t){return this.check(r5(e,t))},length(e,t){return this.check(r7(e,t))},unwrap(){return this.element}});function oL(e,t){return new oJ({type:"array",element:e,...Y(t)})}let oB=eV("ZodObject",(e,t)=>{oi(),rb.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&ik(e,t,n,r,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in n.type="object",n.properties={},o)x(n.properties,e,i$(o[e],t,{...r,path:[...r.path,"properties",e]}));let a=[];for(let e of Object.keys(o)){let n=i.shape[e];("input"===t.io?void 0===iG(n):void 0===n._zod.optout)&&a.push(e)}a.length>0&&(n.required=a),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=i$(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),ig.installLazyProp(e,"shape",e=>e._zod.def.shape,!1)},{keyof(){return oq(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(io.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(io.mergeDefs(this._zod.def,{catchall:oM()}))},loose(){return this.clone(io.mergeDefs(this._zod.def,{catchall:oM()}))},strict(){return this.clone(io.mergeDefs(this._zod.def,{catchall:new oU({type:"never",...Y(void 0)})}))},strip(){return this.clone(io.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return ic.extend(this,e)},safeExtend(e){return id.safeExtend(this,e)},merge(e){return ip.merge(this,e)},pick(e){return ih.pick(this,e)},omit(e){return im.omit(this,e)},partial(...e){return iy.partial(o1,this,e[0])},exactPartial(...e){return iy.partial(o2,this,e[0],"exactPartial")},required(...e){return iv.required(o8,this,e[0])}});function oK(e,t){return new oB({type:"object",shape:e??{},...il.normalizeParams(t)})}let oV=eV("ZodUnion",(e,t)=>{rw.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{var i,o,a,s;let u,l,c;return i=e,o=t,a=n,s=r,l=!1===(u=i._zod.def).inclusive,c=u.options.map((e,t)=>i$(e,o,{...s,path:[...s.path,l?"oneOf":"anyOf",t]})),void(l?a.oneOf=c:a.anyOf=c)},e.options=t.options}),oW=eV("ZodIntersection",(e,t)=>{r$.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a,s,u;return o=i$((i=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),a=i$(i.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=u=[...(s=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...s(a)?a.allOf:[a]],t.intersections.push(u))}}),oG=eV("ZodRecord",(e,t)=>{oi(),rZ.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="object";let o=i.keyType,a=iB(o).patterns;if("loose"===i.mode&&a&&a.size>0){let e=i$(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},a))x(n.patternProperties,iW(t).source,e)}else{if("draft-07"===t.target||"draft-2020-12"===t.target){n.propertyNames=i$(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let o=iX.get(t);o||(o=[],iX.set(t,o),t.deferred.push(()=>(function(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of iX.get(e)??[]){let i=e.seen.get(r),o=(i?.def??i?.schema)?.propertyNames;if(!o||!0===o||n.has(o))continue;let a=function e(t,n,r){if(n.$ref){if(r.has(n))return n;r.add(n);let i=t.get(n)?.def;if(!i)return n;let o=e(t,i,r);return o===i?n:o}for(let i of["anyOf","oneOf"]){let o=n[i];if(!Array.isArray(o))continue;let a=o.map(n=>e(t,n,r));a.some((e,t)=>e!==o[t])&&(n={...n,[i]:a})}let i=Array.isArray(n.type)?n.type:[n.type],o=!i.includes("string")&&i.some(e=>"number"===e||"integer"===e),a=n.enum??(void 0!==n.const?[n.const]:void 0);if(!o&&!a?.some(e=>"number"==typeof e))return n;let{minimum:s,maximum:u,exclusiveMinimum:l,exclusiveMaximum:c,multipleOf:d,format:f,id:p,...h}=n;return h.enum?h.enum=h.enum.map(e=>"number"==typeof e?String(e):e):"number"==typeof h.const&&(h.const=String(h.const)),o&&(h.type="string",a||(h.pattern=(i.includes("number")?tE:tT).source)),h}(t,o,new Set);a!==o&&n.set(o,a)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}})(t))),o.push(e)}n.additionalProperties=i$(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let s=o._zod.values,u="input"===t.io&&void 0!==iG(i.valueType);if(s&&!i.partial&&!u){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e.map(String))}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function oX(e,t,n){return new oG(t&&t._zod?{type:"record",keyType:e,valueType:t,...il.normalizeParams(n)}:{type:"record",keyType:ou(),valueType:e,...il.normalizeParams(t)})}let oH=eV("ZodEnum",(e,t)=>{rj.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t)=>{let n=v(e._zod.def.entries);if(0===n.length){t.not={};return}n.every(e=>"number"==typeof e)&&(t.type="number"),n.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=n})(e,n),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new oH({...t,checks:[],...il.normalizeParams(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new oH({...t,checks:[],...il.normalizeParams(r),entries:i})}});function oq(e,t){return new oH({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...il.normalizeParams(t)})}let oY=eV("ZodLiteral",(e,t)=>{rN.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(0===i.values.length){n.not={};return}let o=[];for(let a of i.values)if(void 0===a){if(ik(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof a){if(ik(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(0===o.length);else if(1===o.length){let e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function oQ(e,t){return new oY({type:"literal",values:Array.isArray(e)?e:[e],...il.normalizeParams(t)})}let o0=eV("ZodTransform",(e,t)=>{oi(),rI.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{ik(e,t,n,r,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new eG(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(i_.issue(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=n.value),r.inst??(r.inst=e),n.issues.push(i_.issue(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),o1=eV("ZodOptional",(e,t)=>{rR.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function o4(e){return new o1({type:"optional",innerType:e})}let o2=eV("ZodExactOptional",(e,t)=>{rF.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),o9=eV("ZodNullable",(e,t)=>{rC.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=i$((i=e._zod.def).innerType,t,r),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function o6(e){return new o9({type:"nullable",innerType:e})}let o3=eV("ZodDefault",(e,t)=>{rM.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o;return i$((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,void((o=iq(i.defaultValue,e,t,n,r))!==iH&&(n.default=o))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),o5=eV("ZodPrefault",(e,t)=>{rJ.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(i$(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let o=iq(i.defaultValue,e,t,n,r);o!==iH&&(n._prefault=o)})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),o8=eV("ZodNonOptional",(e,t)=>{rL.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;i$((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),o7=eV("ZodCatch",(e,t)=>{rV.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i,o=e._zod.def;i$(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{ik(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),ae=eV("ZodPipe",(e,t)=>{rW.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(i$(a="input"===t.io?o?i.out:i.in:i.out,t,r),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function at(e,t){return new ae({type:"pipe",in:e,out:t})}let an=eV("ZodReadonly",(e,t)=>{rq.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;i$((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),ar=eV("ZodCustom",(e,t)=>{rQ.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{ik(e,t,n,r,"Custom types cannot be represented in JSON Schema")}});e.s(["array",0,oL,"boolean",0,oF,"enum",0,oq,"literal",0,oQ,"number",0,oN,"object",0,oK,"record",0,oX,"string",0,ou,"unknown",0,oM],362201),e.i(362201),e.s([],430421),e.i(430421),e.i(789282),e.s([],100364),e.i(100364),e.s([],458829),e.i(458829),e.s(["array",0,oL,"boolean",0,oF,"enum",0,oq,"literal",0,oQ,"number",0,oN,"object",0,oK,"record",0,oX,"string",0,ou,"unknown",0,oM],722219)}]);
55
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle){i(n);continue}r.count>1&&"ref"===e.reused&&i(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}let iP=new Set(["type","properties","required","additionalProperties"]),ix=["oneOf","anyOf"];function iA(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function iZ(e){let t=[];for(let n of e){if("object"!=typeof n||"object"!==n.type)return null;for(let e in n)if(!iP.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??iA(n);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}x(n,r,1===e.length?e[0]:iZ(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=iA(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function iT(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let i=n.def??n.schema,o={...i},a=n.ref;if(n.ref=null,a){r(a);let n=e.seen.get(a),s=n.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(s)):iz(i,s),iz(i,o),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(s.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==a){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let n=t.anyOf;if(!Array.isArray(n)||0===n.length||void 0!==t.type)return;let r=[];for(let t of n){if(!t||"object"!=typeof t)return;e(t);let n=Object.keys(t);if(1!==n.length||"type"!==n[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;r.includes(e)||r.push(e)}}delete t.anyOf,t.type=1===r.length?r[0]:r}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of iP)if(t in e)return;let n=t.filter(e=>ix.some(t=>Array.isArray(e[t]))),r=null;if(n.length){let e=n[0],i=ix.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let o=t.filter(t=>t!==e),a=e[i].map(e=>iZ([...o,e]));if(a.some(e=>!e))return;r={[i]:a}}else r=iZ(t);r&&(delete e.allOf,iz(e,r))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}iz(i,n.defId?n.schema:n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&i.id===o&&delete i.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,x(a,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:iE(t,"input",e.processors),output:iE(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let iE=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r??{},a=iw({...i??{},target:o,io:t,processors:n});return i$(e,a),iS(a,e),iT(a,e)},ij=(e,t,n)=>{(void 0===e[t]||n>e[t])&&(e[t]=n)},iN=(e,t,n)=>{(void 0===e[t]||n<e[t])&&(e[t]=n)},iI=(e,t)=>{ij(e,"minimum",t),iN(e,"maximum",t)},iD=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},iR=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},iF=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},iC=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},iM=(e,t)=>ij(e,"minimum",t.minimum),iU=(e,t)=>iN(e,"maximum",t.maximum),iJ=e=>(t,n)=>{iC(t,n.format);let[r,i]=e[n.format];ij(t,"minimum",r),iN(t,"maximum",i)},iL={greater_than:(e,t)=>ij(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>iN(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>iD(e,t.value),number_format:iJ(en),bigint_format:iJ(er),min_length:iM,max_length:iU,length_equals:(e,t)=>iI(e,t.length),min_size:iM,max_size:iU,size_equals:(e,t)=>iI(e,t.size),string_format:(e,t)=>{iC(e,t.format),t.pattern&&iR(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>iF(e,t.mime)};function iB(e){let t={},n=e._zod.def;for(let r of e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[])iL[r._zod.def.check]?.(t,r._zod.def);let r=e._zod.bag;for(let e of(void 0!==r.minimum&&ij(t,"minimum",r.minimum),void 0!==r.exclusiveMinimum&&ij(t,"exclusiveMinimum",r.exclusiveMinimum),void 0!==r.maximum&&iN(t,"maximum",r.maximum),void 0!==r.exclusiveMaximum&&iN(t,"exclusiveMaximum",r.exclusiveMaximum),void 0!==r.multipleOf&&iD(t,r.multipleOf),void 0!==r.format&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&iF(t,r.mime),r.patterns??[]))iR(t,e);return t}let iK={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},iV=new Map([[n3,tv],[n8,tg]]),iW=e=>iV.get(e)??e;function iG(e){let t=e._zod.def;return"pipe"===t.type&&t.in._zod.traits.has("$ZodTransform")?iG(t.out):"catch"===t.type?iG(t.innerType):e._zod.optin}let iX=new WeakMap,iH=Symbol();function iq(e,t,n,r,i){let o=!1,a=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(o=!0,null));return o?(ik(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),iH):JSON.parse(a)}let iY=(e,t,n,r)=>{let i=e._zod.def;i$(i.innerType,t,r),t.seen.get(e).ref=i.innerType},iQ=new WeakSet([Object.prototype,Error.prototype]);function i0(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let i1=eV("ZodError",(e,t)=>{nm.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);iQ.has(n)||(iQ.add(n),i0(n,"format",e=>t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length)n._errors.push(t(o));else{let r=n,i=0;for(;i<e.length;){let n=e[i],a=i===e.length-1;if("_errors"===n){a&&r._errors.push(t(o)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];a&&s._errors.push(t(o)),r=s,i++}}}};return r(e),n})(e,t)),i0(n,"flatten",e=>t=>(function(e,t=e=>e.message){let n={},r=[];for(let a of e.issues)if(a.path.length>0){var i,o;(i=a.path[0],o=()=>[],!Object.prototype.hasOwnProperty.call(n,i)&&("__proto__"===i?Object.defineProperty(n,i,{value:o(),writable:!0,enumerable:!0,configurable:!0}):n[i]=o()),n[i]).push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}})(e,t)),i0(n,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,_,2)}),i0(n,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,_,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error});e.s(["ZodRealError",0,i1],789282);let i4=ng(i1),i2=nb(i1),i9=nw(i1),i6=n$(i1),i3=(r=ng(i1),i=(e,t,n,o)=>r(e,t,n?{...n,direction:"backward"}:{direction:"backward"},nv(i,o))),i5=(o=ng(i1),a=(e,t,n,r)=>o(e,t,n,nv(a,r))),i8=(s=nb(i1),u=async(e,t,n,r)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return await s(e,t,i,nv(u,r))}),i7=(l=nb(i1),c=async(e,t,n,r)=>await l(e,t,n,nv(c,r))),oe=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return nw(i1)(e,t,r)},ot=(e,t,n)=>nw(i1)(e,t,n),on=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return n$(i1)(e,t,r)},or=async(e,t,n)=>n$(i1)(e,t,n);function oi(){eX.memoizer||eH({memoizer:e9})}let oo=eV("ZodType",(e,t)=>(eX.localeError||eH({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function r(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?n[e]??e:String(t)}return n=>{switch(n.code){case"invalid_type":{let e=r(n.expected),t=r(e$(n.input),n.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${ee(n.values[0])}`;return`Invalid option: expected one of ${g(n.values,"|")}`;case"too_big":{let t=n.exact?"exactly ":n.inclusive?"<=":"<",r=e[n.origin]??null;if(r)return`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{let t=n.exact?"exactly ":n.inclusive?">=":">",r=e[n.origin]??null;if(r)return`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${r.unit}`;return`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${t[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${g(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0){let e=n.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===n.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}})()}),nA.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(io.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return q(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new ao({type:"custom",check:"custom",fn:e,...Y(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,i;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(eO(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(eO(e)))},e(t.value,t)),(i=new tH({check:"custom",...Y(t)}))._zod.check=n,r=i}(e,t))},overwrite(e){return this.check(ie(e))},optional(){return o9(this)},exactOptional(){var e;return e=this,new o6({type:"optional",innerType:e})},nullable(){return o5(this)},nullish(){return o9(o5(this))},nonoptional(e){var t,n;return t=this,n=e,new ae({type:"nonoptional",innerType:t,...il.normalizeParams(n)})},array(){return oB(this)},or(e){return new oG({type:"union",options:[this,e],...il.normalizeParams(void 0)})},and(e){var t;return t=this,new oX({type:"intersection",left:t,right:e})},transform(e){return ar(this,new o4({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new o8({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():ib.shallowClone(n)}})},prefault(e){var t,n;return t=this,n=e,new o7({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():ib.shallowClone(n)}})},catch(e){var t,n;return t=this,new at({type:"catch",innerType:t,catchValue:"function"==typeof(n=e)?n:ii.constantCatch(n)})},pipe(e){return ar(this,e)},readonly(){var e;return e=this,new ai({type:"readonly",innerType:e})},describe(e){let t=this.clone();return e6.add(t,{description:e}),t},meta(...e){if(0===e.length)return e6.get(this);let t=this.clone();return e6.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return ia.hide(this,"~standard",{...nE(this),jsonSchema:{input:iE(this,"input"),output:iE(this,"output")}})},set"~standard"(e){is.own(this,"~standard",e)},parse:function e(t,n){return i4(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await i2(this,t,n,{callee:e})},safeParse(e,t){return i9(this,e,t)},async safeParseAsync(e,t){return i6(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){is.own(this,"spa",e)},validate(e,t){let n=this._zod.bag.validator;if(void 0!==n){if(n(e)!==nO)return!0;if(!0===n.definite&&void 0===t)return!1}return function(e,t,n){let r,i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;if(o?(i[nS]=!0,r=o({value:t,issues:[]},i)):r=e._zod.run({value:t,issues:[]},i),r instanceof Promise)throw new eW;return 0===r.issues.length}(this,e,t)},validateAsync(e,t){return nP(this,e,t)},encode:function e(t,n){return i3(this,t,n,{callee:e})},decode:function e(t,n){return i5(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await i8(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await i7(this,t,n,{callee:e})},safeEncode(e,t){return oe(this,e,t)},safeDecode(e,t){return ot(this,e,t)},async safeEncodeAsync(e,t){return on(this,e,t)},async safeDecodeAsync(e,t){return or(this,e,t)},toJSONSchema(e){return((e,t={})=>n=>{let r=iw({...n,processors:t});return i$(e,r),iS(r,e),iT(r,e)})(this,{})(e)},get description(){return e6.get(this)?.description},get _def(){return this._zod.def}}),oa=eV("_ZodString",(e,t)=>{nj.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{n.type="string";let{minimum:r,maximum:i,format:o,patterns:a,contentEncoding:s,laxFormat:u}=iB(e);if("number"==typeof r&&(n.minLength=r),"number"==typeof i&&(n.maxLength=i),o&&(n.format=iK[o]??o,""===n.format&&delete n.format,("time"===o||u)&&delete n.format),s&&(n.contentEncoding=s),a&&a.size>0){let e=[...a].map(iW);1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n)},iu.derived({format:e=>iB(e).format??null,minLength:e=>iB(e).minimum??null,maxLength:e=>iB(e).maximum??null},{regex(...e){return this.check(function(e,t){return new nn({check:"string_format",format:"regex",...Y(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new no({check:"string_format",format:"includes",...Y(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new na({check:"string_format",format:"starts_with",...Y(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new ns({check:"string_format",format:"ends_with",...Y(t),suffix:e})}(...e))},min(...e){return this.check(r8(...e))},max(...e){return this.check(r5(...e))},length(...e){return this.check(r7(...e))},nonempty(...e){return this.check(r8(1,...e))},lowercase(e){return this.check(new nr({check:"string_format",format:"lowercase",...Y(e)}))},uppercase(e){return this.check(new ni({check:"string_format",format:"uppercase",...Y(e)}))},trim(){return this.check(ie(e=>e.trim()))},normalize(...e){return this.check(function(e){return ie(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(ie(e=>e.toLowerCase()))},toUpperCase(){return this.check(ie(e=>e.toUpperCase()))},slugify(){return this.check(ie(e=>M(e)))}})),os=eV("ZodString",(e,t)=>{nj.init(e,t),oa.init(e,t)},{email(e){return this.check(new oh({type:"string",format:"email",check:"string_format",abort:!1,...Y(e)}))},url(e){return this.check(new ov({type:"string",format:"url",check:"string_format",abort:!1,...Y(e)}))},jwt(e){return this.check(new oE({type:"string",format:"jwt",check:"string_format",abort:!1,...Y(e)}))},emoji(e){return this.check(new og({type:"string",format:"emoji",check:"string_format",abort:!1,...Y(e)}))},guid(e){return this.check(new om({type:"string",format:"guid",check:"string_format",abort:!1,...Y(e)}))},uuid(e){return this.check(new oy({type:"string",format:"uuid",check:"string_format",abort:!1,...Y(e)}))},uuidv4(e){return this.check(new oy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Y(e)}))},uuidv6(e){return this.check(new oy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Y(e)}))},uuidv7(e){return this.check(new oy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Y(e)}))},nanoid(e){return this.check(new o_({type:"string",format:"nanoid",check:"string_format",abort:!1,...Y(e)}))},cuid(e){return this.check(new ob({type:"string",format:"cuid",check:"string_format",abort:!1,...Y(e)}))},cuid2(e){return this.check(new oz({type:"string",format:"cuid2",check:"string_format",abort:!1,...Y(e)}))},ulid(e){return this.check(new ow({type:"string",format:"ulid",check:"string_format",abort:!1,...Y(e)}))},base64(e){return this.check(new oA({type:"string",format:"base64",check:"string_format",abort:!1,...Y(e)}))},base64url(e){return this.check(new oZ({type:"string",format:"base64url",check:"string_format",abort:!1,...Y(e)}))},xid(e){return this.check(new ok({type:"string",format:"xid",check:"string_format",abort:!1,...Y(e)}))},ksuid(e){return this.check(new o$({type:"string",format:"ksuid",check:"string_format",abort:!1,...Y(e)}))},ipv4(e){return this.check(new oO({type:"string",format:"ipv4",check:"string_format",abort:!1,...Y(e)}))},ipv6(e){return this.check(new oS({type:"string",format:"ipv6",check:"string_format",abort:!1,...Y(e)}))},cidrv4(e){return this.check(new oP({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Y(e)}))},cidrv6(e){return this.check(new ox({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Y(e)}))},e164(e){return this.check(new oT({type:"string",format:"e164",check:"string_format",abort:!1,...Y(e)}))},datetime(e){return this.check(new oc({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Y(e)}))},date(e){return this.check(new od({type:"string",format:"date",check:"string_format",...Y(e)}))},time(e){return this.check(new of({type:"string",format:"time",check:"string_format",precision:null,...Y(e)}))},duration(e){return this.check(new op({type:"string",format:"duration",check:"string_format",...Y(e)}))}});function ou(e){return new os(r1({type:"string",...Y(e)}))}let ol=eV("ZodStringFormat",(e,t)=>{nN.init(e,t),oa.init(e,t)}),oc=eV("ZodISODateTime",(e,t)=>{nX.init(e,t),ol.init(e,t)}),od=eV("ZodISODate",(e,t)=>{nH.init(e,t),ol.init(e,t)}),of=eV("ZodISOTime",(e,t)=>{nq.init(e,t),ol.init(e,t)}),op=eV("ZodISODuration",(e,t)=>{nY.init(e,t),ol.init(e,t)}),oh=eV("ZodEmail",(e,t)=>{nR.init(e,t),ol.init(e,t)}),om=eV("ZodGUID",(e,t)=>{nI.init(e,t),ol.init(e,t)}),oy=eV("ZodUUID",(e,t)=>{nD.init(e,t),ol.init(e,t)}),ov=eV("ZodURL",(e,t)=>{nU.init(e,t),ol.init(e,t)}),og=eV("ZodEmoji",(e,t)=>{nJ.init(e,t),ol.init(e,t)}),o_=eV("ZodNanoID",(e,t)=>{nL.init(e,t),ol.init(e,t)}),ob=eV("ZodCUID",(e,t)=>{nB.init(e,t),ol.init(e,t)}),oz=eV("ZodCUID2",(e,t)=>{nK.init(e,t),ol.init(e,t)}),ow=eV("ZodULID",(e,t)=>{nV.init(e,t),ol.init(e,t)}),ok=eV("ZodXID",(e,t)=>{nW.init(e,t),ol.init(e,t)}),o$=eV("ZodKSUID",(e,t)=>{nG.init(e,t),ol.init(e,t)}),oO=eV("ZodIPv4",(e,t)=>{nQ.init(e,t),ol.init(e,t)}),oS=eV("ZodIPv6",(e,t)=>{n4.init(e,t),ol.init(e,t)}),oP=eV("ZodCIDRv4",(e,t)=>{n2.init(e,t),ol.init(e,t)}),ox=eV("ZodCIDRv6",(e,t)=>{n9.init(e,t),ol.init(e,t)}),oA=eV("ZodBase64",(e,t)=>{n5.init(e,t),ol.init(e,t)}),oZ=eV("ZodBase64URL",(e,t)=>{n7.init(e,t),ol.init(e,t)}),oT=eV("ZodE164",(e,t)=>{re.init(e,t),ol.init(e,t)}),oE=eV("ZodJWT",(e,t)=>{rn.init(e,t),ol.init(e,t)}),oj=eV("ZodNumber",(e,t)=>{rr.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:i,maximum:o,multipleOf:a,exclusiveMaximum:s,exclusiveMinimum:u,isInt:l}=iB(e);n.type=l?"integer":"number";let c="number"==typeof u&&u>=(i??-1/0),d="number"==typeof s&&s<=(o??1/0),f="draft-04"===t.target||"openapi-3.0"===t.target;if(c?f?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u:"number"==typeof i&&(n.minimum=i),d?f?(n.maximum=s,n.exclusiveMaximum=!0):n.exclusiveMaximum=s:"number"==typeof o&&(n.maximum=o),a){let i=new Set;for(let o of a)Number.isFinite(o)&&0!==o?i.add(Math.abs(o)):ik(e,t,n,r,`A multipleOf divisor of ${o} cannot be represented in JSON Schema`);let[o,...s]=i;void 0!==o&&(n.multipleOf=o),s.length&&(n.allOf=[...n.allOf??[],...s.map(e=>({multipleOf:e}))])}})(e,t,n,r),e.isFinite=!0},iu.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=iB(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=iB(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=iB(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>iB(e).format??null},{gt(e,t){return this.check(r9(e,t))},gte(e,t){return this.check(r6(e,t))},min(e,t){return this.check(r6(e,t))},lt(e,t){return this.check(r4(e,t))},lte(e,t){return this.check(r2(e,t))},max(e,t){return this.check(r2(e,t))},int(e){return this.check(oD(e))},safe(e){return this.check(oD(e))},positive(e){return this.check(r9(0,e))},nonnegative(e){return this.check(r6(0,e))},negative(e){return this.check(r4(0,e))},nonpositive(e){return this.check(r2(0,e))},multipleOf(e,t){return this.check(r3(e,t))},step(e,t){return this.check(r3(e,t))},finite(){return this}}));function oN(e){return new oj(r1({type:"number",checks:[],...Y(e)}))}let oI=eV("ZodNumberFormat",(e,t)=>{ri.init(e,t),oj.init(e,t)});function oD(e){return new oI({type:"number",check:"number_format",abort:!1,format:"safeint",...Y(e)})}let oR=eV("ZodBoolean",(e,t)=>{ro.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function oF(e){return new oR({type:"boolean",...Y(e)})}(e,t)=>{ra.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{ik(e,t,n,r,"BigInt cannot be represented in JSON Schema")}};let oC=eV("ZodUnknown",(e,t)=>{rs.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function oM(){return new oC({type:"unknown"})}let oU=eV("ZodNever",(e,t)=>{ru.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}});function oJ(e){return new oU({type:"never",...Y(e)})}let oL=eV("ZodArray",(e,t)=>{oi(),rh.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,{minimum:o,maximum:a}=iB(e);"number"==typeof o&&(n.minItems=o),"number"==typeof a&&(n.maxItems=a),n.type="array",n.items=i$(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element},{min(e,t){return this.check(r8(e,t))},nonempty(e){return this.check(r8(1,e))},max(e,t){return this.check(r5(e,t))},length(e,t){return this.check(r7(e,t))},unwrap(){return this.element}});function oB(e,t){return new oL({type:"array",element:e,...Y(t)})}let oK=eV("ZodObject",(e,t)=>{oi(),rb.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&ik(e,t,n,r,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in n.type="object",n.properties={},o)x(n.properties,e,i$(o[e],t,{...r,path:[...r.path,"properties",e]}));let a=[];for(let e of Object.keys(o)){let n=i.shape[e];("input"===t.io?void 0===iG(n):void 0===n._zod.optout)&&a.push(e)}a.length>0&&(n.required=a),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=i$(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),ig.installLazyProp(e,"shape",e=>e._zod.def.shape,!1)},{keyof(){return oQ(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(io.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(io.mergeDefs(this._zod.def,{catchall:oM()}))},loose(){return this.clone(io.mergeDefs(this._zod.def,{catchall:oM()}))},strict(){return this.clone(io.mergeDefs(this._zod.def,{catchall:oJ()}))},strip(){return this.clone(io.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return ic.extend(this,e)},safeExtend(e){return id.safeExtend(this,e)},merge(e){return ip.merge(this,e)},pick(e){return ih.pick(this,e)},omit(e){return im.omit(this,e)},partial(...e){return iy.partial(o2,this,e[0])},exactPartial(...e){return iy.partial(o6,this,e[0],"exactPartial")},required(...e){return iv.required(ae,this,e[0])}});function oV(e,t){return new oK({type:"object",shape:e??{},...il.normalizeParams(t)})}function oW(e,t){return new oK({type:"object",shape:e,catchall:oJ(),...il.normalizeParams(t)})}let oG=eV("ZodUnion",(e,t)=>{rw.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{var i,o,a,s;let u,l,c;return i=e,o=t,a=n,s=r,l=!1===(u=i._zod.def).inclusive,c=u.options.map((e,t)=>i$(e,o,{...s,path:[...s.path,l?"oneOf":"anyOf",t]})),void(l?a.oneOf=c:a.anyOf=c)},e.options=t.options}),oX=eV("ZodIntersection",(e,t)=>{r$.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a,s,u;return o=i$((i=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),a=i$(i.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=u=[...(s=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...s(a)?a.allOf:[a]],t.intersections.push(u))}}),oH=eV("ZodRecord",(e,t)=>{oi(),rZ.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="object";let o=i.keyType,a=iB(o).patterns;if("loose"===i.mode&&a&&a.size>0){let e=i$(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},a))x(n.patternProperties,iW(t).source,e)}else{if("draft-07"===t.target||"draft-2020-12"===t.target){n.propertyNames=i$(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let o=iX.get(t);o||(o=[],iX.set(t,o),t.deferred.push(()=>(function(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of iX.get(e)??[]){let i=e.seen.get(r),o=(i?.def??i?.schema)?.propertyNames;if(!o||!0===o||n.has(o))continue;let a=function e(t,n,r){if(n.$ref){if(r.has(n))return n;r.add(n);let i=t.get(n)?.def;if(!i)return n;let o=e(t,i,r);return o===i?n:o}for(let i of["anyOf","oneOf"]){let o=n[i];if(!Array.isArray(o))continue;let a=o.map(n=>e(t,n,r));a.some((e,t)=>e!==o[t])&&(n={...n,[i]:a})}let i=Array.isArray(n.type)?n.type:[n.type],o=!i.includes("string")&&i.some(e=>"number"===e||"integer"===e),a=n.enum??(void 0!==n.const?[n.const]:void 0);if(!o&&!a?.some(e=>"number"==typeof e))return n;let{minimum:s,maximum:u,exclusiveMinimum:l,exclusiveMaximum:c,multipleOf:d,format:f,id:p,...h}=n;return h.enum?h.enum=h.enum.map(e=>"number"==typeof e?String(e):e):"number"==typeof h.const&&(h.const=String(h.const)),o&&(h.type="string",a||(h.pattern=(i.includes("number")?tE:tT).source)),h}(t,o,new Set);a!==o&&n.set(o,a)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}})(t))),o.push(e)}n.additionalProperties=i$(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let s=o._zod.values,u="input"===t.io&&void 0!==iG(i.valueType);if(s&&!i.partial&&!u){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e.map(String))}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function oq(e,t,n){return new oH(t&&t._zod?{type:"record",keyType:e,valueType:t,...il.normalizeParams(n)}:{type:"record",keyType:ou(),valueType:e,...il.normalizeParams(t)})}let oY=eV("ZodEnum",(e,t)=>{rj.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t)=>{let n=v(e._zod.def.entries);if(0===n.length){t.not={};return}n.every(e=>"number"==typeof e)&&(t.type="number"),n.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=n})(e,n),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new oY({...t,checks:[],...il.normalizeParams(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new oY({...t,checks:[],...il.normalizeParams(r),entries:i})}});function oQ(e,t){return new oY({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...il.normalizeParams(t)})}let o0=eV("ZodLiteral",(e,t)=>{rN.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(0===i.values.length){n.not={};return}let o=[];for(let a of i.values)if(void 0===a){if(ik(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof a){if(ik(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(0===o.length);else if(1===o.length){let e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function o1(e,t){return new o0({type:"literal",values:Array.isArray(e)?e:[e],...il.normalizeParams(t)})}let o4=eV("ZodTransform",(e,t)=>{oi(),rI.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{ik(e,t,n,r,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new eG(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(i_.issue(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=n.value),r.inst??(r.inst=e),n.issues.push(i_.issue(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),o2=eV("ZodOptional",(e,t)=>{rR.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function o9(e){return new o2({type:"optional",innerType:e})}let o6=eV("ZodExactOptional",(e,t)=>{rF.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),o3=eV("ZodNullable",(e,t)=>{rC.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=i$((i=e._zod.def).innerType,t,r),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function o5(e){return new o3({type:"nullable",innerType:e})}let o8=eV("ZodDefault",(e,t)=>{rM.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o;return i$((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,void((o=iq(i.defaultValue,e,t,n,r))!==iH&&(n.default=o))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),o7=eV("ZodPrefault",(e,t)=>{rJ.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(i$(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let o=iq(i.defaultValue,e,t,n,r);o!==iH&&(n._prefault=o)})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),ae=eV("ZodNonOptional",(e,t)=>{rL.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;i$((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),at=eV("ZodCatch",(e,t)=>{rV.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i,o=e._zod.def;i$(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{ik(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),an=eV("ZodPipe",(e,t)=>{rW.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,o,a;return o=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(i$(a="input"===t.io?o?i.out:i.in:i.out,t,r),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function ar(e,t){return new an({type:"pipe",in:e,out:t})}let ai=eV("ZodReadonly",(e,t)=>{rq.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;i$((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),ao=eV("ZodCustom",(e,t)=>{rQ.init(e,t),oo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{ik(e,t,n,r,"Custom types cannot be represented in JSON Schema")}});e.s(["array",0,oB,"boolean",0,oF,"enum",0,oQ,"literal",0,o1,"number",0,oN,"object",0,oV,"record",0,oq,"strictObject",0,oW,"string",0,ou,"unknown",0,oM],362201),e.i(362201),e.s([],430421),e.i(430421),e.i(789282),e.s([],100364),e.i(100364),e.s([],458829),e.i(458829),e.s(["array",0,oB,"boolean",0,oF,"enum",0,oQ,"literal",0,o1,"number",0,oN,"object",0,oV,"record",0,oq,"strictObject",0,oW,"string",0,ou,"unknown",0,oM],722219)}]);
@@ -0,0 +1 @@
1
+ (()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,711241,e=>{var t=e.i(456420);let i={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};i.node;let a=(0,t.f)(i);e.s(["f",0,a],711241)},474544,e=>{var t=e.i(456420);let i={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};i.node;let a=(0,t.f)(i);e.s(["f",0,a],474544)},786563,e=>{var t=e.i(456420);let i={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};i.node;let a=(0,t.f)(i);e.s(["f",0,a],786563)},118924,e=>{var t=e.i(843476),i=e.i(271645),a=e.i(522016),s=e.i(975153),r=e.i(741120),n=e.i(666696),l=e.i(519455),c=e.i(912505),d=e.i(393842),o=e.i(658512),m=e.i(111110),f=e.i(215519),u=e.i(41931),x=e.i(469817),g=e.i(306831),p=e.i(201276),h=e.i(35209);let v=[1,2,4,7,15,30];e.s(["default",0,function(){let{t:e}=(0,m.b)(),{timeZone:w}=(0,f.M)();(0,h.f)(e.review.title);let[b,j]=(0,i.useState)(null),[y,N]=(0,i.useState)(1),k=(0,i.useCallback)(async e=>{try{j(await u.k.get(`/api/review/due?page=${e}&pageSize=${x.$}`))}catch(e){p.V.error("[Review]","Failed to fetch due reviews",{error:e})}},[]);(0,i.useEffect)(()=>{k(y)},[y,k]);let S=(0,g.d)(new Date,w).start;return(0,t.jsxs)("main",{className:"mx-auto max-w-6xl space-y-6 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(d.f,{title:e.review.title,description:e.review.desc,actions:b&&b.total>0&&(0,t.jsx)("span",{className:"rounded-full bg-primary/10 px-3 py-1 text-sm font-medium text-primary",children:e.review.dueCount.replace("{count}",String(b.total))})}),!b&&(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Array.from({length:6},(e,i)=>(0,t.jsx)("div",{className:"h-52 animate-pulse rounded-2xl bg-muted"},i))}),b&&0===b.total&&(0,t.jsx)(c.f,{icon:s.f,title:e.review.empty,description:e.review.emptyHint}),b&&b.items.length>0&&(0,t.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:b.items.map(i=>{let s;return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(n.f,{item:i,selectMode:!1,selected:!1,onToggleSelect:()=>{},selectedTag:null,onTagClick:()=>{}})}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{children:[(s=(0,g.r)(i.nextReviewAt,"MM/dd",w),new Date(i.nextReviewAt)<S?e.review.overdue.replace("{date}",s):e.review.dueOn.replace("{date}",s))," · ",e.review.round.replace("{round}",String(i.reviewStage+1)).replace("{total}",String(v.length))]}),(0,t.jsx)(a.default,{href:`/practice?id=${i.id}`,children:(0,t.jsxs)(l.f,{variant:"outline",size:"sm",className:"h-8",children:[(0,t.jsx)(r.f,{className:"mr-1.5 h-3.5 w-3.5"}),e.review.practice]})})]})]},i.id)})}),b&&(0,t.jsx)(o.f,{page:y,totalPages:b.totalPages,total:b.total,pageSize:b.pageSize,onPageChange:N})]})}],118924)},469937,e=>{var t=e.i(843476),i=e.i(786563),a=e.i(111110),s=e.i(975157);let r=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:c="sm",showUnrated:d=!0,className:o}){let{t:m}=(0,a.b)(),f=e??0,u="sm"===c?"h-3.5 w-3.5":"h-5 w-5",x=f?m.difficulty.starsLabel.replace("{n}",String(f)):m.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,s.f)("inline-flex items-center gap-0.5",o),role:"group","aria-label":`${m.difficulty.label}${m.common.colon}${x}`,title:m.difficulty.clearHint,children:[r.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===f?null:e),"aria-label":m.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=f,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)(i.f,{className:(0,s.f)(u,e<=f?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!f&&d&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:m.difficulty.unrated})]}):f?(0,t.jsx)("span",{className:(0,s.f)("inline-flex items-center",o),role:"img","aria-label":`${m.difficulty.label}${m.common.colon}${x}`,title:x,children:r.map(e=>(0,t.jsx)(i.f,{className:(0,s.f)(u,e<=f?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):d?(0,t.jsx)("span",{className:(0,s.f)("text-xs text-muted-foreground",o),children:m.difficulty.unrated}):null}])},846968,e=>{var t=e.i(843476),i=e.i(548161),a=e.i(474544),s=e.i(741120),r=e.i(487486),n=e.i(111110);let l={new:{className:"bg-warning/15 text-amber-700 dark:text-warning",icon:a.f},reviewing:{className:"bg-primary/10 text-primary",icon:s.f},mastered:{className:"bg-success/15 text-success",icon:i.f}};e.s(["o",0,{new:"border-l-warning/70",reviewing:"border-l-primary/60",mastered:"border-l-success/70"},"x",0,function({status:e,className:i=""}){let{t:a}=(0,n.b)(),{className:s,icon:c}=l[e],d="mastered"===e?a.notebook.mastered:"reviewing"===e?a.notebook.reviewing:a.notebook.review;return(0,t.jsx)(r.f,{variant:"secondary",className:`${s} ${i}`,children:(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(c,{className:"h-3 w-3"})," ",d]})})}])},590546,e=>{var t=e.i(843476),i=e.i(618566),a=e.i(519455),s=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:r}){let n=(0,i.useRouter)();return(0,t.jsx)(a.f,{variant:"ghost",size:"icon",onClick:()=>{n.push(e)},className:r,children:(0,t.jsx)(s.f,{className:"h-5 w-5"})})}])},912505,e=>{var t=e.i(843476),i=e.i(975157);e.s(["f",0,function({icon:e,title:a,description:s,action:r,className:n}){return(0,t.jsxs)("div",{className:(0,i.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",n),children:[(0,t.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,t.jsx)(e,{className:"h-7 w-7"})}),(0,t.jsx)("p",{className:"font-medium",children:a}),s&&(0,t.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:s}),r&&(0,t.jsx)("div",{className:"mt-5",children:r})]})}])},393842,e=>{var t=e.i(843476),i=e.i(590546),a=e.i(975157);e.s(["f",0,function({title:e,description:s,backHref:r,actions:n,titleAddon:l,className:c}){return(0,t.jsxs)("div",{className:(0,a.f)("flex items-start gap-3",c),children:[r&&(0,t.jsx)(i.f,{fallbackUrl:r,className:"-ml-2 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),l]}),s&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:s})]}),n&&(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:n})]})}])},469817,e=>{e.s(["$",0,18,"u",0,5,"A",0,200])},35209,e=>{var t=e.i(271645),i=e.i(111110);e.s(["f",0,function(...e){let{t:a}=(0,i.b)(),s=[a.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,t.useEffect)(()=>{document.title=s},[s])}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,i="zh"){return("en"===i?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,i){return(i||"").trim()?"wrong_attempt":t(e)}])},428602,e=>{e.s(["f",0,function(e){if(e.tags&&e.tags.length>0)return e.tags.map(e=>e.name);if(!e.knowledgePoints)return[];try{let t=JSON.parse(e.knowledgePoints);return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}])}])})();
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,864272,e=>{"use strict";var t=e.i(843476),a=e.i(271645),r=e.i(522016),s=e.i(618566),i=e.i(13285),n=e.i(853138),l=e.i(632781),c=e.i(77071),o=e.i(456420);let d={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};d.node;let m=(0,o.f)(d),u={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};u.node;let h=(0,o.f)(u);var x=e.i(111110);function p({inputProps:e,created:a}){let{t:s}=(0,x.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"file",accept:"image/*",className:"hidden","data-testid":"continuation-input",...e}),a.length>0&&(0,t.jsx)("ul",{className:"space-y-1 rounded-lg border border-primary/40 bg-primary/5 p-3 text-sm","data-testid":"continuation-notice",children:a.map((e,a)=>(0,t.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 text-primary"}),s.importBatch.continuation.notice.replace("{n}",String(a+2))]}),(0,t.jsxs)(r.default,{href:`/import-batches/${e}`,className:"flex items-center gap-1 text-primary underline-offset-2 hover:underline",children:[s.importBatch.continuation.open,(0,t.jsx)(h,{className:"h-3 w-3"})]})]},e))})]})}let f={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};f.node;let g=(0,o.f)(f),y={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};y.node;let b=(0,o.f)(y);var j=e.i(716327),w=e.i(456539),v=e.i(508734);let k={name:"crop",size:24,node:[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]};k.node;let N=(0,o.f)(k),B={name:"file-plus-corner",size:24,node:[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],aliases:["file-plus-2"]};B.node;let S=(0,o.f)(B),C={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};C.node;let z=(0,o.f)(C),T={name:"scissors",size:24,node:[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]};T.node;let I=(0,o.f)(T);var A=e.i(328623),R=e.i(759659),$=e.i(263676),M=e.i(793479),E=e.i(110204),q=e.i(967489),F=e.i(624687),P=e.i(411382),D=e.i(978056),U=e.i(54105),_=e.i(772325),O=e.i(722219),O=O,H=e.i(282492),L=e.i(825624);let V=P.z.object({x:D.z.number().min(0).max(1),y:D.z.number().min(0).max(1),width:D.z.number().min(.01).max(1),height:D.z.number().min(.01).max(1)}).refine(e=>e.x+e.width<=1.0001&&e.y+e.height<=1.0001,{message:"REGION_OUT_OF_BOUNDS"}),K=["unclear","partial","unlocated"],G=U.z.string().max(1572864,"DRAFT_IMAGE_TOO_LARGE").regex(/^data:image\/(?:jpeg|png|webp);base64,[A-Za-z0-9+/]+=*$/,"DRAFT_IMAGE_INVALID"),Q=P.z.object({original:U.z.string().max(2e4),text:U.z.string().max(2e4),uncertain:_.z.array(U.z.string().max(200)).max(20)}),Y=P.z.object({key:U.z.string().regex(/^[A-Za-z0-9_-]{1,40}$/),label:U.z.string().max(20).nullable(),text:U.z.string().max(2e4),material:U.z.string().max(2e4).nullable(),section:U.z.string().max(500).nullable(),selected:O.boolean(),regions:_.z.array(V).max(4),hasFigure:O.boolean(),flags:_.z.array(H.z.enum(K)).max(K.length),fix:Q.nullish(),answer:U.z.string().max(2e4).nullish(),analysis:U.z.string().max(2e4).nullish(),knowledgePoints:_.z.array(U.z.string().max(200)).max(100).optional(),difficultyStars:D.z.number().int().min(1).max(5).nullish(),questionType:U.z.string().max(200).nullish(),wrongAnswer:U.z.string().max(2e4).nullish(),image:G.nullish()}),J=["blurry","partial","truncated","tooMany"];function W(e=[]){let t=new Set(e);for(;;){let e=`q${Math.random().toString(36).slice(2,10)}`;if(!t.has(e))return e}}function X(e,t){return"image"===t?e.regions.length>0:e.text.trim().length>0}function Z(e,t){return e.items.filter(e=>e.selected&&X(e,t))}function ee(e,t){return{...e,items:t}}function et(e,t){return e.items.findIndex(e=>e.key===t)}function ea(e,t,a){return ee(e,e.items.map(e=>{if(e.key!==t)return e;let r={...e,...a};return void 0!==a.text&&(r.text=a.text.slice(0,2e4),r.text!==e.text&&(r.fix=null)),void 0!==a.answer&&(r.answer=a.answer?.slice(0,2e4)??null),void 0!==a.analysis&&(r.analysis=a.analysis?.slice(0,2e4)??null),void 0!==a.knowledgePoints&&(r.knowledgePoints=a.knowledgePoints.slice(0,100).map(e=>e.slice(0,200))),void 0!==a.difficultyStars&&(r.difficultyStars=a.difficultyStars),void 0!==a.questionType&&(r.questionType=a.questionType),void 0!==a.wrongAnswer&&(r.wrongAnswer=a.wrongAnswer?.slice(0,2e4)??null),void 0!==a.regions&&(r.regions=a.regions.slice(0,4),r.flags=r.regions.length>0?e.flags.filter(e=>"unlocated"!==e):[...new Set([...e.flags,"unlocated"])]),r}))}function er(e,t){return ee(e,e.items.filter(e=>e.key!==t))}function es(e,t,a){let r=et(e,t),s=r+a;if(r<0||s<0||s>=e.items.length)return e;let i=[...e.items];return[i[r],i[s]]=[i[s],i[r]],ee(e,i)}function ei(e,t){return[e,t].filter(e=>e?.trim()).join("\n").trim()||null}function en(e,t){let a=t?new Set(t):null,r=!1,s=e.items.map(e=>e.fix&&(!a||a.has(e.key))?(r=!0,e.fix.original===e.text?{...e,text:e.fix.text,fix:null}:{...e,fix:null}):e);return r?ee(e,s):e}P.z.object({items:_.z.array(Y).max(L.S),ignored:_.z.array(U.z.string().max(2e4)).max(200),warnings:_.z.array(H.z.enum(J)).max(J.length)}).superRefine((e,t)=>{let a=new Set;for(let r of e.items)a.has(r.key)&&t.addIssue({code:"custom",message:"DUPLICATE_ITEM_KEY"}),a.add(r.key)});var el=e.i(401280);let ec=[1,2,3,4,5],eo=[el.O,...el.V];function ed({item:e,onEdit:r}){let{t:s}=(0,x.b)(),[i,n]=(0,a.useState)(!1),l=!!(e.answer?.trim()||e.analysis?.trim()||e.knowledgePoints?.length||null!=e.difficultyStars||e.wrongAnswer?.trim());return(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between text-xs font-medium text-muted-foreground",onClick:()=>n(e=>!e),"aria-expanded":i,children:[(0,t.jsx)("span",{children:s.importBatch.fields.title}),i?(0,t.jsx)(w.f,{className:"h-3.5 w-3.5"}):(0,t.jsx)(j.f,{className:"h-3.5 w-3.5"})]}),i&&(0,t.jsxs)("div",{className:"mt-2 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-type`,className:"text-xs",children:s.questionType.label}),(0,t.jsxs)(q.d,{value:e.questionType??el.O,onValueChange:t=>r(a=>ea(a,e.key,{questionType:t===el.O?null:(0,el.P)(t)})),children:[(0,t.jsx)(q.P,{className:"h-8 w-full text-sm","aria-label":s.questionType.label,children:(0,t.jsx)(q.U,{})}),(0,t.jsx)(q.r,{children:eo.map(e=>(0,t.jsx)(q.T,{value:e,children:e===el.O?s.questionType.notSet:s.questionType.names[e]},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-answer`,className:"text-xs",children:s.importBatch.fields.answer}),(0,t.jsx)(F.f,{id:`${e.key}-answer`,value:e.answer??"",onChange:t=>r(a=>ea(a,e.key,{answer:t.target.value})),className:"min-h-16 text-sm",placeholder:s.importBatch.fields.answerPlaceholder})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-analysis`,className:"text-xs",children:s.importBatch.fields.analysis}),(0,t.jsx)(F.f,{id:`${e.key}-analysis`,value:e.analysis??"",onChange:t=>r(a=>ea(a,e.key,{analysis:t.target.value})),className:"min-h-20 text-sm",placeholder:s.importBatch.fields.analysisPlaceholder})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-knowledge`,className:"text-xs",children:s.importBatch.fields.knowledgePoints}),(0,t.jsx)(M.f,{id:`${e.key}-knowledge`,value:(e.knowledgePoints??[]).join(", "),onChange:t=>r(a=>ea(a,e.key,{knowledgePoints:t.target.value.split(/[,,、]/).map(e=>e.trim()).filter(Boolean)})),className:"text-sm",placeholder:s.importBatch.fields.knowledgePlaceholder})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{className:"text-xs",children:s.importBatch.fields.difficulty}),(0,t.jsxs)(q.d,{value:null!=e.difficultyStars?String(e.difficultyStars):"none",onValueChange:t=>r(a=>ea(a,e.key,{difficultyStars:"none"===t?null:Number(t)})),children:[(0,t.jsx)(q.P,{className:"h-8 w-full text-sm","aria-label":s.importBatch.fields.difficulty,children:(0,t.jsx)(q.U,{})}),(0,t.jsxs)(q.r,{children:[(0,t.jsx)(q.T,{value:"none",children:s.importBatch.fields.difficultyNone}),ec.map(e=>(0,t.jsx)(q.T,{value:String(e),children:"★".repeat(e)},e))]})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-wrong`,className:"text-xs",children:s.importBatch.fields.wrongAnswer}),(0,t.jsx)(F.f,{id:`${e.key}-wrong`,value:e.wrongAnswer??"",onChange:t=>r(a=>ea(a,e.key,{wrongAnswer:t.target.value})),className:"min-h-16 text-sm",placeholder:s.importBatch.fields.wrongAnswerPlaceholder})]})]}),!i&&l&&(0,t.jsx)("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[e.answer?.trim()&&s.importBatch.fields.answer,e.analysis?.trim()&&s.importBatch.fields.analysis,e.knowledgePoints?.length&&`${s.importBatch.fields.knowledgePoints}(${e.knowledgePoints.length})`,null!=e.difficultyStars&&"★".repeat(e.difficultyStars),e.wrongAnswer?.trim()&&s.importBatch.fields.wrongAnswer].filter(Boolean).join(" · ")})]})}var em=e.i(975157);function eu({imageUrl:e,imageSize:a,regions:r,className:s}){let i=function(e){if(0===e.length)return null;let t=Math.min(...e.map(e=>e.x)),a=Math.min(...e.map(e=>e.y));return{x:t,y:a,width:Math.max(...e.map(e=>e.x+e.width))-t,height:Math.max(...e.map(e=>e.y+e.height))-a}}(r);if(!i)return null;let n=i.width*a.width/Math.max(1,i.height*a.height);return(0,t.jsx)("div",{className:(0,em.f)("relative w-full overflow-hidden rounded-md border bg-white",s),style:{aspectRatio:String(Math.max(.25,Math.min(8,n)))},"aria-hidden":!0,children:(0,t.jsx)("img",{src:e,alt:"",className:"absolute max-w-none select-none",draggable:!1,style:{width:`${100/i.width}%`,height:`${100/i.height}%`,left:`${-i.x/i.width*100}%`,top:`${-i.y/i.height*100}%`}})})}var eh=e.i(689664),ex=e.i(519455);function ep(e,t,a){if(!a)return;let r=e[e.length-1];r&&r.type===t?r.text+=a:e.push({type:t,text:a})}function ef({fix:e,onAccept:r,onReject:s}){let{t:i}=(0,x.b)(),n=(0,a.useMemo)(()=>(function(e,t){let a=Array.from(e),r=Array.from(t),s=0;for(;s<a.length&&s<r.length&&a[s]===r[s];)s++;let i=a.length,n=r.length;for(;i>s&&n>s&&a[i-1]===r[n-1];)i--,n--;let l=[];ep(l,"same",a.slice(0,s).join(""));let c=a.slice(s,i),o=r.slice(s,n),d=c.length,m=o.length;if(d*m>2e6)ep(l,"removed",c.join("")),ep(l,"added",o.join(""));else{let e=m+1,t=new Uint32Array((d+1)*e);for(let a=d-1;a>=0;a--)for(let r=m-1;r>=0;r--)t[a*e+r]=c[a]===o[r]?t[(a+1)*e+r+1]+1:Math.max(t[(a+1)*e+r],t[a*e+r+1]);let a=0,r=0;for(;a<d&&r<m;)c[a]===o[r]?(ep(l,"same",c[a]),a++,r++):t[(a+1)*e+r]>=t[a*e+r+1]?ep(l,"removed",c[a++]):ep(l,"added",o[r++]);ep(l,"removed",c.slice(a).join("")),ep(l,"added",o.slice(r).join(""))}return ep(l,"same",a.slice(i).join("")),l})(e.original,e.text),[e.original,e.text]);return(0,t.jsxs)("div",{className:"space-y-2 rounded-lg border border-violet-300 bg-violet-50/60 p-2 text-sm dark:border-violet-800 dark:bg-violet-950/30","data-testid":"text-fix-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs font-medium text-violet-700 dark:text-violet-300",children:[(0,t.jsx)(A.f,{className:"h-3 w-3"}),i.importBatch.fixText.title]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i.importBatch.fixText.legend})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-words font-mono text-sm","data-testid":"text-fix-diff",children:n.map((e,a)=>"same"===e.type?(0,t.jsx)("span",{children:e.text},a):"removed"===e.type?(0,t.jsx)("del",{className:"bg-red-100 text-red-700 decoration-red-500 dark:bg-red-950/50 dark:text-red-300",children:e.text},a):(0,t.jsx)("ins",{className:"bg-emerald-100 text-emerald-800 no-underline dark:bg-emerald-950/50 dark:text-emerald-300",children:e.text},a))}),e.uncertain.length>0&&(0,t.jsxs)("div",{className:"text-xs text-amber-800 dark:text-amber-300",children:[(0,t.jsx)("span",{children:i.importBatch.fixText.uncertain}),(0,t.jsx)("ul",{className:"mt-0.5 list-inside list-disc",children:e.uncertain.map((e,a)=>(0,t.jsx)("li",{className:"break-words",children:e},a))})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:r,children:[(0,t.jsx)(eh.f,{className:"mr-1 h-4 w-4"}),i.importBatch.fixText.accept]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:s,children:[(0,t.jsx)($.X,{className:"mr-1 h-4 w-4"}),i.importBatch.fixText.reject]})]})]})}var eg=e.i(487486),ey=e.i(257428);function eb({image:e,alt:r,onRemove:s}){let[i,n]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"relative inline-block",children:[(0,t.jsx)("button",{type:"button",onClick:()=>n(!0),className:"block overflow-hidden rounded-lg border","aria-label":r,children:(0,t.jsx)("img",{src:e,alt:r,className:"max-h-32 w-auto object-contain"})}),(0,t.jsx)(ex.f,{type:"button",size:"icon",variant:"ghost",className:"absolute -right-2 -top-2 h-6 w-6 rounded-full bg-background border shadow-sm",onClick:s,"aria-label":"删除图片",children:(0,t.jsx)($.X,{className:"h-3 w-3"})}),i&&(0,t.jsx)("button",{type:"button",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4",onClick:()=>n(!1),"aria-label":"关闭大图",children:(0,t.jsx)("img",{src:e,alt:r,className:"max-h-full max-w-full object-contain"})})]})}function ej({item:e,index:r,total:s,source:i,expanded:c,onToggleExpand:o,onEdit:d,image:m,onAdjustRegion:u,highlighted:h,onFixText:p,fixing:f,fixBusy:y,onContinue:k,continuing:B}){let{t:C}=(0,x.b)(),T=(0,a.useRef)(null),$=X(e,i),M=`draft-item-${e.key}`,E=e.fix&&e.fix.original===e.text?e.fix:null;return(0,t.jsxs)("li",{id:M,className:(0,em.f)("rounded-xl border bg-card p-3 transition-colors",!e.selected&&"opacity-70",h&&"border-primary ring-2 ring-primary/30"),"data-testid":"draft-item","data-selected":e.selected,"data-fix-pending":E?"true":void 0,children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(ey.f,{className:"mt-1 h-5 w-5",checked:e.selected,disabled:!$,onCheckedChange:t=>d(a=>{var r,s;return r=e.key,s=!0===t,ee(a,a.items.map(e=>e.key===r?{...e,selected:s}:e))}),"aria-label":C.importBatch.question.replace("{index}",String(r+1))}),(0,t.jsxs)("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:o,"aria-expanded":c,"aria-controls":`${M}-body`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"font-semibold",children:C.importBatch.question.replace("{index}",String(r+1))}),e.label&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:C.importBatch.originalLabel.replace("{label}",e.label)}),e.material&&(0,t.jsx)(eg.f,{variant:"secondary",children:C.importBatch.material}),e.hasFigure&&(0,t.jsx)(eg.f,{variant:"outline",children:C.importBatch.hasFigure}),E&&(0,t.jsx)(eg.f,{className:"bg-violet-600 text-white hover:bg-violet-600",children:C.importBatch.fixText.pending}),e.section&&(0,t.jsx)("span",{className:"truncate text-xs text-muted-foreground",children:e.section.split("\n")[0]})]}),!c&&!E&&e.text&&(0,t.jsx)("p",{className:"mt-1 line-clamp-3 whitespace-pre-line break-words text-sm text-muted-foreground",children:e.text}),e.flags.length>0&&(0,t.jsx)("ul",{className:"mt-1 space-y-0.5",children:e.flags.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-1 text-xs text-amber-700 dark:text-amber-300",children:[(0,t.jsx)(n.f,{className:"h-3 w-3 shrink-0"}),C.importBatch.flags[e]]},e))})]}),(0,t.jsx)(ex.f,{type:"button",size:"icon",variant:"ghost",className:"h-8 w-8 shrink-0",onClick:o,"aria-label":c?C.importBatch.collapse:C.importBatch.edit,children:c?(0,t.jsx)(w.f,{className:"h-4 w-4"}):(0,t.jsx)(j.f,{className:"h-4 w-4"})})]}),m&&e.regions.length>0&&(0,t.jsx)("button",{type:"button",className:"mt-2 block w-full max-w-md pl-8",onClick:u,"aria-label":C.importBatch.adjustRegion,children:(0,t.jsx)(eu,{imageUrl:m.url,imageSize:m,regions:e.regions,className:"max-h-48"})}),k&&(0,t.jsx)("div",{className:"mt-2 pl-8",children:(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:k,disabled:B,"data-testid":"draft-continue",children:[B?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(S,{className:"mr-1 h-4 w-4"}),B?C.importBatch.continuation.working:C.importBatch.continuation.button]})}),E&&(0,t.jsx)("div",{className:"mt-2 pl-8",children:(0,t.jsx)(ef,{fix:E,onAccept:()=>d(t=>en(t,[e.key])),onReject:()=>d(t=>{var a;return a=e.key,ee(t,t.items.map(e=>e.key===a&&e.fix?{...e,fix:null}:e))})})}),c&&(0,t.jsxs)("div",{id:`${M}-body`,className:"mt-3 space-y-3 pl-8",children:[e.material&&(0,t.jsxs)("div",{className:"rounded-lg bg-muted/60 p-2 text-sm",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"text-xs font-medium",children:[C.importBatch.material," · ",C.importBatch.materialHint]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>d(t=>ea(t,e.key,{material:null})),children:C.importBatch.removeMaterial})]}),(0,t.jsx)("p",{className:"line-clamp-6 whitespace-pre-line break-words text-muted-foreground",children:e.material})]}),"text"===i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(F.f,{ref:T,"aria-label":C.importBatch.questionText,value:e.text,onChange:t=>d(a=>ea(a,e.key,{text:t.target.value}),`text-${e.key}`),className:"min-h-28 font-mono text-sm"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:C.importBatch.splitHint}),e.image&&(0,t.jsx)(eb,{image:e.image,alt:C.importBatch.questionImage,onRemove:()=>d(t=>ea(t,e.key,{image:null}))}),(0,t.jsx)(ed,{item:e,onEdit:e=>d(e)})]}):(0,t.jsxs)(t.Fragment,{children:[e.text&&(0,t.jsx)("p",{className:"whitespace-pre-line break-words text-sm text-muted-foreground",children:e.text}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:C.importBatch.imageTextHint})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:["text"===i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:()=>{let t=T.current?.selectionStart??0;d(a=>(function(e,t,a){let r=et(e,t);if(r<0||e.items.length>=L.S)return e;let s=e.items[r],i=s.text.slice(0,a).replace(/\s+$/,""),n=s.text.slice(a).replace(/^\s+/,"");if(!i||!n)return e;let l={...s,key:W(e.items.map(e=>e.key)),label:null,text:n,regions:[],flags:s.regions.length>0?["unlocated"]:[],selected:!(s.regions.length>0)&&s.selected,answer:null,analysis:null,knowledgePoints:void 0,difficultyStars:null,questionType:null,wrongAnswer:null,fix:null},c=[...e.items];return c.splice(r,1,{...s,text:i,fix:null},l),ee(e,c)})(a,e.key,t))},children:[(0,t.jsx)(I,{className:"mr-1 h-4 w-4"}),C.importBatch.splitHere]}),p&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:p,disabled:y||!e.text.trim(),children:[f?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(A.f,{className:"mr-1 h-4 w-4"}),f?C.importBatch.fixText.running:C.importBatch.fixText.one]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:u,children:[(0,t.jsx)(N,{className:"mr-1 h-4 w-4"}),e.regions.length?C.importBatch.adjustRegion:C.importBatch.locate]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:()=>d(t=>(function(e,t){let a=et(e,t);if(a<0||e.items.length>=L.S)return e;let r=e.items[a],s={...r,key:W(e.items.map(e=>e.key)),label:null,regions:r.regions.map(e=>({...e}))},i=[...e.items];return i.splice(a+1,0,s),ee(e,i)})(t,e.key)),children:[(0,t.jsx)(v.f,{className:"mr-1 h-4 w-4"}),C.importBatch.duplicate]})]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",disabled:0===r,onClick:()=>d(t=>(function(e,t){let a=et(e,t);if(a<=0)return e;let r=e.items[a-1],s=e.items[a],i={...r,text:[r.text,s.text].filter(e=>e.trim()).join("\n").slice(0,2e4),material:r.material??s.material,selected:r.selected||s.selected,regions:[...r.regions,...s.regions].slice(0,4),hasFigure:r.hasFigure||s.hasFigure,flags:[...new Set([...r.flags,...s.flags])].filter(e=>"unlocated"!==e||r.regions.length+s.regions.length===0),answer:ei(r.answer,s.answer)?.slice(0,2e4)??null,analysis:ei(r.analysis,s.analysis)?.slice(0,2e4)??null,knowledgePoints:[...new Set([...r.knowledgePoints??[],...s.knowledgePoints??[]])].slice(0,100),difficultyStars:r.difficultyStars??s.difficultyStars,questionType:r.questionType??s.questionType,wrongAnswer:ei(r.wrongAnswer,s.wrongAnswer)?.slice(0,2e4)??null,fix:null},n=[...e.items];return n.splice(a-1,2,i),ee(e,n)})(t,e.key)),children:[(0,t.jsx)(z,{className:"mr-1 h-4 w-4"}),C.importBatch.mergeUp]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",disabled:0===r,onClick:()=>d(t=>es(t,e.key,-1)),"aria-label":C.importBatch.moveUp,children:(0,t.jsx)(b,{className:"h-4 w-4"})}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",disabled:r===s-1,onClick:()=>d(t=>es(t,e.key,1)),"aria-label":C.importBatch.moveDown,children:(0,t.jsx)(g,{className:"h-4 w-4"})}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>d(t=>er(t,e.key)),children:[(0,t.jsx)(R.f,{className:"mr-1 h-4 w-4"}),C.importBatch.delete]})]})]})]})}function ew({count:e,missingRegions:a,pendingFixes:r=0,imageQuestions:s=0,confirmBeforeImport:i,starting:n,onStart:c,onDiscard:o,source:d,analysisMode:m,onAnalysisModeChange:u,hasTargetNotebook:h}){let{t:p}=(0,x.b)(),f="none"===m,g="tags"===m,y=f?(i?p.importBatch.startNoneReview:p.importBatch.startNoneAuto).replace("{count}",String(e)):g?(i?p.importBatch.startTagsReview:p.importBatch.startTagsAuto).replace("{count}",String(e)):(i?p.importBatch.startReview:p.importBatch.startAuto).replace("{count}",String(e)),b=0===e?p.importBatch.nothingSelected:a>0?p.importBatch.needsRegion.replace("{count}",String(a)):f?p.importBatch.startHintNone:g?p.importBatch.startHintTags:r>0?p.importBatch.fixText.pendingHint.replace("{count}",String(r)):s>0?p.importBatch.startHintAiWithImage:i?p.importBatch.startHintReview:p.importBatch.startHintAuto,j=(f||g)&&!h,w=j?p.importBatch.startNoneNoTarget:void 0;return(0,t.jsx)("div",{className:"fixed inset-x-0 bottom-[calc(4rem+env(safe-area-inset-bottom))] z-30 border-t bg-background/95 py-3 pl-4 pr-16 shadow-[0_-4px_12px_rgba(0,0,0,0.06)] backdrop-blur md:sticky md:bottom-4 md:rounded-xl md:border md:px-4","data-testid":"draft-start-bar",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-4xl flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:["text"===d&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",role:"radiogroup","aria-label":p.importBatch.analysisModeLabel,children:[(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":"ai"===m,disabled:!!n,onClick:()=>u("ai"),className:`rounded-full border px-2.5 py-1 transition-colors ${"ai"===m?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:border-primary/40"}`,"data-testid":"draft-analysis-ai",children:p.importBatch.analysisAi}),(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":g,disabled:!!n||j,onClick:()=>u("tags"),title:w,className:`rounded-full border px-2.5 py-1 transition-colors ${g?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:border-primary/40"} disabled:cursor-not-allowed disabled:opacity-50`,"data-testid":"draft-analysis-tags",children:p.importBatch.analysisTags}),(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":f,disabled:!!n||j,onClick:()=>u("none"),title:w,className:`rounded-full border px-2.5 py-1 transition-colors ${f?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:border-primary/40"} disabled:cursor-not-allowed disabled:opacity-50`,"data-testid":"draft-analysis-none",children:p.importBatch.analysisNone})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground md:max-w-md","data-testid":"draft-start-hint",children:n??b})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(ex.f,{type:"button",variant:"ghost",onClick:o,disabled:!!n,className:"shrink-0",children:p.importBatch.discard}),(0,t.jsxs)(ex.f,{type:"button",onClick:c,disabled:0===e||!!n,className:"min-w-0 flex-1 md:flex-none","data-testid":"draft-start",children:[n?(0,t.jsx)(l.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(A.f,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{className:"truncate",children:y})]})]})]})})}function ev({ignored:e,onRestore:r}){let{t:s}=(0,x.b)(),[i,n]=(0,a.useState)(!1);return 0===e.length?null:(0,t.jsxs)("section",{className:"rounded-xl border p-3",children:[(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between text-left text-sm font-medium",onClick:()=>n(e=>!e),"aria-expanded":i,children:[s.importBatch.ignoredTitle.replace("{count}",String(e.length)),i?(0,t.jsx)(w.f,{className:"h-4 w-4"}):(0,t.jsx)(j.f,{className:"h-4 w-4"})]}),i&&(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.importBatch.ignoredHint}),(0,t.jsx)("ul",{className:"space-y-2",children:e.map((e,a)=>(0,t.jsxs)("li",{className:"flex items-start gap-2 rounded-lg bg-muted/50 p-2 text-sm",children:[(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words text-muted-foreground",children:e}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"outline",className:"h-7 shrink-0",onClick:()=>r(a),children:s.importBatch.addAsQuestion})]},`${a}-${e.slice(0,20)}`))})]})]})}function ek({imageUrl:e,items:r,onSelectItem:s,highlightedKey:i}){let{t:n}=(0,x.b)(),[l,c]=(0,a.useState)(!0);return(0,t.jsxs)("section",{className:"rounded-xl border bg-card p-3","data-testid":"page-image-overview",children:[(0,t.jsxs)(ex.f,{type:"button",variant:"ghost",size:"sm",className:"mb-2 h-8 px-2 md:hidden",onClick:()=>c(e=>!e),"aria-expanded":l,children:[l?(0,t.jsx)(w.f,{className:"mr-1 h-4 w-4"}):(0,t.jsx)(j.f,{className:"mr-1 h-4 w-4"}),l?n.importBatch.hideImage:n.importBatch.showImage]}),(0,t.jsxs)("div",{className:(0,em.f)("relative mx-auto w-fit max-w-full",!l&&"hidden md:block"),children:[(0,t.jsx)("img",{src:e,alt:"",className:"block max-h-[70vh] max-w-full select-none rounded-md",draggable:!1}),r.map((e,a)=>e.regions.map((r,l)=>(0,t.jsx)("button",{type:"button",onClick:()=>s(e.key),className:(0,em.f)("absolute rounded-sm border-2 transition-colors",e.selected?"border-primary bg-primary/10":"border-dashed border-muted-foreground/70 bg-transparent",i===e.key&&"border-amber-500 bg-amber-400/20"),style:{left:`${100*r.x}%`,top:`${100*r.y}%`,width:`${100*r.width}%`,height:`${100*r.height}%`},"aria-label":n.importBatch.question.replace("{index}",String(a+1)),children:0===l&&(0,t.jsx)("span",{className:(0,em.f)("absolute -left-0.5 -top-0.5 rounded-br-md px-1.5 text-xs font-semibold text-white",e.selected?"bg-primary":"bg-muted-foreground"),children:a+1})},`${e.key}-${l}`)))]})]})}var eN=e.i(232660),eB=e.i(776639);let eS={x:.1,y:.1,width:.8,height:.3};function eC(e){return{unit:"%",x:100*e.x,y:100*e.y,width:100*e.width,height:100*e.height}}function ez(e){let t={x:e.x/100,y:e.y/100,width:e.width/100,height:e.height/100};return t.width>=.01&&t.height>=.01?t:null}function eT({open:e,imageUrl:r,regions:s,onClose:i,onSave:n}){let{t:l}=(0,x.b)(),[o,d]=(0,a.useState)(()=>(s.length?s:[eS]).map(eC)),[m,u]=(0,a.useState)(0),h=o[Math.min(m,o.length-1)];return(0,t.jsx)(eB.N,{open:e,onOpenChange:e=>!e&&i(),children:(0,t.jsxs)(eB.d,{className:"flex h-[90vh] max-w-3xl flex-col gap-0 p-0",children:[(0,t.jsxs)(eB.s,{className:"shrink-0 border-b p-4",children:[(0,t.jsx)(eB.F,{children:l.importBatch.regionDialogTitle}),(0,t.jsx)(eB.C,{children:l.importBatch.regionDialogHint})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto bg-black p-3",children:(0,t.jsx)("div",{className:"mx-auto w-fit",children:(0,t.jsx)(eN.f,{crop:h,onChange:(e,t)=>d(e=>e.map((e,a)=>a===m?t:e)),children:(0,t.jsx)("img",{src:r,alt:"",className:"block max-h-[65vh] max-w-full",draggable:!1})})})}),(0,t.jsxs)("div",{className:"shrink-0 space-y-3 border-t p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[o.map((e,a)=>(0,t.jsx)("button",{type:"button",onClick:()=>u(a),className:(0,em.f)("rounded-md border px-3 py-1 text-sm",a===m?"border-primary bg-primary/10 font-medium":"text-muted-foreground"),children:l.importBatch.regionTab.replace("{index}",String(a+1))},a)),o.length<4&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:()=>{d(e=>[...e,eC(eS)]),u(o.length)},children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),l.importBatch.addRegion]}),o.length>1&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>{d(e=>e.filter((e,t)=>t!==m)),u(0)},children:[(0,t.jsx)(R.f,{className:"mr-1 h-4 w-4"}),l.importBatch.removeRegion]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(ex.f,{type:"button",variant:"outline",onClick:i,children:l.common.cancel}),(0,t.jsx)(ex.f,{type:"button",onClick:()=>{let e=o.map(ez).filter(e=>null!==e);e.length&&n(e)},children:l.importBatch.saveRegion})]})]})]})})}let eI={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]};eI.node;let eA=(0,o.f)(eI);function eR({targetCount:e,pendingCount:a,fixing:r,onFix:s,onAcceptAll:i}){let{t:n}=(0,x.b)();return(0,t.jsxs)("div",{className:"space-y-1 rounded-lg border border-dashed p-3","data-testid":"text-fix-toolbar",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:s,disabled:r||0===e,children:[r?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(A.f,{className:"mr-1 h-4 w-4"}),r?n.importBatch.fixText.running:n.importBatch.fixText.selected.replace("{count}",String(e))]}),a>0&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:i,children:[(0,t.jsx)(eA,{className:"mr-1 h-4 w-4"}),n.importBatch.fixText.acceptAll.replace("{count}",String(a))]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.importBatch.fixText.hint})]})}var e$=e.i(767077),eM=e.i(499930),eE=e.i(294114),eq=e.i(201276),eF=e.i(119472),eP=e.i(213761),eD=e.i(132411),eU=e.i(41931);function e_(e){return`import-batch-text-fix:${e}`}function eO(e){try{sessionStorage.removeItem(e_(e))}catch{}}function eH({batch:e,draft:r,onEdit:s,onUndo:i,canUndo:o,saveState:d,image:u,confirmBeforeImport:h,starting:f,onStart:g,onDiscard:y,analysisMode:b,onAnalysisModeChange:j,hasConflictCopy:w,onRestoreConflict:v,onDismissConflict:k}){let{t:N}=(0,x.b)(),B=e.source,[S,C]=(0,a.useState)(null),[z,T]=(0,a.useState)(null),[I,A]=(0,a.useState)(null),R=r.items.filter(e=>e.selected&&X(e,B)),$=r.items.length>0&&r.items.every(e=>e.selected||!X(e,B)),M=r.items.filter(e=>e.selected&&!X(e,B)).length,E=function(e,t,r){let{t:s}=(0,x.b)(),[i,n]=(0,a.useState)([]),l=`import-batch:${e}:fix-text`,{running:c,refresh:o}=(0,eD.f)(l),d=(0,a.useRef)(!1),m=(0,a.useRef)(!1),u=(0,a.useRef)(!1),h=(0,a.useCallback)(e=>{e.fixes.length>0&&r(t=>{let a,r,s;return a=new Map(e.fixes.map(e=>[e.key,e])),r=!1,s=t.items.map(e=>{let t=a.get(e.key);return t&&e.text===t.original&&t.text!==t.original?(r=!0,{...e,fix:{original:t.original,text:t.text,uncertain:t.uncertain}}):e}),r?ee(t,s):t});let t=[e.fixes.length>0?s.importBatch.fixText.done.replace("{count}",String(e.fixes.length)):null,e.unchanged.length>0?s.importBatch.fixText.unchanged.replace("{count}",String(e.unchanged.length)):null,e.failed.length>0?s.importBatch.fixText.failed.replace("{count}",String(e.failed.length)):null].filter(Boolean).join(" ");e.failed.length>0?eE.c.warning(t):eE.c.success(t)},[r,s]),p=(0,a.useCallback)(async a=>{let r=t.items.filter(e=>a.includes(e.key)&&e.text.trim()).map(e=>({key:e.key,text:e.text}));if(0===r.length)return;let i=(0,eU.j)();var l={requestId:i,keys:r.map(e=>e.key)};try{sessionStorage.setItem(e_(e),JSON.stringify(l))}catch{}n(r.map(e=>e.key)),d.current=!0;try{let t=await (0,eF.$)(e,r,i);h(t)}catch(e){e instanceof eU.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING"?(eE.c.info(s.errors.TASK_ALREADY_RUNNING),await o()):(eq.V.error("[ImportBatch]","Text fix failed",{error:e}),eE.c.error((0,e$.f)(e,s)))}finally{n([])}},[e,t,h,o,s]);(0,a.useEffect)(()=>{if(!c)return;let t=function(e){try{let t=sessionStorage.getItem(e_(e));return t?JSON.parse(t):null}catch{return null}}(e);if(t?.requestId&&!d.current){let a=Date.now()+6e5;(0,eU.u)(t.requestId,a,Error("REQUEST_NOT_FOUND")).then(t=>{u.current=!0,h(t),eO(e)}).catch(e=>{eq.V.warn("[ImportBatch]","Text fix recovery failed",{error:e})})}},[c,e,h]);let f=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(c){f.current=!0,m.current=!1;return}f.current&&(f.current=!1,eO(e),d.current||u.current||m.current||(m.current=!0,eE.c.info(s.importBatch.fixText.waitingOtherDevice)),d.current=!1,u.current=!1)},[c,e,s]),{fix:p,fixingKeys:i,fixing:i.length>0||!!c}}(e.id,r,s),q=function(e,t,r,s){let{t:i,language:n}=(0,x.b)(),l=(0,a.useRef)(null),c=(0,a.useRef)(null),[o,d]=(0,a.useState)(null),[m,u]=(0,a.useState)([]),h=async a=>{let l=a.target.files?.[0];a.target.value="";let o=r.items.find(e=>e.key===c.current);if(l&&o&&t){d(o.key);try{let a=await (0,eP.p)(l);try{let r=await (0,eM.y)(t),l=await (0,eM.k)(r,o.regions,a),c={...(0,eP.N)(a,l),sourceType:"continuation"},d=await (0,eF.v)({source:"image",imageBase64:l.dataUrl,imageInfo:c,language:n,subjectId:e.subjectId,targetSubjectId:e.targetSubjectId,paperLevel:e.paperLevel});s(e=>er(e,o.key)),u(e=>[...e,d.id]),eq.V.info("[ImportBatch]","Continuation batch created",{batchId:d.id,...c}),eE.c.success(i.importBatch.continuation.created)}finally{a.dispose()}}catch(e){eq.V.error("[ImportBatch]","Continuation failed",{error:e}),eE.c.error(e instanceof eP.o?i.upload.decodeErrors[e.code].replace("{format}",e.format.toUpperCase()):(0,e$.f)(e,i))}finally{d(null)}}};return{pick:e=>{c.current=e,l.current?.click()},busyKey:o,created:m,inputProps:{ref:l,onChange:e=>void h(e)}}}(e,u?.url??null,r,s),F="text"===B?r.items.filter(e=>e.fix&&e.fix.original===e.text).length:0,P="text"===B?R.filter(e=>!(e.fix&&e.fix.original===e.text)).map(e=>e.key):[];return(0,t.jsxs)("div",{className:"space-y-4 pb-36 md:pb-24",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-base font-semibold","data-testid":"draft-summary",children:[N.importBatch.detected.replace("{count}",String(r.items.length)),(0,t.jsx)("span",{className:"mx-2 text-muted-foreground",children:"·"}),N.importBatch.selected.replace("{count}",String(R.length))]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)("span",{className:"mr-2 flex items-center gap-1 text-xs text-muted-foreground","aria-live":"polite","data-testid":"draft-save-state","data-state":d,children:["saving"===d&&(0,t.jsx)(l.f,{className:"h-3 w-3 animate-spin"}),N.importBatch.save[d]]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",disabled:!o,onClick:i,children:[(0,t.jsx)(m,{className:"mr-1 h-4 w-4"}),N.importBatch.undo]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:()=>s(e=>(function(e,t,a=()=>!0){return ee(e,e.items.map(e=>({...e,selected:t&&a(e)})))})(e,!$,e=>X(e,B))),children:$?N.importBatch.selectNone:N.importBatch.selectAll})]})]}),w&&(0,t.jsxs)("div",{className:"space-y-2 rounded-lg border border-primary/40 bg-primary/5 p-3 text-sm",role:"status","data-testid":"draft-conflict",children:[(0,t.jsx)("p",{children:N.importBatch.conflictKept}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(ex.f,{type:"button",size:"sm",onClick:v,children:N.importBatch.restoreMine}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:k,children:N.importBatch.discardMine})]})]}),"text"===B&&r.items.length>0&&(0,t.jsx)(eR,{targetCount:P.length,pendingCount:F,fixing:E.fixing,onFix:()=>void E.fix(P),onAcceptAll:()=>s(e=>en(e))}),r.warnings.length>0&&(0,t.jsx)("ul",{className:"space-y-1 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200",children:r.warnings.map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-2",children:[(0,t.jsx)(n.f,{className:"mt-0.5 h-4 w-4 shrink-0"}),N.importBatch.warnings[e]]},e))}),(0,t.jsx)(p,{inputProps:q.inputProps,created:q.created}),u&&(0,t.jsx)(ek,{imageUrl:u.url,items:r.items,onSelectItem:e=>{T(e),C(e),document.getElementById(`draft-item-${e}`)?.scrollIntoView({behavior:"smooth",block:"center"})},highlightedKey:z}),0===r.items.length?(0,t.jsx)("p",{className:"rounded-xl border border-dashed p-6 text-center text-sm text-muted-foreground",children:N.importBatch.emptyDraft}):(0,t.jsx)("ol",{className:"space-y-3",children:r.items.map((e,a)=>{var i;return(0,t.jsx)(ej,{item:e,index:a,total:r.items.length,source:B,expanded:S===e.key,onToggleExpand:()=>C(t=>t===e.key?null:e.key),onEdit:s,image:u,onAdjustRegion:()=>A({key:e.key,regions:e.regions}),highlighted:z===e.key,onFixText:"text"===B?()=>void E.fix([e.key]):void 0,fixing:E.fixingKeys.includes(e.key),fixBusy:E.fixing,onContinue:u&&(i=r.items.length,e.regions.length>0&&(e.flags.includes("partial")||a===i-1))?()=>q.pick(e.key):void 0,continuing:q.busyKey===e.key},e.key)})}),u&&(0,t.jsxs)(ex.f,{type:"button",variant:"outline",size:"sm",onClick:()=>A({key:null,regions:[]}),children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),N.importBatch.addQuestion]}),(0,t.jsx)(ev,{ignored:r.ignored,onRestore:e=>s(t=>(function(e,t){let a=e.ignored[t];if(void 0===a||e.items.length>=L.S)return e;let r={key:W(e.items.map(e=>e.key)),label:null,text:a,material:null,section:null,selected:!0,regions:[],hasFigure:!1,flags:[]};return{...e,items:[...e.items,r],ignored:e.ignored.filter((e,a)=>a!==t)}})(t,e))}),(0,t.jsx)(ew,{count:R.length,missingRegions:M,pendingFixes:F,imageQuestions:R.filter(e=>!!e.image).length,confirmBeforeImport:h,starting:f,onStart:g,onDiscard:y,source:B,analysisMode:b,onAnalysisModeChange:j,hasTargetNotebook:!!e.targetSubjectId||!!e.subjectId}),u&&I&&(0,t.jsx)(eT,{open:!0,imageUrl:u.url,regions:I.regions,onClose:()=>A(null),onSave:e=>{let t=I.key;s(a=>t?ea(a,t,{regions:e,selected:!0}):function(e,t){if(e.items.length>=L.S)return e;let a={key:W(e.items.map(e=>e.key)),label:null,text:"",material:null,section:null,selected:!0,regions:[t],hasFigure:!1,flags:[]};return{...e,items:[...e.items,a]}}(a,e[0])),A(null)}})]})}var eL=e.i(399847),eV=e.i(395925);function eK({batch:e,busy:a,onRetry:r,onDiscard:s}){let{t:i}=(0,x.b)(),n=i.errors,c=e.error?"string"==typeof n[e.error]?n[e.error]:e.error:null;return"splitting"===e.phase?(0,t.jsxs)("section",{className:"flex items-start gap-3 rounded-xl border bg-card p-4",role:"status","data-testid":"batch-splitting",children:[(0,t.jsx)(l.f,{className:"mt-0.5 h-5 w-5 shrink-0 animate-spin text-primary"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)("p",{className:"font-medium",children:i.importBatch.phase.splitting}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i.importBatch.splittingHint}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:s,children:i.importBatch.discard})]})]}):(0,t.jsxs)("section",{className:"flex items-start gap-3 rounded-xl border border-destructive/40 bg-card p-4","data-testid":"batch-failed",children:[(0,t.jsx)(eL.f,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)("p",{className:"font-medium",children:i.importBatch.phase.failed}),c&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:c}),"image"===e.source&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i.importBatch.manualFallback}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:r,disabled:a,children:[(0,t.jsx)(eV.f,{className:"mr-1 h-4 w-4"}),i.importBatch.retrySplit]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:s,children:i.importBatch.discard})]})]})]})}var eG=e.i(551757),eQ=e.i(615568),eY=e.i(168148);let eJ={analyzing:.5,saving:.9,review:1,saved:1,failed:1};function eW({task:e}){let{t:a}=(0,x.b)(),r=a.importBatch.itemStatus;if("saved"===e.status){let a=e.errorItemId?e.duplicate?r.duplicate:r.saved:r.deleted;return(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-700 dark:text-green-300",children:[(0,t.jsx)(eG.f,{className:"h-4 w-4"}),a]})}return"failed"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-destructive",children:[(0,t.jsx)(eL.f,{className:"h-4 w-4"}),r.failed]}):"review"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-primary",children:[(0,t.jsx)(eQ.f,{className:"h-4 w-4"}),r.review]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,t.jsx)(l.f,{className:"h-4 w-4 animate-spin"}),r[e.status]]})}function eX({batch:e,image:a,busy:s,onRetryFailed:i,onRetryOne:n,onConfirmAll:l}){let{t:c}=(0,x.b)(),{counts:o}=e,d=o.total-o.active,m=o.total?Math.round(e.tasks.reduce((e,t)=>e+eJ[t.status],0)/o.total*100):0,u=new Map((e.draft?.items??[]).map((e,t)=>[e.key,{item:e,index:t}])),h=c.errors;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("section",{className:"space-y-3 rounded-xl border bg-card p-4","data-testid":"batch-progress","data-phase":e.phase,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-base font-semibold",children:c.importBatch.progress.replace("{done}",String(d)).replace("{total}",String(o.total))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.stageEstimate})]}),(0,t.jsx)(eY.f,{value:m,"aria-label":c.importTasks.stageEstimate,"aria-valuetext":c.common.progress.estimated.replace("{percent}",String(m)),className:"h-2"}),(0,t.jsxs)("ul",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm","data-testid":"batch-counts",children:[(0,t.jsx)("li",{className:"text-green-700 dark:text-green-300",children:c.importBatch.counts.saved.replace("{count}",String(o.saved-o.duplicate))}),o.duplicate>0&&(0,t.jsx)("li",{className:"text-muted-foreground",children:c.importBatch.counts.duplicate.replace("{count}",String(o.duplicate))}),o.review>0&&(0,t.jsx)("li",{className:"text-primary",children:c.importBatch.counts.review.replace("{count}",String(o.review))}),o.failed>0&&(0,t.jsx)("li",{className:"text-destructive",children:c.importBatch.counts.failed.replace("{count}",String(o.failed))}),o.active>0&&(0,t.jsx)("li",{className:"text-muted-foreground",children:c.importBatch.counts.active.replace("{count}",String(o.active))})]}),o.active>0&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importBatch.leaveHint}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[o.failed>0&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:i,disabled:s,children:[(0,t.jsx)(eV.f,{className:"mr-1 h-4 w-4"}),c.importBatch.retryFailed.replace("{count}",String(o.failed))]}),o.review>0&&(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:l,disabled:s,children:c.importBatch.confirmAll.replace("{count}",String(o.review))})]})]}),(0,t.jsx)("ol",{className:"space-y-3",children:e.tasks.map(e=>{let i=u.get(e.batchItemKey??""),l=e.error?"string"==typeof h[e.error]?h[e.error]:e.error:null;return(0,t.jsxs)("li",{className:(0,em.f)("flex gap-3 rounded-xl border bg-card p-3 text-sm",e.unread&&"review"===e.status&&"border-primary/50"),"data-testid":"batch-task","data-status":e.status,children:[a&&i&&i.item.regions.length>0&&(0,t.jsx)(eu,{imageUrl:a.url,imageSize:a,regions:i.item.regions,className:"w-20 shrink-0 self-start sm:w-28"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:c.importBatch.question.replace("{index}",String((i?.index??0)+1))}),(0,t.jsx)(eW,{task:e})]}),(0,t.jsx)("p",{className:"line-clamp-2 break-words text-muted-foreground",children:e.excerpt||i?.item.text}),"saved"===e.status&&e.errorItemId&&!e.duplicate&&e.notebookName&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.savedTo.replace("{notebook}",e.notebookName).replace("{id}",e.errorItemShortId||"-")}),l&&"failed"===e.status&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:l}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:["review"===e.status&&(0,t.jsx)(ex.f,{asChild:!0,size:"sm",children:(0,t.jsx)(r.default,{href:`/import-tasks/${e.id}`,children:c.importBatch.review})}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)(ex.f,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsx)(r.default,{href:`/error-items/${e.errorItemId}`,children:c.importBatch.viewItem})}),"failed"===e.status&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:()=>n(e),disabled:s,children:[(0,t.jsx)(eV.f,{className:"mr-1 h-3 w-3"}),c.importTasks.retry]})]})]})]},e.id)})})]})}var eZ=e.i(912505),e0=e.i(393842),e1=e.i(86963),e2=e.i(127175),e4=e.i(35209),e5=e.i(25197);e.s(["default",0,function(){let e=(0,s.useParams)(),n=(0,s.useRouter)(),l=e.id,{t:c}=(0,x.b)();(0,e4.f)(c.importBatch.title);let o=function(e,t={}){let[r,s]=(0,a.useState)(null),[i,n]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null),[o,d]=(0,a.useState)("saved"),m=(0,a.useRef)([]),[u,h]=(0,a.useState)(!1),x=(0,a.useRef)(0),p=(0,a.useRef)(0),f=(0,a.useRef)(0),g=(0,a.useRef)(null),y=(0,a.useRef)(null),b=(0,a.useRef)(null),j=(0,a.useRef)(async()=>!0),[w,v]=(0,a.useState)(null),k=(0,a.useRef)(t.onConflict);(0,a.useEffect)(()=>{k.current=t.onConflict},[t.onConflict]);let N=(0,a.useCallback)((e,t=!1)=>{s(t=>t&&!e.imageData&&t.imageData&&t.id===e.id?{...e,imageData:t.imageData}:e);let a=p.current!==f.current;(t||!a||"draft"!==e.status)&&(null!==g.current&&e.version!==x.current&&(m.current=[],h(!1)),x.current=e.version,g.current=e.draft,c(e.draft),f.current=p.current,d("saved"))},[]),B=(0,a.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{N(await (0,eF.w)(e)),n(!1)}catch(e){e?.status===404&&n(!0)}},[e,N]);(0,a.useEffect)(()=>{let t=!1;(0,eF.w)(e,{image:!0}).then(e=>{t||N(e,!0)}).catch(e=>{t||e?.status!==404||n(!0)});let a=(0,e2.E)(()=>void B());return()=>{t=!0,a()}},[e,N,B]);let S=r?.phase==="splitting"||r?.phase==="processing";(0,a.useEffect)(()=>{if(!S)return;let e=setInterval(()=>void B(),2500);return()=>clearInterval(e)},[S,B]);let C=(0,a.useCallback)(async()=>{let t=p.current;d("saving");try{let a=await (0,eF.S)(e,x.current,g.current);return x.current=a.version,f.current=t,s(e=>e?{...a,imageData:e.imageData}:a),d(p.current===t?"saved":"dirty"),"ok"}catch(t){let e=(0,eF.n)(t);if(e){let t=g.current;return"draft"===e.status&&t&&v(t),N(e,!0),k.current?.(),"conflict"}return d("error"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>void j.current(),5e3),"error"}},[e,N]),z=(0,a.useCallback)(async()=>{for(b.current&&(clearTimeout(b.current),b.current=null);;){let e=y.current??(y.current=(async()=>{try{for(;p.current!==f.current&&g.current;)if(await C()!=="ok")return!1;return!0}finally{y.current=null}})());if(!await e)return!1;if(p.current===f.current)return!0}},[C]);(0,a.useEffect)(()=>{j.current=z},[z]),(0,a.useEffect)(()=>{let e=()=>{"hidden"===document.visibilityState&&p.current!==f.current&&z()};return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("pagehide",e)}},[z]),(0,a.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let T=(0,a.useCallback)(e=>{g.current=e,c(e),p.current+=1,d("dirty"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>void z(),800)},[z]),I=(0,a.useRef)(null),A=(0,a.useCallback)((e,t)=>{let a=g.current;if(!a)return;let r=e(a);if(r===a)return;let s=Date.now(),i=t&&I.current?.group===t&&s-I.current.at<1500;I.current=t?{group:t,at:s}:null,i||(m.current=[...m.current.slice(-29),a],h(!0)),T(r)},[T]),R=(0,a.useCallback)(()=>{let e=m.current.pop();I.current=null,h(m.current.length>0),e&&T(e)},[T]),$=(0,a.useCallback)(()=>{v(null),w&&A(()=>w)},[w,A]);return{batch:r,draft:l,notFound:i,saveState:o,refresh:B,save:z,edit:A,undo:R,canUndo:u,conflictCopy:w,restoreConflictCopy:$,dismissConflictCopy:()=>v(null),version:()=>x.current,replace:e=>N(e,!0)}}(l,{onConflict:()=>eE.c.info(c.importBatch.conflict)}),{batch:d,draft:m,notFound:u}=o,h=function(e){let[t,r]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;let t=!1,a=new Image;return a.onload=()=>{t||r({url:e,width:a.naturalWidth,height:a.naturalHeight})},a.src=e,()=>{t=!0}},[e]),t&&t.url===e?t:null}(d?.source==="image"?d.imageData:null),[p,f]=(0,a.useState)(null),[g,y]=(0,a.useState)(null),[b,j]=(0,a.useState)(!1),[w,v]=(0,a.useState)("ai"),k=(0,a.useRef)(null),[N,B]=(0,a.useState)(null);if(m!==N&&(B(m),m&&d?.source==="text")){let e=Z(m,"text");v(e.length>0&&e.every(e=>e.answer?.trim())?"tags":"ai")}if((0,a.useEffect)(()=>{(0,e5.x)().then(f)},[]),(0,a.useEffect)(()=>{d?.unread&&k.current!==`${d.id}:${d.phase}:${d.counts.active}`&&(k.current=`${d.id}:${d.phase}:${d.counts.active}`,(0,eF.f)(d.id).catch(e=>eq.V.warn("[ImportBatch]","Mark read failed",{error:e})))},[d]),u)return(0,t.jsx)("main",{className:"mx-auto max-w-3xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsx)(eZ.f,{icon:i.f,title:c.importBatch.notFound,action:(0,t.jsx)(r.default,{href:"/import-tasks",children:(0,t.jsx)(ex.f,{children:c.importTasks.viewTasks})})})});if(!d||null===p||"image"===d.source&&"draft"===d.status&&!h)return(0,t.jsx)(e1.f,{});let S=async e=>{j(!0);try{await e()}catch(t){let e=(0,eF.n)(t);e?(o.replace(e),eE.c.info(c.importBatch.conflict)):eE.c.error((0,e$.f)(t,c))}finally{j(!1)}},C=async()=>{if(m){y(c.importBatch.submitting);try{let e;if(!await o.save())return;if("image"===d.source){if(!d.imageData)throw Error("IMAGE_EMPTY");let t=await (0,eM.y)(d.imageData),a=Z(m,"image");e=[];let r=0;for(let s of a){y(c.importBatch.cropping.replace("{done}",String(e.length+1)).replace("{total}",String(a.length)));let i=await (0,eM.M)(t,s.regions);r+=i.bytes,e.push({key:s.key,imageBase64:i.dataUrl,imageInfo:{outputWidth:i.width,outputHeight:i.height,outputBytes:i.bytes,quality:i.quality}})}if(e.reduce((e,t)=>e+t.imageBase64.length,0)>0x3c00000)return void eE.c.error(c.errors.IMPORT_BATCH_TOO_LARGE);y(c.importBatch.uploadingImages.replace("{count}",String(e.length)).replace("{size}",`${(r/1024/1024).toFixed(1)}MB`))}o.replace(await (0,eF.g)(d.id,o.version(),e,w)),window.scrollTo({top:0})}catch(t){eq.V.error("[ImportBatch]","Start failed",{error:t});let e=(0,eF.n)(t);e?(o.replace(e),eE.c.info(c.importBatch.conflict)):eE.c.error((0,e$.f)(t,c))}finally{y(null)}}},z=async()=>{await (0,eE.u)(c.importBatch.discardConfirm)&&await S(async()=>{await (0,eF.o)(d.id),eE.c.success(c.importBatch.discarded),n.push("/import-tasks")})},T=()=>S(async()=>{o.replace(await (0,eF.s)(d.id)),eE.c.info(c.importTasks.retried)}),I=`${c.importBatch.source[d.source]} \xb7 ${c.importBatch.phase[d.phase]}`;return(0,t.jsxs)("main",{className:"mx-auto max-w-4xl space-y-4 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(e0.f,{backHref:"/import-tasks",title:c.importBatch.title,description:I}),"splitting"===d.phase||"failed"===d.phase?(0,t.jsx)(eK,{batch:d,busy:b,onRetry:T,onDiscard:z}):"draft"===d.status&&m?(0,t.jsx)(eH,{batch:d,draft:m,onEdit:o.edit,onUndo:o.undo,canUndo:o.canUndo,saveState:o.saveState,image:h,confirmBeforeImport:p,starting:g,onStart:C,onDiscard:z,analysisMode:w,onAnalysisModeChange:v,hasConflictCopy:!!o.conflictCopy,onRestoreConflict:o.restoreConflictCopy,onDismissConflict:o.dismissConflictCopy}):(0,t.jsx)(eX,{batch:d,image:h,busy:b,onRetryFailed:T,onRetryOne:e=>S(async()=>{await (0,e2.R)(e.id),eE.c.info(c.importTasks.retried),await o.refresh()}),onConfirmAll:()=>S(async()=>{let e=await (0,eF.J)(d.id);o.replace(e.batch),eE.c.success(c.importBatch.confirmAllDone.replace("{count}",String(e.saved)))})})]})}],864272)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,864272,e=>{"use strict";var t=e.i(843476),a=e.i(271645),r=e.i(522016),s=e.i(618566),i=e.i(13285),n=e.i(853138),l=e.i(632781),c=e.i(77071),o=e.i(456420);let d={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};d.node;let m=(0,o.f)(d),u={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};u.node;let h=(0,o.f)(u);var x=e.i(111110);function p({inputProps:e,created:a}){let{t:s}=(0,x.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{type:"file",accept:"image/*",className:"hidden","data-testid":"continuation-input",...e}),a.length>0&&(0,t.jsx)("ul",{className:"space-y-1 rounded-lg border border-primary/40 bg-primary/5 p-3 text-sm","data-testid":"continuation-notice",children:a.map((e,a)=>(0,t.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 text-primary"}),s.importBatch.continuation.notice.replace("{n}",String(a+2))]}),(0,t.jsxs)(r.default,{href:`/import-batches/${e}`,className:"flex items-center gap-1 text-primary underline-offset-2 hover:underline",children:[s.importBatch.continuation.open,(0,t.jsx)(h,{className:"h-3 w-3"})]})]},e))})]})}let f={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};f.node;let g=(0,o.f)(f),y={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};y.node;let b=(0,o.f)(y);var j=e.i(716327),w=e.i(456539),v=e.i(508734);let k={name:"crop",size:24,node:[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]};k.node;let N=(0,o.f)(k),B={name:"file-plus-corner",size:24,node:[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],aliases:["file-plus-2"]};B.node;let S=(0,o.f)(B),C={name:"merge",size:24,node:[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]};C.node;let z=(0,o.f)(C),T={name:"scissors",size:24,node:[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]};T.node;let I=(0,o.f)(T);var A=e.i(328623),R=e.i(759659),$=e.i(263676),M=e.i(793479),E=e.i(110204),q=e.i(967489),F=e.i(624687),P=e.i(411382),D=e.i(978056),U=e.i(54105),_=e.i(772325),O=e.i(213056),H=e.i(282492),L=e.i(825624);let V=P.z.object({x:D.z.number().min(0).max(1),y:D.z.number().min(0).max(1),width:D.z.number().min(.01).max(1),height:D.z.number().min(.01).max(1)}).refine(e=>e.x+e.width<=1.0001&&e.y+e.height<=1.0001,{message:"REGION_OUT_OF_BOUNDS"}),K=["unclear","partial","unlocated"],G=U.z.string().max(1572864,"DRAFT_IMAGE_TOO_LARGE").regex(/^data:image\/(?:jpeg|png|webp);base64,[A-Za-z0-9+/]+=*$/,"DRAFT_IMAGE_INVALID"),Q=P.z.object({original:U.z.string().max(2e4),text:U.z.string().max(2e4),uncertain:_.z.array(U.z.string().max(200)).max(20)}),Y=P.z.object({key:U.z.string().regex(/^[A-Za-z0-9_-]{1,40}$/),label:U.z.string().max(20).nullable(),text:U.z.string().max(2e4),material:U.z.string().max(2e4).nullable(),section:U.z.string().max(500).nullable(),selected:O.z.boolean(),regions:_.z.array(V).max(4),hasFigure:O.z.boolean(),flags:_.z.array(H.z.enum(K)).max(K.length),fix:Q.nullish(),answer:U.z.string().max(2e4).nullish(),analysis:U.z.string().max(2e4).nullish(),knowledgePoints:_.z.array(U.z.string().max(200)).max(100).optional(),difficultyStars:D.z.number().int().min(1).max(5).nullish(),questionType:U.z.string().max(200).nullish(),wrongAnswer:U.z.string().max(2e4).nullish(),image:G.nullish()}),J=["blurry","partial","truncated","tooMany"];function W(e=[]){let t=new Set(e);for(;;){let e=`q${Math.random().toString(36).slice(2,10)}`;if(!t.has(e))return e}}function X(e,t){return"image"===t?e.regions.length>0:e.text.trim().length>0}function Z(e,t){return e.items.filter(e=>e.selected&&X(e,t))}function ee(e,t){return{...e,items:t}}function et(e,t){return e.items.findIndex(e=>e.key===t)}function ea(e,t,a){return ee(e,e.items.map(e=>{if(e.key!==t)return e;let r={...e,...a};return void 0!==a.text&&(r.text=a.text.slice(0,2e4),r.text!==e.text&&(r.fix=null)),void 0!==a.answer&&(r.answer=a.answer?.slice(0,2e4)??null),void 0!==a.analysis&&(r.analysis=a.analysis?.slice(0,2e4)??null),void 0!==a.knowledgePoints&&(r.knowledgePoints=a.knowledgePoints.slice(0,100).map(e=>e.slice(0,200))),void 0!==a.difficultyStars&&(r.difficultyStars=a.difficultyStars),void 0!==a.questionType&&(r.questionType=a.questionType),void 0!==a.wrongAnswer&&(r.wrongAnswer=a.wrongAnswer?.slice(0,2e4)??null),void 0!==a.regions&&(r.regions=a.regions.slice(0,4),r.flags=r.regions.length>0?e.flags.filter(e=>"unlocated"!==e):[...new Set([...e.flags,"unlocated"])]),r}))}function er(e,t){return ee(e,e.items.filter(e=>e.key!==t))}function es(e,t,a){let r=et(e,t),s=r+a;if(r<0||s<0||s>=e.items.length)return e;let i=[...e.items];return[i[r],i[s]]=[i[s],i[r]],ee(e,i)}function ei(e,t){return[e,t].filter(e=>e?.trim()).join("\n").trim()||null}function en(e,t){let a=t?new Set(t):null,r=!1,s=e.items.map(e=>e.fix&&(!a||a.has(e.key))?(r=!0,e.fix.original===e.text?{...e,text:e.fix.text,fix:null}:{...e,fix:null}):e);return r?ee(e,s):e}P.z.object({items:_.z.array(Y).max(L.S),ignored:_.z.array(U.z.string().max(2e4)).max(200),warnings:_.z.array(H.z.enum(J)).max(J.length)}).superRefine((e,t)=>{let a=new Set;for(let r of e.items)a.has(r.key)&&t.addIssue({code:"custom",message:"DUPLICATE_ITEM_KEY"}),a.add(r.key)});var el=e.i(401280);let ec=[1,2,3,4,5],eo=[el.O,...el.V];function ed({item:e,onEdit:r}){let{t:s}=(0,x.b)(),[i,n]=(0,a.useState)(!1),l=!!(e.answer?.trim()||e.analysis?.trim()||e.knowledgePoints?.length||null!=e.difficultyStars||e.wrongAnswer?.trim());return(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-2",children:[(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between text-xs font-medium text-muted-foreground",onClick:()=>n(e=>!e),"aria-expanded":i,children:[(0,t.jsx)("span",{children:s.importBatch.fields.title}),i?(0,t.jsx)(w.f,{className:"h-3.5 w-3.5"}):(0,t.jsx)(j.f,{className:"h-3.5 w-3.5"})]}),i&&(0,t.jsxs)("div",{className:"mt-2 space-y-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-type`,className:"text-xs",children:s.questionType.label}),(0,t.jsxs)(q.d,{value:e.questionType??el.O,onValueChange:t=>r(a=>ea(a,e.key,{questionType:t===el.O?null:(0,el.P)(t)})),children:[(0,t.jsx)(q.P,{className:"h-8 w-full text-sm","aria-label":s.questionType.label,children:(0,t.jsx)(q.U,{})}),(0,t.jsx)(q.r,{children:eo.map(e=>(0,t.jsx)(q.T,{value:e,children:e===el.O?s.questionType.notSet:s.questionType.names[e]},e))})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-answer`,className:"text-xs",children:s.importBatch.fields.answer}),(0,t.jsx)(F.f,{id:`${e.key}-answer`,value:e.answer??"",onChange:t=>r(a=>ea(a,e.key,{answer:t.target.value})),className:"min-h-16 text-sm",placeholder:s.importBatch.fields.answerPlaceholder})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-analysis`,className:"text-xs",children:s.importBatch.fields.analysis}),(0,t.jsx)(F.f,{id:`${e.key}-analysis`,value:e.analysis??"",onChange:t=>r(a=>ea(a,e.key,{analysis:t.target.value})),className:"min-h-20 text-sm",placeholder:s.importBatch.fields.analysisPlaceholder})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-knowledge`,className:"text-xs",children:s.importBatch.fields.knowledgePoints}),(0,t.jsx)(M.f,{id:`${e.key}-knowledge`,value:(e.knowledgePoints??[]).join(", "),onChange:t=>r(a=>ea(a,e.key,{knowledgePoints:t.target.value.split(/[,,、]/).map(e=>e.trim()).filter(Boolean)})),className:"text-sm",placeholder:s.importBatch.fields.knowledgePlaceholder})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{className:"text-xs",children:s.importBatch.fields.difficulty}),(0,t.jsxs)(q.d,{value:null!=e.difficultyStars?String(e.difficultyStars):"none",onValueChange:t=>r(a=>ea(a,e.key,{difficultyStars:"none"===t?null:Number(t)})),children:[(0,t.jsx)(q.P,{className:"h-8 w-full text-sm","aria-label":s.importBatch.fields.difficulty,children:(0,t.jsx)(q.U,{})}),(0,t.jsxs)(q.r,{children:[(0,t.jsx)(q.T,{value:"none",children:s.importBatch.fields.difficultyNone}),ec.map(e=>(0,t.jsx)(q.T,{value:String(e),children:"★".repeat(e)},e))]})]})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(E.f,{htmlFor:`${e.key}-wrong`,className:"text-xs",children:s.importBatch.fields.wrongAnswer}),(0,t.jsx)(F.f,{id:`${e.key}-wrong`,value:e.wrongAnswer??"",onChange:t=>r(a=>ea(a,e.key,{wrongAnswer:t.target.value})),className:"min-h-16 text-sm",placeholder:s.importBatch.fields.wrongAnswerPlaceholder})]})]}),!i&&l&&(0,t.jsx)("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:[e.answer?.trim()&&s.importBatch.fields.answer,e.analysis?.trim()&&s.importBatch.fields.analysis,e.knowledgePoints?.length&&`${s.importBatch.fields.knowledgePoints}(${e.knowledgePoints.length})`,null!=e.difficultyStars&&"★".repeat(e.difficultyStars),e.wrongAnswer?.trim()&&s.importBatch.fields.wrongAnswer].filter(Boolean).join(" · ")})]})}var em=e.i(975157);function eu({imageUrl:e,imageSize:a,regions:r,className:s}){let i=function(e){if(0===e.length)return null;let t=Math.min(...e.map(e=>e.x)),a=Math.min(...e.map(e=>e.y));return{x:t,y:a,width:Math.max(...e.map(e=>e.x+e.width))-t,height:Math.max(...e.map(e=>e.y+e.height))-a}}(r);if(!i)return null;let n=i.width*a.width/Math.max(1,i.height*a.height);return(0,t.jsx)("div",{className:(0,em.f)("relative w-full overflow-hidden rounded-md border bg-white",s),style:{aspectRatio:String(Math.max(.25,Math.min(8,n)))},"aria-hidden":!0,children:(0,t.jsx)("img",{src:e,alt:"",className:"absolute max-w-none select-none",draggable:!1,style:{width:`${100/i.width}%`,height:`${100/i.height}%`,left:`${-i.x/i.width*100}%`,top:`${-i.y/i.height*100}%`}})})}var eh=e.i(689664),ex=e.i(519455);function ep(e,t,a){if(!a)return;let r=e[e.length-1];r&&r.type===t?r.text+=a:e.push({type:t,text:a})}function ef({fix:e,onAccept:r,onReject:s}){let{t:i}=(0,x.b)(),n=(0,a.useMemo)(()=>(function(e,t){let a=Array.from(e),r=Array.from(t),s=0;for(;s<a.length&&s<r.length&&a[s]===r[s];)s++;let i=a.length,n=r.length;for(;i>s&&n>s&&a[i-1]===r[n-1];)i--,n--;let l=[];ep(l,"same",a.slice(0,s).join(""));let c=a.slice(s,i),o=r.slice(s,n),d=c.length,m=o.length;if(d*m>2e6)ep(l,"removed",c.join("")),ep(l,"added",o.join(""));else{let e=m+1,t=new Uint32Array((d+1)*e);for(let a=d-1;a>=0;a--)for(let r=m-1;r>=0;r--)t[a*e+r]=c[a]===o[r]?t[(a+1)*e+r+1]+1:Math.max(t[(a+1)*e+r],t[a*e+r+1]);let a=0,r=0;for(;a<d&&r<m;)c[a]===o[r]?(ep(l,"same",c[a]),a++,r++):t[(a+1)*e+r]>=t[a*e+r+1]?ep(l,"removed",c[a++]):ep(l,"added",o[r++]);ep(l,"removed",c.slice(a).join("")),ep(l,"added",o.slice(r).join(""))}return ep(l,"same",a.slice(i).join("")),l})(e.original,e.text),[e.original,e.text]);return(0,t.jsxs)("div",{className:"space-y-2 rounded-lg border border-violet-300 bg-violet-50/60 p-2 text-sm dark:border-violet-800 dark:bg-violet-950/30","data-testid":"text-fix-panel",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 text-xs font-medium text-violet-700 dark:text-violet-300",children:[(0,t.jsx)(A.f,{className:"h-3 w-3"}),i.importBatch.fixText.title]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i.importBatch.fixText.legend})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-words font-mono text-sm","data-testid":"text-fix-diff",children:n.map((e,a)=>"same"===e.type?(0,t.jsx)("span",{children:e.text},a):"removed"===e.type?(0,t.jsx)("del",{className:"bg-red-100 text-red-700 decoration-red-500 dark:bg-red-950/50 dark:text-red-300",children:e.text},a):(0,t.jsx)("ins",{className:"bg-emerald-100 text-emerald-800 no-underline dark:bg-emerald-950/50 dark:text-emerald-300",children:e.text},a))}),e.uncertain.length>0&&(0,t.jsxs)("div",{className:"text-xs text-amber-800 dark:text-amber-300",children:[(0,t.jsx)("span",{children:i.importBatch.fixText.uncertain}),(0,t.jsx)("ul",{className:"mt-0.5 list-inside list-disc",children:e.uncertain.map((e,a)=>(0,t.jsx)("li",{className:"break-words",children:e},a))})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:r,children:[(0,t.jsx)(eh.f,{className:"mr-1 h-4 w-4"}),i.importBatch.fixText.accept]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:s,children:[(0,t.jsx)($.X,{className:"mr-1 h-4 w-4"}),i.importBatch.fixText.reject]})]})]})}var eg=e.i(487486),ey=e.i(257428);function eb({image:e,alt:r,onRemove:s}){let[i,n]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:"relative inline-block",children:[(0,t.jsx)("button",{type:"button",onClick:()=>n(!0),className:"block overflow-hidden rounded-lg border","aria-label":r,children:(0,t.jsx)("img",{src:e,alt:r,className:"max-h-32 w-auto object-contain"})}),(0,t.jsx)(ex.f,{type:"button",size:"icon",variant:"ghost",className:"absolute -right-2 -top-2 h-6 w-6 rounded-full bg-background border shadow-sm",onClick:s,"aria-label":"删除图片",children:(0,t.jsx)($.X,{className:"h-3 w-3"})}),i&&(0,t.jsx)("button",{type:"button",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4",onClick:()=>n(!1),"aria-label":"关闭大图",children:(0,t.jsx)("img",{src:e,alt:r,className:"max-h-full max-w-full object-contain"})})]})}function ej({item:e,index:r,total:s,source:i,expanded:c,onToggleExpand:o,onEdit:d,image:m,onAdjustRegion:u,highlighted:h,onFixText:p,fixing:f,fixBusy:y,onContinue:k,continuing:B}){let{t:C}=(0,x.b)(),T=(0,a.useRef)(null),$=X(e,i),M=`draft-item-${e.key}`,E=e.fix&&e.fix.original===e.text?e.fix:null;return(0,t.jsxs)("li",{id:M,className:(0,em.f)("rounded-xl border bg-card p-3 transition-colors",!e.selected&&"opacity-70",h&&"border-primary ring-2 ring-primary/30"),"data-testid":"draft-item","data-selected":e.selected,"data-fix-pending":E?"true":void 0,children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(ey.f,{className:"mt-1 h-5 w-5",checked:e.selected,disabled:!$,onCheckedChange:t=>d(a=>{var r,s;return r=e.key,s=!0===t,ee(a,a.items.map(e=>e.key===r?{...e,selected:s}:e))}),"aria-label":C.importBatch.question.replace("{index}",String(r+1))}),(0,t.jsxs)("button",{type:"button",className:"min-w-0 flex-1 text-left",onClick:o,"aria-expanded":c,"aria-controls":`${M}-body`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"font-semibold",children:C.importBatch.question.replace("{index}",String(r+1))}),e.label&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:C.importBatch.originalLabel.replace("{label}",e.label)}),e.material&&(0,t.jsx)(eg.f,{variant:"secondary",children:C.importBatch.material}),e.hasFigure&&(0,t.jsx)(eg.f,{variant:"outline",children:C.importBatch.hasFigure}),E&&(0,t.jsx)(eg.f,{className:"bg-violet-600 text-white hover:bg-violet-600",children:C.importBatch.fixText.pending}),e.section&&(0,t.jsx)("span",{className:"truncate text-xs text-muted-foreground",children:e.section.split("\n")[0]})]}),!c&&!E&&e.text&&(0,t.jsx)("p",{className:"mt-1 line-clamp-3 whitespace-pre-line break-words text-sm text-muted-foreground",children:e.text}),e.flags.length>0&&(0,t.jsx)("ul",{className:"mt-1 space-y-0.5",children:e.flags.map(e=>(0,t.jsxs)("li",{className:"flex items-center gap-1 text-xs text-amber-700 dark:text-amber-300",children:[(0,t.jsx)(n.f,{className:"h-3 w-3 shrink-0"}),C.importBatch.flags[e]]},e))})]}),(0,t.jsx)(ex.f,{type:"button",size:"icon",variant:"ghost",className:"h-8 w-8 shrink-0",onClick:o,"aria-label":c?C.importBatch.collapse:C.importBatch.edit,children:c?(0,t.jsx)(w.f,{className:"h-4 w-4"}):(0,t.jsx)(j.f,{className:"h-4 w-4"})})]}),m&&e.regions.length>0&&(0,t.jsx)("button",{type:"button",className:"mt-2 block w-full max-w-md pl-8",onClick:u,"aria-label":C.importBatch.adjustRegion,children:(0,t.jsx)(eu,{imageUrl:m.url,imageSize:m,regions:e.regions,className:"max-h-48"})}),k&&(0,t.jsx)("div",{className:"mt-2 pl-8",children:(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:k,disabled:B,"data-testid":"draft-continue",children:[B?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(S,{className:"mr-1 h-4 w-4"}),B?C.importBatch.continuation.working:C.importBatch.continuation.button]})}),E&&(0,t.jsx)("div",{className:"mt-2 pl-8",children:(0,t.jsx)(ef,{fix:E,onAccept:()=>d(t=>en(t,[e.key])),onReject:()=>d(t=>{var a;return a=e.key,ee(t,t.items.map(e=>e.key===a&&e.fix?{...e,fix:null}:e))})})}),c&&(0,t.jsxs)("div",{id:`${M}-body`,className:"mt-3 space-y-3 pl-8",children:[e.material&&(0,t.jsxs)("div",{className:"rounded-lg bg-muted/60 p-2 text-sm",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"text-xs font-medium",children:[C.importBatch.material," · ",C.importBatch.materialHint]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:()=>d(t=>ea(t,e.key,{material:null})),children:C.importBatch.removeMaterial})]}),(0,t.jsx)("p",{className:"line-clamp-6 whitespace-pre-line break-words text-muted-foreground",children:e.material})]}),"text"===i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(F.f,{ref:T,"aria-label":C.importBatch.questionText,value:e.text,onChange:t=>d(a=>ea(a,e.key,{text:t.target.value}),`text-${e.key}`),className:"min-h-28 font-mono text-sm"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:C.importBatch.splitHint}),e.image&&(0,t.jsx)(eb,{image:e.image,alt:C.importBatch.questionImage,onRemove:()=>d(t=>ea(t,e.key,{image:null}))}),(0,t.jsx)(ed,{item:e,onEdit:e=>d(e)})]}):(0,t.jsxs)(t.Fragment,{children:[e.text&&(0,t.jsx)("p",{className:"whitespace-pre-line break-words text-sm text-muted-foreground",children:e.text}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:C.importBatch.imageTextHint})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:["text"===i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:()=>{let t=T.current?.selectionStart??0;d(a=>(function(e,t,a){let r=et(e,t);if(r<0||e.items.length>=L.S)return e;let s=e.items[r],i=s.text.slice(0,a).replace(/\s+$/,""),n=s.text.slice(a).replace(/^\s+/,"");if(!i||!n)return e;let l={...s,key:W(e.items.map(e=>e.key)),label:null,text:n,regions:[],flags:s.regions.length>0?["unlocated"]:[],selected:!(s.regions.length>0)&&s.selected,answer:null,analysis:null,knowledgePoints:void 0,difficultyStars:null,questionType:null,wrongAnswer:null,fix:null},c=[...e.items];return c.splice(r,1,{...s,text:i,fix:null},l),ee(e,c)})(a,e.key,t))},children:[(0,t.jsx)(I,{className:"mr-1 h-4 w-4"}),C.importBatch.splitHere]}),p&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:p,disabled:y||!e.text.trim(),children:[f?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(A.f,{className:"mr-1 h-4 w-4"}),f?C.importBatch.fixText.running:C.importBatch.fixText.one]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:u,children:[(0,t.jsx)(N,{className:"mr-1 h-4 w-4"}),e.regions.length?C.importBatch.adjustRegion:C.importBatch.locate]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:()=>d(t=>(function(e,t){let a=et(e,t);if(a<0||e.items.length>=L.S)return e;let r=e.items[a],s={...r,key:W(e.items.map(e=>e.key)),label:null,regions:r.regions.map(e=>({...e}))},i=[...e.items];return i.splice(a+1,0,s),ee(e,i)})(t,e.key)),children:[(0,t.jsx)(v.f,{className:"mr-1 h-4 w-4"}),C.importBatch.duplicate]})]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",disabled:0===r,onClick:()=>d(t=>(function(e,t){let a=et(e,t);if(a<=0)return e;let r=e.items[a-1],s=e.items[a],i={...r,text:[r.text,s.text].filter(e=>e.trim()).join("\n").slice(0,2e4),material:r.material??s.material,selected:r.selected||s.selected,regions:[...r.regions,...s.regions].slice(0,4),hasFigure:r.hasFigure||s.hasFigure,flags:[...new Set([...r.flags,...s.flags])].filter(e=>"unlocated"!==e||r.regions.length+s.regions.length===0),answer:ei(r.answer,s.answer)?.slice(0,2e4)??null,analysis:ei(r.analysis,s.analysis)?.slice(0,2e4)??null,knowledgePoints:[...new Set([...r.knowledgePoints??[],...s.knowledgePoints??[]])].slice(0,100),difficultyStars:r.difficultyStars??s.difficultyStars,questionType:r.questionType??s.questionType,wrongAnswer:ei(r.wrongAnswer,s.wrongAnswer)?.slice(0,2e4)??null,fix:null},n=[...e.items];return n.splice(a-1,2,i),ee(e,n)})(t,e.key)),children:[(0,t.jsx)(z,{className:"mr-1 h-4 w-4"}),C.importBatch.mergeUp]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",disabled:0===r,onClick:()=>d(t=>es(t,e.key,-1)),"aria-label":C.importBatch.moveUp,children:(0,t.jsx)(b,{className:"h-4 w-4"})}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",disabled:r===s-1,onClick:()=>d(t=>es(t,e.key,1)),"aria-label":C.importBatch.moveDown,children:(0,t.jsx)(g,{className:"h-4 w-4"})}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>d(t=>er(t,e.key)),children:[(0,t.jsx)(R.f,{className:"mr-1 h-4 w-4"}),C.importBatch.delete]})]})]})]})}function ew({count:e,missingRegions:a,pendingFixes:r=0,imageQuestions:s=0,confirmBeforeImport:i,starting:n,onStart:c,onDiscard:o,source:d,analysisMode:m,onAnalysisModeChange:u,hasTargetNotebook:h}){let{t:p}=(0,x.b)(),f="none"===m,g="tags"===m,y=f?(i?p.importBatch.startNoneReview:p.importBatch.startNoneAuto).replace("{count}",String(e)):g?(i?p.importBatch.startTagsReview:p.importBatch.startTagsAuto).replace("{count}",String(e)):(i?p.importBatch.startReview:p.importBatch.startAuto).replace("{count}",String(e)),b=0===e?p.importBatch.nothingSelected:a>0?p.importBatch.needsRegion.replace("{count}",String(a)):f?p.importBatch.startHintNone:g?p.importBatch.startHintTags:r>0?p.importBatch.fixText.pendingHint.replace("{count}",String(r)):s>0?p.importBatch.startHintAiWithImage:i?p.importBatch.startHintReview:p.importBatch.startHintAuto,j=(f||g)&&!h,w=j?p.importBatch.startNoneNoTarget:void 0;return(0,t.jsx)("div",{className:"fixed inset-x-0 bottom-[calc(4rem+env(safe-area-inset-bottom))] z-30 border-t bg-background/95 py-3 pl-4 pr-16 shadow-[0_-4px_12px_rgba(0,0,0,0.06)] backdrop-blur md:sticky md:bottom-4 md:rounded-xl md:border md:px-4","data-testid":"draft-start-bar",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-4xl flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:["text"===d&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",role:"radiogroup","aria-label":p.importBatch.analysisModeLabel,children:[(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":"ai"===m,disabled:!!n,onClick:()=>u("ai"),className:`rounded-full border px-2.5 py-1 transition-colors ${"ai"===m?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:border-primary/40"}`,"data-testid":"draft-analysis-ai",children:p.importBatch.analysisAi}),(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":g,disabled:!!n||j,onClick:()=>u("tags"),title:w,className:`rounded-full border px-2.5 py-1 transition-colors ${g?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:border-primary/40"} disabled:cursor-not-allowed disabled:opacity-50`,"data-testid":"draft-analysis-tags",children:p.importBatch.analysisTags}),(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":f,disabled:!!n||j,onClick:()=>u("none"),title:w,className:`rounded-full border px-2.5 py-1 transition-colors ${f?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground hover:border-primary/40"} disabled:cursor-not-allowed disabled:opacity-50`,"data-testid":"draft-analysis-none",children:p.importBatch.analysisNone})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground md:max-w-md","data-testid":"draft-start-hint",children:n??b})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(ex.f,{type:"button",variant:"ghost",onClick:o,disabled:!!n,className:"shrink-0",children:p.importBatch.discard}),(0,t.jsxs)(ex.f,{type:"button",onClick:c,disabled:0===e||!!n,className:"min-w-0 flex-1 md:flex-none","data-testid":"draft-start",children:[n?(0,t.jsx)(l.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(A.f,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{className:"truncate",children:y})]})]})]})})}function ev({ignored:e,onRestore:r}){let{t:s}=(0,x.b)(),[i,n]=(0,a.useState)(!1);return 0===e.length?null:(0,t.jsxs)("section",{className:"rounded-xl border p-3",children:[(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between text-left text-sm font-medium",onClick:()=>n(e=>!e),"aria-expanded":i,children:[s.importBatch.ignoredTitle.replace("{count}",String(e.length)),i?(0,t.jsx)(w.f,{className:"h-4 w-4"}):(0,t.jsx)(j.f,{className:"h-4 w-4"})]}),i&&(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s.importBatch.ignoredHint}),(0,t.jsx)("ul",{className:"space-y-2",children:e.map((e,a)=>(0,t.jsxs)("li",{className:"flex items-start gap-2 rounded-lg bg-muted/50 p-2 text-sm",children:[(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words text-muted-foreground",children:e}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"outline",className:"h-7 shrink-0",onClick:()=>r(a),children:s.importBatch.addAsQuestion})]},`${a}-${e.slice(0,20)}`))})]})]})}function ek({imageUrl:e,items:r,onSelectItem:s,highlightedKey:i}){let{t:n}=(0,x.b)(),[l,c]=(0,a.useState)(!0);return(0,t.jsxs)("section",{className:"rounded-xl border bg-card p-3","data-testid":"page-image-overview",children:[(0,t.jsxs)(ex.f,{type:"button",variant:"ghost",size:"sm",className:"mb-2 h-8 px-2 md:hidden",onClick:()=>c(e=>!e),"aria-expanded":l,children:[l?(0,t.jsx)(w.f,{className:"mr-1 h-4 w-4"}):(0,t.jsx)(j.f,{className:"mr-1 h-4 w-4"}),l?n.importBatch.hideImage:n.importBatch.showImage]}),(0,t.jsxs)("div",{className:(0,em.f)("relative mx-auto w-fit max-w-full",!l&&"hidden md:block"),children:[(0,t.jsx)("img",{src:e,alt:"",className:"block max-h-[70vh] max-w-full select-none rounded-md",draggable:!1}),r.map((e,a)=>e.regions.map((r,l)=>(0,t.jsx)("button",{type:"button",onClick:()=>s(e.key),className:(0,em.f)("absolute rounded-sm border-2 transition-colors",e.selected?"border-primary bg-primary/10":"border-dashed border-muted-foreground/70 bg-transparent",i===e.key&&"border-amber-500 bg-amber-400/20"),style:{left:`${100*r.x}%`,top:`${100*r.y}%`,width:`${100*r.width}%`,height:`${100*r.height}%`},"aria-label":n.importBatch.question.replace("{index}",String(a+1)),children:0===l&&(0,t.jsx)("span",{className:(0,em.f)("absolute -left-0.5 -top-0.5 rounded-br-md px-1.5 text-xs font-semibold text-white",e.selected?"bg-primary":"bg-muted-foreground"),children:a+1})},`${e.key}-${l}`)))]})]})}var eN=e.i(232660),eB=e.i(776639);let eS={x:.1,y:.1,width:.8,height:.3};function eC(e){return{unit:"%",x:100*e.x,y:100*e.y,width:100*e.width,height:100*e.height}}function ez(e){let t={x:e.x/100,y:e.y/100,width:e.width/100,height:e.height/100};return t.width>=.01&&t.height>=.01?t:null}function eT({open:e,imageUrl:r,regions:s,onClose:i,onSave:n}){let{t:l}=(0,x.b)(),[o,d]=(0,a.useState)(()=>(s.length?s:[eS]).map(eC)),[m,u]=(0,a.useState)(0),h=o[Math.min(m,o.length-1)];return(0,t.jsx)(eB.N,{open:e,onOpenChange:e=>!e&&i(),children:(0,t.jsxs)(eB.d,{className:"flex h-[90vh] max-w-3xl flex-col gap-0 p-0",children:[(0,t.jsxs)(eB.s,{className:"shrink-0 border-b p-4",children:[(0,t.jsx)(eB.F,{children:l.importBatch.regionDialogTitle}),(0,t.jsx)(eB.C,{children:l.importBatch.regionDialogHint})]}),(0,t.jsx)("div",{className:"min-h-0 flex-1 overflow-auto bg-black p-3",children:(0,t.jsx)("div",{className:"mx-auto w-fit",children:(0,t.jsx)(eN.f,{crop:h,onChange:(e,t)=>d(e=>e.map((e,a)=>a===m?t:e)),children:(0,t.jsx)("img",{src:r,alt:"",className:"block max-h-[65vh] max-w-full",draggable:!1})})})}),(0,t.jsxs)("div",{className:"shrink-0 space-y-3 border-t p-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[o.map((e,a)=>(0,t.jsx)("button",{type:"button",onClick:()=>u(a),className:(0,em.f)("rounded-md border px-3 py-1 text-sm",a===m?"border-primary bg-primary/10 font-medium":"text-muted-foreground"),children:l.importBatch.regionTab.replace("{index}",String(a+1))},a)),o.length<4&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:()=>{d(e=>[...e,eC(eS)]),u(o.length)},children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),l.importBatch.addRegion]}),o.length>1&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>{d(e=>e.filter((e,t)=>t!==m)),u(0)},children:[(0,t.jsx)(R.f,{className:"mr-1 h-4 w-4"}),l.importBatch.removeRegion]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(ex.f,{type:"button",variant:"outline",onClick:i,children:l.common.cancel}),(0,t.jsx)(ex.f,{type:"button",onClick:()=>{let e=o.map(ez).filter(e=>null!==e);e.length&&n(e)},children:l.importBatch.saveRegion})]})]})]})})}let eI={name:"check-check",size:24,node:[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]};eI.node;let eA=(0,o.f)(eI);function eR({targetCount:e,pendingCount:a,fixing:r,onFix:s,onAcceptAll:i}){let{t:n}=(0,x.b)();return(0,t.jsxs)("div",{className:"space-y-1 rounded-lg border border-dashed p-3","data-testid":"text-fix-toolbar",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:s,disabled:r||0===e,children:[r?(0,t.jsx)(l.f,{className:"mr-1 h-4 w-4 animate-spin"}):(0,t.jsx)(A.f,{className:"mr-1 h-4 w-4"}),r?n.importBatch.fixText.running:n.importBatch.fixText.selected.replace("{count}",String(e))]}),a>0&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:i,children:[(0,t.jsx)(eA,{className:"mr-1 h-4 w-4"}),n.importBatch.fixText.acceptAll.replace("{count}",String(a))]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:n.importBatch.fixText.hint})]})}var e$=e.i(767077),eM=e.i(499930),eE=e.i(294114),eq=e.i(201276),eF=e.i(119472),eP=e.i(213761),eD=e.i(132411),eU=e.i(41931);function e_(e){return`import-batch-text-fix:${e}`}function eO(e){try{sessionStorage.removeItem(e_(e))}catch{}}function eH({batch:e,draft:r,onEdit:s,onUndo:i,canUndo:o,saveState:d,image:u,confirmBeforeImport:h,starting:f,onStart:g,onDiscard:y,analysisMode:b,onAnalysisModeChange:j,hasConflictCopy:w,onRestoreConflict:v,onDismissConflict:k}){let{t:N}=(0,x.b)(),B=e.source,[S,C]=(0,a.useState)(null),[z,T]=(0,a.useState)(null),[I,A]=(0,a.useState)(null),R=r.items.filter(e=>e.selected&&X(e,B)),$=r.items.length>0&&r.items.every(e=>e.selected||!X(e,B)),M=r.items.filter(e=>e.selected&&!X(e,B)).length,E=function(e,t,r){let{t:s}=(0,x.b)(),[i,n]=(0,a.useState)([]),l=`import-batch:${e}:fix-text`,{running:c,refresh:o}=(0,eD.f)(l),d=(0,a.useRef)(!1),m=(0,a.useRef)(!1),u=(0,a.useRef)(!1),h=(0,a.useCallback)(e=>{e.fixes.length>0&&r(t=>{let a,r,s;return a=new Map(e.fixes.map(e=>[e.key,e])),r=!1,s=t.items.map(e=>{let t=a.get(e.key);return t&&e.text===t.original&&t.text!==t.original?(r=!0,{...e,fix:{original:t.original,text:t.text,uncertain:t.uncertain}}):e}),r?ee(t,s):t});let t=[e.fixes.length>0?s.importBatch.fixText.done.replace("{count}",String(e.fixes.length)):null,e.unchanged.length>0?s.importBatch.fixText.unchanged.replace("{count}",String(e.unchanged.length)):null,e.failed.length>0?s.importBatch.fixText.failed.replace("{count}",String(e.failed.length)):null].filter(Boolean).join(" ");e.failed.length>0?eE.c.warning(t):eE.c.success(t)},[r,s]),p=(0,a.useCallback)(async a=>{let r=t.items.filter(e=>a.includes(e.key)&&e.text.trim()).map(e=>({key:e.key,text:e.text}));if(0===r.length)return;let i=(0,eU.j)();var l={requestId:i,keys:r.map(e=>e.key)};try{sessionStorage.setItem(e_(e),JSON.stringify(l))}catch{}n(r.map(e=>e.key)),d.current=!0;try{let t=await (0,eF.$)(e,r,i);h(t)}catch(e){e instanceof eU.a&&409===e.status&&e.data?.code==="TASK_ALREADY_RUNNING"?(eE.c.info(s.errors.TASK_ALREADY_RUNNING),await o()):(eq.V.error("[ImportBatch]","Text fix failed",{error:e}),eE.c.error((0,e$.f)(e,s)))}finally{n([])}},[e,t,h,o,s]);(0,a.useEffect)(()=>{if(!c)return;let t=function(e){try{let t=sessionStorage.getItem(e_(e));return t?JSON.parse(t):null}catch{return null}}(e);if(t?.requestId&&!d.current){let a=Date.now()+6e5;(0,eU.u)(t.requestId,a,Error("REQUEST_NOT_FOUND")).then(t=>{u.current=!0,h(t),eO(e)}).catch(e=>{eq.V.warn("[ImportBatch]","Text fix recovery failed",{error:e})})}},[c,e,h]);let f=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(c){f.current=!0,m.current=!1;return}f.current&&(f.current=!1,eO(e),d.current||u.current||m.current||(m.current=!0,eE.c.info(s.importBatch.fixText.waitingOtherDevice)),d.current=!1,u.current=!1)},[c,e,s]),{fix:p,fixingKeys:i,fixing:i.length>0||!!c}}(e.id,r,s),q=function(e,t,r,s){let{t:i,language:n}=(0,x.b)(),l=(0,a.useRef)(null),c=(0,a.useRef)(null),[o,d]=(0,a.useState)(null),[m,u]=(0,a.useState)([]),h=async a=>{let l=a.target.files?.[0];a.target.value="";let o=r.items.find(e=>e.key===c.current);if(l&&o&&t){d(o.key);try{let a=await (0,eP.p)(l);try{let r=await (0,eM.y)(t),l=await (0,eM.k)(r,o.regions,a),c={...(0,eP.N)(a,l),sourceType:"continuation"},d=await (0,eF.v)({source:"image",imageBase64:l.dataUrl,imageInfo:c,language:n,subjectId:e.subjectId,targetSubjectId:e.targetSubjectId,paperLevel:e.paperLevel});s(e=>er(e,o.key)),u(e=>[...e,d.id]),eq.V.info("[ImportBatch]","Continuation batch created",{batchId:d.id,...c}),eE.c.success(i.importBatch.continuation.created)}finally{a.dispose()}}catch(e){eq.V.error("[ImportBatch]","Continuation failed",{error:e}),eE.c.error(e instanceof eP.o?i.upload.decodeErrors[e.code].replace("{format}",e.format.toUpperCase()):(0,e$.f)(e,i))}finally{d(null)}}};return{pick:e=>{c.current=e,l.current?.click()},busyKey:o,created:m,inputProps:{ref:l,onChange:e=>void h(e)}}}(e,u?.url??null,r,s),F="text"===B?r.items.filter(e=>e.fix&&e.fix.original===e.text).length:0,P="text"===B?R.filter(e=>!(e.fix&&e.fix.original===e.text)).map(e=>e.key):[];return(0,t.jsxs)("div",{className:"space-y-4 pb-36 md:pb-24",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsxs)("p",{className:"text-base font-semibold","data-testid":"draft-summary",children:[N.importBatch.detected.replace("{count}",String(r.items.length)),(0,t.jsx)("span",{className:"mx-2 text-muted-foreground",children:"·"}),N.importBatch.selected.replace("{count}",String(R.length))]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)("span",{className:"mr-2 flex items-center gap-1 text-xs text-muted-foreground","aria-live":"polite","data-testid":"draft-save-state","data-state":d,children:["saving"===d&&(0,t.jsx)(l.f,{className:"h-3 w-3 animate-spin"}),N.importBatch.save[d]]}),(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"ghost",disabled:!o,onClick:i,children:[(0,t.jsx)(m,{className:"mr-1 h-4 w-4"}),N.importBatch.undo]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:()=>s(e=>(function(e,t,a=()=>!0){return ee(e,e.items.map(e=>({...e,selected:t&&a(e)})))})(e,!$,e=>X(e,B))),children:$?N.importBatch.selectNone:N.importBatch.selectAll})]})]}),w&&(0,t.jsxs)("div",{className:"space-y-2 rounded-lg border border-primary/40 bg-primary/5 p-3 text-sm",role:"status","data-testid":"draft-conflict",children:[(0,t.jsx)("p",{children:N.importBatch.conflictKept}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(ex.f,{type:"button",size:"sm",onClick:v,children:N.importBatch.restoreMine}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:k,children:N.importBatch.discardMine})]})]}),"text"===B&&r.items.length>0&&(0,t.jsx)(eR,{targetCount:P.length,pendingCount:F,fixing:E.fixing,onFix:()=>void E.fix(P),onAcceptAll:()=>s(e=>en(e))}),r.warnings.length>0&&(0,t.jsx)("ul",{className:"space-y-1 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200",children:r.warnings.map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-2",children:[(0,t.jsx)(n.f,{className:"mt-0.5 h-4 w-4 shrink-0"}),N.importBatch.warnings[e]]},e))}),(0,t.jsx)(p,{inputProps:q.inputProps,created:q.created}),u&&(0,t.jsx)(ek,{imageUrl:u.url,items:r.items,onSelectItem:e=>{T(e),C(e),document.getElementById(`draft-item-${e}`)?.scrollIntoView({behavior:"smooth",block:"center"})},highlightedKey:z}),0===r.items.length?(0,t.jsx)("p",{className:"rounded-xl border border-dashed p-6 text-center text-sm text-muted-foreground",children:N.importBatch.emptyDraft}):(0,t.jsx)("ol",{className:"space-y-3",children:r.items.map((e,a)=>{var i;return(0,t.jsx)(ej,{item:e,index:a,total:r.items.length,source:B,expanded:S===e.key,onToggleExpand:()=>C(t=>t===e.key?null:e.key),onEdit:s,image:u,onAdjustRegion:()=>A({key:e.key,regions:e.regions}),highlighted:z===e.key,onFixText:"text"===B?()=>void E.fix([e.key]):void 0,fixing:E.fixingKeys.includes(e.key),fixBusy:E.fixing,onContinue:u&&(i=r.items.length,e.regions.length>0&&(e.flags.includes("partial")||a===i-1))?()=>q.pick(e.key):void 0,continuing:q.busyKey===e.key},e.key)})}),u&&(0,t.jsxs)(ex.f,{type:"button",variant:"outline",size:"sm",onClick:()=>A({key:null,regions:[]}),children:[(0,t.jsx)(c.f,{className:"mr-1 h-4 w-4"}),N.importBatch.addQuestion]}),(0,t.jsx)(ev,{ignored:r.ignored,onRestore:e=>s(t=>(function(e,t){let a=e.ignored[t];if(void 0===a||e.items.length>=L.S)return e;let r={key:W(e.items.map(e=>e.key)),label:null,text:a,material:null,section:null,selected:!0,regions:[],hasFigure:!1,flags:[]};return{...e,items:[...e.items,r],ignored:e.ignored.filter((e,a)=>a!==t)}})(t,e))}),(0,t.jsx)(ew,{count:R.length,missingRegions:M,pendingFixes:F,imageQuestions:R.filter(e=>!!e.image).length,confirmBeforeImport:h,starting:f,onStart:g,onDiscard:y,source:B,analysisMode:b,onAnalysisModeChange:j,hasTargetNotebook:!!e.targetSubjectId||!!e.subjectId}),u&&I&&(0,t.jsx)(eT,{open:!0,imageUrl:u.url,regions:I.regions,onClose:()=>A(null),onSave:e=>{let t=I.key;s(a=>t?ea(a,t,{regions:e,selected:!0}):function(e,t){if(e.items.length>=L.S)return e;let a={key:W(e.items.map(e=>e.key)),label:null,text:"",material:null,section:null,selected:!0,regions:[t],hasFigure:!1,flags:[]};return{...e,items:[...e.items,a]}}(a,e[0])),A(null)}})]})}var eL=e.i(399847),eV=e.i(395925);function eK({batch:e,busy:a,onRetry:r,onDiscard:s}){let{t:i}=(0,x.b)(),n=i.errors,c=e.error?"string"==typeof n[e.error]?n[e.error]:e.error:null;return"splitting"===e.phase?(0,t.jsxs)("section",{className:"flex items-start gap-3 rounded-xl border bg-card p-4",role:"status","data-testid":"batch-splitting",children:[(0,t.jsx)(l.f,{className:"mt-0.5 h-5 w-5 shrink-0 animate-spin text-primary"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)("p",{className:"font-medium",children:i.importBatch.phase.splitting}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i.importBatch.splittingHint}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:s,children:i.importBatch.discard})]})]}):(0,t.jsxs)("section",{className:"flex items-start gap-3 rounded-xl border border-destructive/40 bg-card p-4","data-testid":"batch-failed",children:[(0,t.jsx)(eL.f,{className:"mt-0.5 h-5 w-5 shrink-0 text-destructive"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,t.jsx)("p",{className:"font-medium",children:i.importBatch.phase.failed}),c&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:c}),"image"===e.source&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i.importBatch.manualFallback}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:r,disabled:a,children:[(0,t.jsx)(eV.f,{className:"mr-1 h-4 w-4"}),i.importBatch.retrySplit]}),(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"ghost",onClick:s,children:i.importBatch.discard})]})]})]})}var eG=e.i(551757),eQ=e.i(615568),eY=e.i(168148);let eJ={analyzing:.5,saving:.9,review:1,saved:1,failed:1};function eW({task:e}){let{t:a}=(0,x.b)(),r=a.importBatch.itemStatus;if("saved"===e.status){let a=e.errorItemId?e.duplicate?r.duplicate:r.saved:r.deleted;return(0,t.jsxs)("span",{className:"flex items-center gap-1 text-green-700 dark:text-green-300",children:[(0,t.jsx)(eG.f,{className:"h-4 w-4"}),a]})}return"failed"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-destructive",children:[(0,t.jsx)(eL.f,{className:"h-4 w-4"}),r.failed]}):"review"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-primary",children:[(0,t.jsx)(eQ.f,{className:"h-4 w-4"}),r.review]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,t.jsx)(l.f,{className:"h-4 w-4 animate-spin"}),r[e.status]]})}function eX({batch:e,image:a,busy:s,onRetryFailed:i,onRetryOne:n,onConfirmAll:l}){let{t:c}=(0,x.b)(),{counts:o}=e,d=o.total-o.active,m=o.total?Math.round(e.tasks.reduce((e,t)=>e+eJ[t.status],0)/o.total*100):0,u=new Map((e.draft?.items??[]).map((e,t)=>[e.key,{item:e,index:t}])),h=c.errors;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("section",{className:"space-y-3 rounded-xl border bg-card p-4","data-testid":"batch-progress","data-phase":e.phase,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,t.jsx)("p",{className:"text-base font-semibold",children:c.importBatch.progress.replace("{done}",String(d)).replace("{total}",String(o.total))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.stageEstimate})]}),(0,t.jsx)(eY.f,{value:m,"aria-label":c.importTasks.stageEstimate,"aria-valuetext":c.common.progress.estimated.replace("{percent}",String(m)),className:"h-2"}),(0,t.jsxs)("ul",{className:"flex flex-wrap gap-x-4 gap-y-1 text-sm","data-testid":"batch-counts",children:[(0,t.jsx)("li",{className:"text-green-700 dark:text-green-300",children:c.importBatch.counts.saved.replace("{count}",String(o.saved-o.duplicate))}),o.duplicate>0&&(0,t.jsx)("li",{className:"text-muted-foreground",children:c.importBatch.counts.duplicate.replace("{count}",String(o.duplicate))}),o.review>0&&(0,t.jsx)("li",{className:"text-primary",children:c.importBatch.counts.review.replace("{count}",String(o.review))}),o.failed>0&&(0,t.jsx)("li",{className:"text-destructive",children:c.importBatch.counts.failed.replace("{count}",String(o.failed))}),o.active>0&&(0,t.jsx)("li",{className:"text-muted-foreground",children:c.importBatch.counts.active.replace("{count}",String(o.active))})]}),o.active>0&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importBatch.leaveHint}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[o.failed>0&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",onClick:i,disabled:s,children:[(0,t.jsx)(eV.f,{className:"mr-1 h-4 w-4"}),c.importBatch.retryFailed.replace("{count}",String(o.failed))]}),o.review>0&&(0,t.jsx)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:l,disabled:s,children:c.importBatch.confirmAll.replace("{count}",String(o.review))})]})]}),(0,t.jsx)("ol",{className:"space-y-3",children:e.tasks.map(e=>{let i=u.get(e.batchItemKey??""),l=e.error?"string"==typeof h[e.error]?h[e.error]:e.error:null;return(0,t.jsxs)("li",{className:(0,em.f)("flex gap-3 rounded-xl border bg-card p-3 text-sm",e.unread&&"review"===e.status&&"border-primary/50"),"data-testid":"batch-task","data-status":e.status,children:[a&&i&&i.item.regions.length>0&&(0,t.jsx)(eu,{imageUrl:a.url,imageSize:a,regions:i.item.regions,className:"w-20 shrink-0 self-start sm:w-28"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:c.importBatch.question.replace("{index}",String((i?.index??0)+1))}),(0,t.jsx)(eW,{task:e})]}),(0,t.jsx)("p",{className:"line-clamp-2 break-words text-muted-foreground",children:e.excerpt||i?.item.text}),"saved"===e.status&&e.errorItemId&&!e.duplicate&&e.notebookName&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c.importTasks.savedTo.replace("{notebook}",e.notebookName).replace("{id}",e.errorItemShortId||"-")}),l&&"failed"===e.status&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:l}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:["review"===e.status&&(0,t.jsx)(ex.f,{asChild:!0,size:"sm",children:(0,t.jsx)(r.default,{href:`/import-tasks/${e.id}`,children:c.importBatch.review})}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)(ex.f,{asChild:!0,size:"sm",variant:"outline",children:(0,t.jsx)(r.default,{href:`/error-items/${e.errorItemId}`,children:c.importBatch.viewItem})}),"failed"===e.status&&(0,t.jsxs)(ex.f,{type:"button",size:"sm",variant:"outline",onClick:()=>n(e),disabled:s,children:[(0,t.jsx)(eV.f,{className:"mr-1 h-3 w-3"}),c.importTasks.retry]})]})]})]},e.id)})})]})}var eZ=e.i(912505),e0=e.i(393842),e1=e.i(86963),e2=e.i(127175),e4=e.i(35209),e5=e.i(25197);e.s(["default",0,function(){let e=(0,s.useParams)(),n=(0,s.useRouter)(),l=e.id,{t:c}=(0,x.b)();(0,e4.f)(c.importBatch.title);let o=function(e,t={}){let[r,s]=(0,a.useState)(null),[i,n]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null),[o,d]=(0,a.useState)("saved"),m=(0,a.useRef)([]),[u,h]=(0,a.useState)(!1),x=(0,a.useRef)(0),p=(0,a.useRef)(0),f=(0,a.useRef)(0),g=(0,a.useRef)(null),y=(0,a.useRef)(null),b=(0,a.useRef)(null),j=(0,a.useRef)(async()=>!0),[w,v]=(0,a.useState)(null),k=(0,a.useRef)(t.onConflict);(0,a.useEffect)(()=>{k.current=t.onConflict},[t.onConflict]);let N=(0,a.useCallback)((e,t=!1)=>{s(t=>t&&!e.imageData&&t.imageData&&t.id===e.id?{...e,imageData:t.imageData}:e);let a=p.current!==f.current;(t||!a||"draft"!==e.status)&&(null!==g.current&&e.version!==x.current&&(m.current=[],h(!1)),x.current=e.version,g.current=e.draft,c(e.draft),f.current=p.current,d("saved"))},[]),B=(0,a.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{N(await (0,eF.w)(e)),n(!1)}catch(e){e?.status===404&&n(!0)}},[e,N]);(0,a.useEffect)(()=>{let t=!1;(0,eF.w)(e,{image:!0}).then(e=>{t||N(e,!0)}).catch(e=>{t||e?.status!==404||n(!0)});let a=(0,e2.E)(()=>void B());return()=>{t=!0,a()}},[e,N,B]);let S=r?.phase==="splitting"||r?.phase==="processing";(0,a.useEffect)(()=>{if(!S)return;let e=setInterval(()=>void B(),2500);return()=>clearInterval(e)},[S,B]);let C=(0,a.useCallback)(async()=>{let t=p.current;d("saving");try{let a=await (0,eF.S)(e,x.current,g.current);return x.current=a.version,f.current=t,s(e=>e?{...a,imageData:e.imageData}:a),d(p.current===t?"saved":"dirty"),"ok"}catch(t){let e=(0,eF.n)(t);if(e){let t=g.current;return"draft"===e.status&&t&&v(t),N(e,!0),k.current?.(),"conflict"}return d("error"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>void j.current(),5e3),"error"}},[e,N]),z=(0,a.useCallback)(async()=>{for(b.current&&(clearTimeout(b.current),b.current=null);;){let e=y.current??(y.current=(async()=>{try{for(;p.current!==f.current&&g.current;)if(await C()!=="ok")return!1;return!0}finally{y.current=null}})());if(!await e)return!1;if(p.current===f.current)return!0}},[C]);(0,a.useEffect)(()=>{j.current=z},[z]),(0,a.useEffect)(()=>{let e=()=>{"hidden"===document.visibilityState&&p.current!==f.current&&z()};return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("pagehide",e)}},[z]),(0,a.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let T=(0,a.useCallback)(e=>{g.current=e,c(e),p.current+=1,d("dirty"),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>void z(),800)},[z]),I=(0,a.useRef)(null),A=(0,a.useCallback)((e,t)=>{let a=g.current;if(!a)return;let r=e(a);if(r===a)return;let s=Date.now(),i=t&&I.current?.group===t&&s-I.current.at<1500;I.current=t?{group:t,at:s}:null,i||(m.current=[...m.current.slice(-29),a],h(!0)),T(r)},[T]),R=(0,a.useCallback)(()=>{let e=m.current.pop();I.current=null,h(m.current.length>0),e&&T(e)},[T]),$=(0,a.useCallback)(()=>{v(null),w&&A(()=>w)},[w,A]);return{batch:r,draft:l,notFound:i,saveState:o,refresh:B,save:z,edit:A,undo:R,canUndo:u,conflictCopy:w,restoreConflictCopy:$,dismissConflictCopy:()=>v(null),version:()=>x.current,replace:e=>N(e,!0)}}(l,{onConflict:()=>eE.c.info(c.importBatch.conflict)}),{batch:d,draft:m,notFound:u}=o,h=function(e){let[t,r]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;let t=!1,a=new Image;return a.onload=()=>{t||r({url:e,width:a.naturalWidth,height:a.naturalHeight})},a.src=e,()=>{t=!0}},[e]),t&&t.url===e?t:null}(d?.source==="image"?d.imageData:null),[p,f]=(0,a.useState)(null),[g,y]=(0,a.useState)(null),[b,j]=(0,a.useState)(!1),[w,v]=(0,a.useState)("ai"),k=(0,a.useRef)(null),[N,B]=(0,a.useState)(null);if(m!==N&&(B(m),m&&d?.source==="text")){let e=Z(m,"text");v(e.length>0&&e.every(e=>e.answer?.trim())?"tags":"ai")}if((0,a.useEffect)(()=>{(0,e5.x)().then(f)},[]),(0,a.useEffect)(()=>{d?.unread&&k.current!==`${d.id}:${d.phase}:${d.counts.active}`&&(k.current=`${d.id}:${d.phase}:${d.counts.active}`,(0,eF.f)(d.id).catch(e=>eq.V.warn("[ImportBatch]","Mark read failed",{error:e})))},[d]),u)return(0,t.jsx)("main",{className:"mx-auto max-w-3xl px-4 py-6 md:px-8 md:py-8",children:(0,t.jsx)(eZ.f,{icon:i.f,title:c.importBatch.notFound,action:(0,t.jsx)(r.default,{href:"/import-tasks",children:(0,t.jsx)(ex.f,{children:c.importTasks.viewTasks})})})});if(!d||null===p||"image"===d.source&&"draft"===d.status&&!h)return(0,t.jsx)(e1.f,{});let S=async e=>{j(!0);try{await e()}catch(t){let e=(0,eF.n)(t);e?(o.replace(e),eE.c.info(c.importBatch.conflict)):eE.c.error((0,e$.f)(t,c))}finally{j(!1)}},C=async()=>{if(m){y(c.importBatch.submitting);try{let e;if(!await o.save())return;if("image"===d.source){if(!d.imageData)throw Error("IMAGE_EMPTY");let t=await (0,eM.y)(d.imageData),a=Z(m,"image");e=[];let r=0;for(let s of a){y(c.importBatch.cropping.replace("{done}",String(e.length+1)).replace("{total}",String(a.length)));let i=await (0,eM.M)(t,s.regions);r+=i.bytes,e.push({key:s.key,imageBase64:i.dataUrl,imageInfo:{outputWidth:i.width,outputHeight:i.height,outputBytes:i.bytes,quality:i.quality}})}if(e.reduce((e,t)=>e+t.imageBase64.length,0)>0x3c00000)return void eE.c.error(c.errors.IMPORT_BATCH_TOO_LARGE);y(c.importBatch.uploadingImages.replace("{count}",String(e.length)).replace("{size}",`${(r/1024/1024).toFixed(1)}MB`))}o.replace(await (0,eF.g)(d.id,o.version(),e,w)),window.scrollTo({top:0})}catch(t){eq.V.error("[ImportBatch]","Start failed",{error:t});let e=(0,eF.n)(t);e?(o.replace(e),eE.c.info(c.importBatch.conflict)):eE.c.error((0,e$.f)(t,c))}finally{y(null)}}},z=async()=>{await (0,eE.u)(c.importBatch.discardConfirm)&&await S(async()=>{await (0,eF.o)(d.id),eE.c.success(c.importBatch.discarded),n.push("/import-tasks")})},T=()=>S(async()=>{o.replace(await (0,eF.s)(d.id)),eE.c.info(c.importTasks.retried)}),I=`${c.importBatch.source[d.source]} \xb7 ${c.importBatch.phase[d.phase]}`;return(0,t.jsxs)("main",{className:"mx-auto max-w-4xl space-y-4 px-4 py-6 md:px-8 md:py-8",children:[(0,t.jsx)(e0.f,{backHref:"/import-tasks",title:c.importBatch.title,description:I}),"splitting"===d.phase||"failed"===d.phase?(0,t.jsx)(eK,{batch:d,busy:b,onRetry:T,onDiscard:z}):"draft"===d.status&&m?(0,t.jsx)(eH,{batch:d,draft:m,onEdit:o.edit,onUndo:o.undo,canUndo:o.canUndo,saveState:o.saveState,image:h,confirmBeforeImport:p,starting:g,onStart:C,onDiscard:z,analysisMode:w,onAnalysisModeChange:v,hasConflictCopy:!!o.conflictCopy,onRestoreConflict:o.restoreConflictCopy,onDismissConflict:o.dismissConflictCopy}):(0,t.jsx)(eX,{batch:d,image:h,busy:b,onRetryFailed:T,onRetryOne:e=>S(async()=>{await (0,e2.R)(e.id),eE.c.info(c.importTasks.retried),await o.refresh()}),onConfirmAll:()=>S(async()=>{let e=await (0,eF.J)(d.id);o.replace(e.batch),eE.c.success(c.importBatch.confirmAllDone.replace("{count}",String(e.saved)))})})]})}],864272)}]);