wrong-notebook 2026.11.6 → 2026.11.8-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/page.js.nft.json +1 -1
- package/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/server/app/admin/user/[id]/page.js.nft.json +1 -1
- package/.next/server/app/admin/user/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/admin/cnm-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/dashboard/route.js +14 -14
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/export/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/debug-logs/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/eula/accept/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js +2 -2
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/system-reset/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/telemetry/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/detail/route.js +14 -14
- package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +15 -15
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +18 -18
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/figure/route.js +14 -14
- package/.next/server/app/api/error-items/[id]/figure/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js +14 -14
- package/.next/server/app/api/error-items/[id]/fix-latex/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/geogebra/route.js +14 -13
- package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/image/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/notes/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/practice-records/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/reanswer/route.js +16 -15
- package/.next/server/app/api/error-items/[id]/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/retag/route.js +19 -17
- package/.next/server/app/api/error-items/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/route.js +1 -1
- package/.next/server/app/api/error-items/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +14 -13
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js +14 -13
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/answer-space/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/batch-delete/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/export-questions/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +16 -16
- package/.next/server/app/api/error-items/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/short/[shortId]/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/similarity/route.js.nft.json +1 -1
- package/.next/server/app/api/eula/status/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +16 -15
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/results/route.js +13 -13
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +14 -14
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +12 -11
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +11 -11
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +14 -13
- package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/import/route.js +19 -18
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +21 -21
- package/.next/server/app/api/import-batches/[id]/confirm-all/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/fix-text/route.js +16 -16
- package/.next/server/app/api/import-batches/[id]/fix-text/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/read/route.js +20 -20
- package/.next/server/app/api/import-batches/[id]/read/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/retry/route.js +21 -21
- package/.next/server/app/api/import-batches/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/route.js +20 -20
- package/.next/server/app/api/import-batches/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/start/route.js +20 -20
- package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/route.js +20 -20
- package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js +22 -22
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/read/route.js +22 -22
- package/.next/server/app/api/import-tasks/[id]/read/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/retry/route.js +20 -20
- package/.next/server/app/api/import-tasks/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/route.js +22 -22
- package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/route.js +20 -20
- package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/initialize/route.js.nft.json +1 -1
- package/.next/server/app/api/logs/frontend/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/checkin/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/login/route.js.nft.json +1 -1
- package/.next/server/app/api/minimax-code/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +18 -17
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +18 -18
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/paper-groups/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +16 -15
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +10 -10
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +14 -14
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +17 -17
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +8 -8
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/requests/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +16 -15
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +6 -6
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/setup/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/activity/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/clear/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/repeated-mistakes/route.js +14 -14
- package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/weak-tags/route.js +14 -14
- package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tags/stats/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/telemetry/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/status/route.js.nft.json +1 -1
- package/.next/server/app/api/user/ai-consent/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +16 -15
- package/.next/server/app/api/user/route.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page.js.nft.json +1 -1
- package/.next/server/app/error-items/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/eula/page.js.nft.json +1 -1
- package/.next/server/app/eula/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/[id]/print/page.js.nft.json +1 -1
- package/.next/server/app/exams/[id]/print/page_client-reference-manifest.js +1 -1
- package/.next/server/app/exams/page.js.nft.json +1 -1
- package/.next/server/app/exams/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-batches/[id]/page.js.nft.json +1 -1
- package/.next/server/app/import-batches/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-tasks/[id]/page.js.nft.json +1 -1
- package/.next/server/app/import-tasks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/import-tasks/page.js.nft.json +1 -1
- package/.next/server/app/import-tasks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/initialize/page.js.nft.json +1 -1
- package/.next/server/app/initialize/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/add/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/add/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/[id]/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/notebooks/page.js.nft.json +1 -1
- package/.next/server/app/notebooks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/practice/page.js.nft.json +1 -1
- package/.next/server/app/practice/page_client-reference-manifest.js +1 -1
- package/.next/server/app/print-preview/page.js.nft.json +1 -1
- package/.next/server/app/print-preview/page_client-reference-manifest.js +1 -1
- package/.next/server/app/register/page.js.nft.json +1 -1
- package/.next/server/app/register/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page.js.nft.json +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/setup/page.js.nft.json +1 -1
- package/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/server/app/stats/page.js.nft.json +1 -1
- package/.next/server/app/stats/page_client-reference-manifest.js +1 -1
- package/.next/server/app/tags/page.js.nft.json +1 -1
- package/.next/server/app/tags/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0u_jxskyhdl4l._.js → [root-of-the-server]__007euzraef-1_._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0-fpl-4ce-iyj._.js → [root-of-the-server]__00d4vtmsmiyd_._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1-gpls663uhw2._.js → [root-of-the-server]__00lpxd_gni_y7._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1-ityr2iq9e-w._.js → [root-of-the-server]__00qar_0vt8v5r._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__00ry5fb1607z0._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__07fsx1y8aa-7l._.js → [root-of-the-server]__02m42nibzxxmr._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__09re9q5tsyprr._.js → [root-of-the-server]__046l8-2oecq5e._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__04ke3ybbbyqy7._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__07tka5n0kbed7._.js → [root-of-the-server]__06g0t8zt3udt7._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__09tf4b1-063yn._.js → [root-of-the-server]__06t523lsa-xt5._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__07za3z2qd-ri5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__09a7mqqvpb5iw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__09uxdlb0atubd._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0_3i3iyk5i5fu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ar2vbvo840d-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0d3nasp559369._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__06p98x_tv1foa._.js → [root-of-the-server]__0d_63r679gzzq._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0ddx0pk-g57hh._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0evnxpsv44y-s._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0evv12a34qcy6._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0yxdic8niq68m._.js → [root-of-the-server]__0fxflgag7lsn4._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0g2y0mex0x8zf._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0gjk0_s945vrt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0gkhutsleo1es._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0gvfx4rsinijb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ifivl2todel2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0jrho_9vk0dgw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0jutgg41pd-47._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0kc9gy1644-op._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0dqk6jms3f_58._.js → [root-of-the-server]__0m1vmtwh8l5-k._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0medeb4h2gk5t._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0e6jc57nsnwz0._.js → [root-of-the-server]__0ms1rulcx_yuq._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0s1-3vrrlq54r._.js → [root-of-the-server]__0o5b_c35hufmg._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0prgnysrc2l5k._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__14g_ger_h73lc._.js → [root-of-the-server]__0q520ovb9262s._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0qwtk85kstlpq._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0r3grb-nk-tkn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0rwbb97vk-mfk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0smp3m3n89xs_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vg4zd1ewm4lh._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vyu7gon1mqle._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0w6c1msz1xtdu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0xh5bb2c_6c9c._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1s4kh7tqvbssy._.js → [root-of-the-server]__0yk3ow36t_w2_._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0hzh1vkuuv1uk._.js → [root-of-the-server]__0zj60abydj_ho._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0zsd45jad6b40._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0abb0_151j5sb._.js → [root-of-the-server]__0ztucyaloy2ub._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0zux7hsnes_j2._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1u64nidrg-gwq._.js → [root-of-the-server]__1-i8tof72l68m._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__10--fi__uy8y7._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0haqb2u-0wd6e._.js → [root-of-the-server]__14_mjy9lqgp99._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__14b8pj1sucy1-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__16t85d4p3aldo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__17o5ki60ndwjg._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1o2w0n3t390ih._.js → [root-of-the-server]__17tyjwy7wmx2z._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1_do4zybj0nvi._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1a71wr5gfcvuh._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1bd0rsh28altd._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1bz0s-wy2cxhl._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1e8_j43j1t1m3._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__1ege7h8tb5rk0._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1gb1x1ubkdwig._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1gsm8s81ac08k._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hc1bcnovtwo2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1jaf9l240am9o._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ln0042a-s6yz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1m2fnptuk23jt._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ms_0h40h2rbg._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1nasewrsaxrlv._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1nw9nkdb5uv4i._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ogeha9-ljbre._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1p5s772lt24dg._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1pxyy29_t_ru1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1s_ky5a7nhgas._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1txu2n-l6c6yu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ulrsdu0e8fjb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1vngkcd8tjzqw._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1wi-k0dtwwxx3._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1wvm4n7d69s3x._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1x-u1u9mrt630._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1xpcaqsei77n2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1xx_3auad-kml._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1y0omyblg9j35._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1cda8yccka8pg._.js → [root-of-the-server]__1ya8xaf2pmzqp._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1z2d4j9-oei44._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1znqtfuuspj0w._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__205o-7lep9jth._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__20c3hyqykubh2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__20pn9h3od2anc._.js +3 -0
- package/.next/server/chunks/_02qwqg9i39x4_._.js +2 -2
- package/.next/server/chunks/_07_mi9-a9cp01._.js +1 -1
- package/.next/server/chunks/_0b2q7l141kz7e._.js +1 -1
- package/.next/server/chunks/_0b9gke5b17vzh._.js +1 -1
- package/.next/server/chunks/_0euocr-coaqik._.js +3 -0
- package/.next/server/chunks/_0nw90thm3bo4l._.js +3 -0
- package/.next/server/chunks/_0tz5wpjdgntj3._.js +1 -1
- package/.next/server/chunks/_12i51zlq-xxrl._.js +1 -1
- package/.next/server/chunks/_13ffmxv8qrwi0._.js +1 -1
- package/.next/server/chunks/_1b-7g4thtxfnp._.js +1 -1
- package/.next/server/chunks/_1csx8ckltgali._.js +2 -2
- package/.next/server/chunks/_1gtuhmdu6udof._.js +2 -2
- package/.next/server/chunks/_1h650rc49jtvn._.js +1 -1
- package/.next/server/chunks/_1pvqo-qnv-nqm._.js +1 -1
- package/.next/server/chunks/_1yvd01woddaxt._.js +2 -2
- package/.next/server/chunks/_1yx16tn5391kx._.js +3 -0
- package/.next/server/chunks/{src_lib_0osgsup3n2ypg._.js → src_lib_0-lb3lq-kl_f_._.js} +2 -2
- package/.next/server/chunks/src_lib_0gonw_e9wzfyz._.js +3 -0
- package/.next/server/chunks/src_lib_0nrx0t1s6u93x._.js +3 -0
- package/.next/server/chunks/src_lib_0oxhoj8rkufoe._.js +3 -0
- package/.next/server/chunks/src_lib_0qoy_28svqcku._.js +3 -0
- package/.next/server/chunks/src_lib_1-9hy2bx_0k7z._.js +3 -0
- package/.next/server/chunks/src_lib_11ce6iw15f7y2._.js +3 -0
- package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +59 -48
- package/.next/server/chunks/src_lib_1b_d9xsuzjp3e._.js +3 -0
- package/.next/server/chunks/src_lib_1q3pbd9tjh5t5._.js +3 -0
- package/.next/server/chunks/src_lib_ai_index_ts_0m0hlq4d9zy9i._.js +1 -1
- package/.next/server/chunks/src_lib_config_index_ts_14-9cq9wn5r30._.js +1 -1
- package/.next/server/chunks/src_lib_notebook-scope_ts_06eipvr6xztlf._.js +1 -1
- package/.next/server/chunks/src_lib_question_question-analysis_ts_1-3x2cfxlr3fs._.js +1 -1
- package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +1 -1
- package/.next/server/chunks/src_lib_tags_retag_ts_09s5xwrzcy144._.js +1 -1
- package/.next/server/chunks/{src_lib_telemetry_server_ts_03e7c8dt4slbj._.js → src_lib_telemetry_server_ts_0_290xuag9bk5._.js} +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__212x4ujehvgfr._.js → [root-of-the-server]__04nhi0374i4dp._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0w77craeuuak9._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__124rb-z-nm7o5._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1xgyz8jfhhs4j._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1yhcc4i7ps6s5._.js +3 -0
- package/.next/server/chunks/ssr/_05k02824g2tpo._.js +1 -1
- package/.next/server/chunks/ssr/_0a0h6yv1_61zn._.js +3 -0
- package/.next/server/chunks/ssr/_0cmd1ubdlo_by._.js +1 -1
- package/.next/server/chunks/ssr/_0htmdb0udewwn._.js +3 -0
- package/.next/server/chunks/ssr/{_1yclgq1umgl4p._.js → _0mp06uu5odp8m._.js} +2 -2
- package/.next/server/chunks/ssr/_0qbp5_0h-b69q._.js +3 -0
- package/.next/server/chunks/ssr/_0t-venqf7b-4q._.js +3 -0
- package/.next/server/chunks/ssr/_0xlbgtld9_r3o._.js +1 -1
- package/.next/server/chunks/ssr/_127aw5h992s9d._.js +4 -0
- package/.next/server/chunks/ssr/{_1x-_hs_sw5z1x._.js → _12ho9vlz1_nzo._.js} +1 -1
- package/.next/server/chunks/ssr/_14h_732sdmo6b._.js +3 -0
- package/.next/server/chunks/ssr/{_18c4g09vqhp-3._.js → _15n156j82yi_d._.js} +1 -1
- package/.next/server/chunks/ssr/_1wt7hpzajqoju._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_133xkxfckw9tf._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_1rxrrb2v6tutq._.js → node_modules_16_s8zyr3620u._.js} +1 -1
- package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_1klwivk06jo8p.js → node_modules_heic-to_dist_csp_heic-to_1brtdb7tndxid.js} +1 -1
- package/.next/server/chunks/ssr/src_0_qzoo_03n_v-._.js +1 -1
- package/.next/server/chunks/ssr/src_1gayunqs8u2e2._.js +1 -1
- package/.next/server/chunks/ssr/src_1o5f_wr8vv-x0._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5-txm8_._.js +1 -1
- package/.next/server/chunks/ssr/src_components_image-cropper_tsx_0pcp8-ifruyx-._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +78 -12
- package/.next/server/chunks/ssr/src_contexts_LanguageContext_tsx_0r6xucmeu1k5z._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_i18n_en_ts_08zkpwnoqey5s._.js +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/500.html +1 -1
- package/.next/server/preview-props.json +3 -3
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{26r74vzqszcs5.js → 05f13kdl-5r-c.js} +2 -2
- package/.next/static/chunks/0_cnc6gz9gqm8.js +264 -0
- package/.next/static/chunks/0a_jerp9yv-om.js +2 -0
- package/.next/static/chunks/0cpyqet_sqmdp.js +1 -0
- package/.next/static/chunks/0jyyrmsnlj04i.js +13 -0
- package/.next/static/chunks/0l8auoibmum0r.js +1 -0
- package/.next/static/chunks/0wn8i_n7wpzhy.js +8 -0
- package/.next/static/chunks/16qwioc_q7wfz.js +8 -0
- package/.next/static/chunks/1abwe-ep5g7rb.js +1 -0
- package/.next/static/chunks/{045cs_rolnmjd.js → 1joajsaunlqm-.js} +1 -1
- package/.next/static/chunks/{2da48dkivw_8a.js → 1kzmqap7asc46.js} +1 -1
- package/.next/static/chunks/2_0xdmmmic5_l.js +1 -0
- package/.next/static/chunks/{1ep255e058_3b.js → 2hl62fuxy23ky.js} +1 -1
- package/.next/static/chunks/{037g92rz3qjm_.js → 2hl9d1rdb9hkq.js} +1 -1
- package/.next/static/chunks/2hlvwtql2eiqy.js +1 -0
- package/.next/static/chunks/2xn7pbo1omgg1.css +3 -0
- package/.next/static/chunks/3-gt5s84owxj2.js +1 -0
- package/.next/static/chunks/3mnblmrqi_tcr.js +1 -0
- package/.next/static/chunks/3z7dqcxfd75wa.js +2 -0
- package/.next/static/chunks/{2aifo9g5v8kaq.js → 3zg1w_3pn3z75.js} +1 -1
- package/dist-scripts/scripts/rebuild-system-tags.js +3 -0
- package/dist-scripts/scripts/seed-university-grades.js +27 -0
- package/dist-scripts/src/lib/tags/data/index.js +1 -0
- package/dist-scripts/src/lib/tags/data/university.js +17 -0
- package/dist-scripts/src/lib/tags/seed/university-grades.js +32 -0
- package/launcher.js +11 -8
- package/package.json +1 -1
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__017-5vo1u87jc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__063yyz_9kliuv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0c7btjinzvmj3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0dpk56pxg3xh0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ehmpofr_lag1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0eksw09qkfp-z._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0g-4jw7pw15nc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0h82l-5c5x36d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0hiv6ho-1ced7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0hypc-hsxhr5m._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0k0-c4brxlw-a._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0k_gflpw7m236._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0km5gt590jg97._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0mgpyw67pdn1h._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0mztg1mhr7xw2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ni89i2lbtpir._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0nqc3uu_4-moq._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0nu-b-ap5ix-i._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0o72hu-jqh_kc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0q6of-nw_4lh-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0qyqo6m38w5z7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0u2_7w3b4f_c1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0xj4u1plpkmot._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0y0v79zd4u8g0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zqnlrgdhvyvb._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1-4kz5lwzu127._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1-sow_jqu0ca5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1-uyaylss8lu0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1-w4-6dnik6p3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1027cegzwspbv._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__106c17t6fe2s5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11jqvp7ydid38._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11r530r-p2-n1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11vx3bv6nef_u._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__123mmhkfg7y-y._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__128lq-3z36850._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1752yqg4c8167._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__189bp--__jedg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1a6hu09up7_co._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1a_qtu7129ho6._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1add4tef8riya._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1bdwqmj_bolrp._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1c6ti0495jkvs._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1drgctbrp51zt._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1dxi3-rtvg91t._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1edl3mpo9urp-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1g-_sfdjkcyjn._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1hdm1t67mdd4k._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1iy2ggxzd3waf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1j749v4z8i78u._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1jxcq-zd_xo0q._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1kwxq6h_s1nw5._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1lvrzjzsadms_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1m6lbueple6ww._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1oynoaepf6enj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1p1k9cmts3crw._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1purwqhaw584e._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1qe3_j74hbt45._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1qp07f8m-pjqu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1qr9n5maimy60._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1qzw098fzq6r4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1socdh68x-_68._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1t9nlkh7u11c9._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1th48iu_ygy4m._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1tznn8iry7lns._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1uxhodktwnw08._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1uxxzcdw7avod._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1v6k289his7kx._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1y-867werf6-u._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20an2fcjw_r3_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20vr6ko8apn2_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__2113u3fu2bhjr._.js +0 -3
- package/.next/server/chunks/_0ji5ibtw-dxaz._.js +0 -3
- package/.next/server/chunks/_1almac7c09mp4._.js +0 -3
- package/.next/server/chunks/src_lib_0iplyaedosuse._.js +0 -3
- package/.next/server/chunks/src_lib_152-vqegmmtew._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__09g6pf6gfjb-i._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__10y8dor72926b._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1t2h6rz1x-gwk._.js +0 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1vj6th0gehszy._.js +0 -3
- package/.next/server/chunks/ssr/_0oo8k-upgx7hb._.js +0 -3
- package/.next/server/chunks/ssr/_117fl8dk5qci2._.js +0 -4
- package/.next/server/chunks/ssr/_126p5i1ynlykc._.js +0 -3
- package/.next/server/chunks/ssr/_1bhvzfiuz3s7j._.js +0 -3
- package/.next/server/chunks/ssr/_1fx20-rihohax._.js +0 -3
- package/.next/server/chunks/ssr/_1qft_czd2ss62._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_0fzknrrqq1bjz._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_1fwhuynv-5kcg._.js +0 -3
- package/.next/static/chunks/059tntkmkgtf4.js +0 -1
- package/.next/static/chunks/0et32jq7vmu34.js +0 -13
- package/.next/static/chunks/0li0d9ufsgsk-.js +0 -1
- package/.next/static/chunks/0ovv_fq59i4y4.js +0 -1
- package/.next/static/chunks/0sl4wa-ghh5g7.js +0 -2
- package/.next/static/chunks/0xze-7xwdgel2.js +0 -8
- package/.next/static/chunks/1qb_yt4hvopfn.js +0 -8
- package/.next/static/chunks/25jnmrgxyy1tx.js +0 -1
- package/.next/static/chunks/2hroxfe_3_b0q.js +0 -1
- package/.next/static/chunks/32c19i38gl4zx.js +0 -1
- package/.next/static/chunks/3bq587l754kfc.js +0 -198
- package/.next/static/chunks/3bv2u8mcme1z4.css +0 -3
- package/.next/static/chunks/3g-l81pwd4ggm.js +0 -1
- package/.next/static/chunks/3m5wl0uzrt4sz.js +0 -2
- /package/.next/static/{vv9z38w24wHWYLUAbjtdk → 8txIetq9muxlc0OqsgaeI}/_buildManifest.js +0 -0
- /package/.next/static/{vv9z38w24wHWYLUAbjtdk → 8txIetq9muxlc0OqsgaeI}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{vv9z38w24wHWYLUAbjtdk → 8txIetq9muxlc0OqsgaeI}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,842727,e=>{var t=e.i(271645),n=e.i(981140),r=e.i(75830),o=e.i(820783),a=e.i(30030),i=e.i(610772),s=e.i(248425),l=e.i(30207),c=e.i(369340),u=e.i(586318),d=e.i(934620),f=Object.defineProperty,p=(e,t)=>f(e,"name",{value:t,configurable:!0}),h=!1;function m(){let[e,n]=t.useState(h);return t.useEffect(()=>{h||(h=!0,n(!0))},[]),e}p(m,"useIsHydrated");var g=t[" useSyncExternalStore ".trim().toString()];function v(){return()=>{}}function y(){return g(v,()=>!0,()=>!1)}p(v,"subscribe"),p(y,"useIsHydratedModern");var b="function"==typeof g?y:m,k=e.i(843476),w=Object.defineProperty,x=(e,t)=>w(e,"name",{value:t,configurable:!0}),j="rovingFocusGroup.onEntryFocus",E={bubbles:!1,cancelable:!0},C="RovingFocusGroup",[R,M,S]=(0,r.f)(C),[P,D]=(0,a.f)(C,[S]),[I,z]=P(C),N=t.forwardRef(x(function(e,t){return(0,k.jsx)(R.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,k.jsx)(R.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,k.jsx)(A,{...e,ref:t})})})},"RovingFocusGroup")),A=t.forwardRef(x(function(e,r){let{__scopeRovingFocusGroup:a,orientation:i,loop:d=!1,dir:f,currentTabStopId:p,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:g,preventScrollOnEntryFocus:v=!1,...y}=e,b=t.useRef(null),w=(0,o.f)(r,b),x=(0,u.f)(f),[R,S]=(0,c.f)({prop:p,defaultProp:h??null,onChange:m,caller:C}),[P,D]=t.useState(!1),z=(0,l.f)(g),N=M(a),A=t.useRef(!1),[T,_]=t.useState(0);return t.useEffect(()=>{let e=b.current;if(e)return e.addEventListener(j,z),()=>e.removeEventListener(j,z)},[z]),(0,k.jsx)(I,{scope:a,orientation:i,dir:x,loop:d,currentTabStopId:R,onItemFocus:t.useCallback(e=>S(e),[S]),onItemShiftTab:t.useCallback(()=>D(!0),[]),onFocusableItemAdd:t.useCallback(()=>_(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>_(e=>e-1),[]),children:(0,k.jsx)(s.V.div,{tabIndex:P||0===T?-1:0,"data-orientation":i,...y,ref:w,style:{outline:"none",...e.style},onMouseDown:(0,n.f)(e.onMouseDown,()=>{A.current=!0}),onFocus:(0,n.f)(e.onFocus,e=>{let t=!A.current;if(e.target===e.currentTarget&&t&&!P){let t=new CustomEvent(j,E);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=N().filter(e=>e.focusable);O([e.find(e=>e.active),e.find(e=>e.id===R),...e].filter(Boolean).map(e=>e.ref.current),v)}}A.current=!1}),onBlur:(0,n.f)(e.onBlur,()=>D(!1))})})},"RovingFocusGroupImpl")),T=t.forwardRef(x(function(e,r){let{__scopeRovingFocusGroup:o,focusable:a=!0,active:l=!1,tabStopId:c,children:u,...f}=e,p=(0,i.f)(),h=c||p,m=z("RovingFocusGroupItem",o),g=m.currentTabStopId===h,v=M(o),{onFocusableItemAdd:y,onFocusableItemRemove:w,currentTabStopId:x}=m,j=b();return(0,d.f)(()=>{if(j&&a)return y(),()=>w()},[j,a,y,w]),t.useEffect(()=>{if(!j&&a)return y(),()=>w()},[j,a,y,w]),(0,k.jsx)(R.ItemSlot,{scope:o,id:h,focusable:a,active:l,children:(0,k.jsx)(s.V.span,{tabIndex:g?0:-1,"data-orientation":m.orientation,...f,ref:r,onMouseDown:(0,n.f)(e.onMouseDown,e=>{a?m.onItemFocus(h):e.preventDefault()}),onFocus:(0,n.f)(e.onFocus,()=>m.onItemFocus(h)),onKeyDown:(0,n.f)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=L(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=v().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=m.loop?U(n,r+1):n.slice(r+1)}setTimeout(()=>O(n))}}),children:"function"==typeof u?u({isCurrentTabStop:g,hasTabStop:null!=x}):u})})},"RovingFocusGroupItem")),_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function F(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function L(e,t,n){let r=F(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return _[r]}function O(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function U(e,t){return e.map((n,r)=>e[(t+r)%e.length])}x(F,"getDirectionAwareKey"),x(L,"getFocusIntent"),x(O,"focusFirst"),x(U,"wrapArray"),e.s(["M",0,T,"F",0,N,"B",0,D],842727)},975153,e=>{var t=e.i(456420);let n={name:"calendar-check",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],975153)},749803,e=>{var t=e.i(456420);let n={name:"chart-column",size:24,node:[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],aliases:["bar-chart-3"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],749803)},867927,e=>{var t=e.i(456420);let n={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],867927)},548161,e=>{var t=e.i(456420);let n={name:"circle-check-big",size:24,node:[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-circle"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],548161)},551757,e=>{var t=e.i(456420);let n={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],551757)},583967,e=>{var t=e.i(456420);let n={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],583967)},515745,446513,e=>{var t=e.i(456420);let n={name:"clipboard-paste",size:24,node:[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],515745);let o={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};o.node;let a=(0,t.f)(o);e.s(["f",0,a],446513)},508734,e=>{var t=e.i(456420);let n={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],508734)},762368,e=>{var t=e.i(456420);let n={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],762368)},580860,e=>{var t=e.i(456420);let n={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],580860)},226091,e=>{var t=e.i(456420);let n={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],226091)},999092,e=>{var t=e.i(456420);let n={name:"languages",size:24,node:[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],999092)},21357,495178,79058,e=>{var t=e.i(456420);let n={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],21357);var o=e.i(41931),a=e.i(983761),i=e.i(128093);let s=["browser","minimax","qwen","glm","stepfun","volcengine","volcengine-agent","openai"];function l(e){return"string"==typeof e&&s.includes(e)}s.filter(e=>"browser"!==e),e.s(["C",0,{minimax:{model:"speech-2.8-hd",voice:"male-qn-jingying"},qwen:{model:"qwen-audio-3.0-tts-plus",voice:"longanlufeng"},glm:{model:"glm-tts",voice:"xiaochen"},stepfun:{model:"stepaudio-2.5-tts",voice:"qingniandaxuesheng"},volcengine:{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},"volcengine-agent":{model:"seed-tts-2.0",voice:"zh_male_yangguangqingnian_uranus_bigtts"},openai:{model:"gpt-4o-mini-tts",voice:"cedar"}},"r",0,{minimax:{apiKey:"https://platform.minimax.cn/docs/guides/quickstart-preparation",model:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http",voice:"https://platform.minimax.cn/docs/faq/system-voice-id",endpoint:"https://platform.minimax.cn/docs/api-reference/speech-t2a-http"},qwen:{apiKey:"https://help.aliyun.com/zh/model-studio/token-plan-personal-quick-start",model:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide",voice:"https://help.aliyun.com/zh/model-studio/qwen-audio-tts-voice-list",endpoint:"https://help.aliyun.com/zh/model-studio/non-realtime-tts-user-guide"},glm:{apiKey:"https://docs.bigmodel.cn/cn/guide/start/quick-start",model:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",voice:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3",endpoint:"https://docs.bigmodel.cn/api-reference/%E6%A8%A1%E5%9E%8B-api/%E6%96%87%E6%9C%AC%E8%BD%AC%E8%AF%AD%E9%9F%B3"},stepfun:{apiKey:"https://platform.stepfun.com/docs/zh/step-plan/integrations/audio-api",model:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio",voice:"https://platform.stepfun.com/docs/zh/guides/developer/tts",endpoint:"https://platform.stepfun.com/docs/zh/api-reference/audio/create-audio"},volcengine:{apiKey:"https://www.volcengine.com/docs/6561/196768",model:"https://www.volcengine.com/docs/6561/1598757",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://www.volcengine.com/docs/6561/1598757"},openai:{apiKey:"https://platform.openai.com/docs/quickstart",model:"https://developers.openai.com/api/docs/guides/text-to-speech",voice:"https://developers.openai.com/api/docs/guides/text-to-speech",endpoint:"https://developers.openai.com/api/docs/guides/text-to-speech"},"volcengine-agent":{apiKey:"https://ark.volcengine.com/region:cn-beijing/docs/82379/2160841?lang=zh",model:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh",voice:"https://www.volcengine.com/docs/6561/1257544",endpoint:"https://docs.volcengine.com/docs/ark/agent-plan-personal-voice-model?lang=zh"}},"D",0,{volcengine:"https://docs.volcengine.com/docs/ark/free-inference-quota?lang=zh"},"l",0,s,"E",0,function(e,t){if("volcengine"===e)return"https://openspeech.bytedance.com/api/v3/tts/unidirectional";if("volcengine-agent"===e)return"https://openspeech.bytedance.com/api/v3/plan/tts/unidirectional";if("openai"===e)return`${(t?.baseUrl||"https://api.openai.com/v1").replace(/\/+$/,"")}/audio/speech`;let{baseUrl:n}=(0,i.k)(e,t);if("minimax"===e)return`${n.replace(/\/+$/,"")}/t2a_v2`;if("glm"===e||"stepfun"===e)return`${n.replace(/\/+$/,"")}/audio/speech`;try{return`${new URL(n).origin}/api/v1/services/audio/tts/SpeechSynthesizer`}catch{return""}},"L",0,function(e,t){if("openai"===t){let t=e.openai?.instances?.find(t=>t.id===e.openai?.activeInstanceId);return t?{apiKey:t.apiKey,baseUrl:t.baseUrl}:void 0}return e[t]},"S",0,function(e){return"volcengine"===e||"openai"===e},"y",0,function(e){return"browser"!==e&&l(e)},"Z",0,l],495178);let c=null;function u(){return c??=o.k.get("/api/tts").then(e=>({mode:"cloud"===e.mode?"cloud":"browser",ttsMode:l(e.ttsMode)?e.ttsMode:null})).catch(()=>({mode:"browser",ttsMode:null}))}let d=null,f=!1;function p(){return"u"<typeof Audio?null:d??=new Audio}let h=new Map,m=(e,t)=>`${t}
|
|
2
|
+
${e}`;function g(e,t,n,r){return o.k.post("/api/tts/batch",{texts:e,language:t,...n?{regenerate:n}:{},...r?{errorItemId:r}:{}},{timeout:6e5,recoverable:!0}).then(({items:e})=>e.map(({id:e,version:t})=>`/api/tts/${e}?v=${t}`))}async function v(e,t,n){let r=await g(e,t,!0,n);e.forEach((e,n)=>h.set(m(e,t),Promise.resolve(r[n])))}e.s(["l",0,p,"v",0,function(){return u().then(e=>e.mode)},"h",0,function(){return f},"z",0,function(e,t){return o.k.post("/api/tts/status",{texts:e,language:t}).then(e=>!0===e.ready).catch(()=>!1)},"w",0,function(e,t,n){let r=[...new Set(e)].filter(e=>!h.has(m(e,t)));if(!r.length)return Promise.resolve();let o=g(r,t,!1,n);return r.forEach((e,n)=>{let r=m(e,t),a=o.then(e=>e[n]);a.catch(()=>h.delete(r)),h.set(r,a)}),o.then(()=>void 0)},"H",0,v,"U",0,function(e,t){let n=m(e,t),r=h.get(n);!r&&((r=o.k.post("/api/tts",{text:e,language:t},{timeout:12e4,recoverable:!0}).then(({id:e,version:t})=>`/api/tts/${e}?v=${t}`)).catch(()=>h.delete(n)),h.set(n,r));return r},"E",0,function(){u().then(({mode:e,ttsMode:t})=>{let n="browser"===e?"browser":t;n&&(0,a.E)(`tts:${n}`)&&(0,a.z)("tts_used",{mode:n})}).catch(()=>void 0)},"p",0,function(){let e=p();if(e&&!f){let t,n,r;f=!0,t=new DataView(new ArrayBuffer(1644)),(n=(e,n)=>[...n].forEach((n,r)=>t.setUint8(e+r,n.charCodeAt(0))))(0,"RIFF"),t.setUint32(4,1636,!0),n(8,"WAVE"),n(12,"fmt "),t.setUint32(16,16,!0),t.setUint16(20,1,!0),t.setUint16(22,1,!0),t.setUint32(24,8e3,!0),t.setUint32(28,16e3,!0),t.setUint16(32,2,!0),t.setUint16(34,16,!0),n(36,"data"),t.setUint32(40,1600,!0),r="",new Uint8Array(t.buffer).forEach(e=>{r+=String.fromCharCode(e)}),e.src=`data:audio/wav;base64,${btoa(r)}`,e.play().catch(()=>{f=!1})}}],79058)},77071,e=>{var t=e.i(456420);let n={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],77071)},741120,e=>{var t=e.i(456420);let n={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],741120)},395925,e=>{var t=e.i(456420);let n={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],395925)},980105,e=>{var t=e.i(456420);let n={name:"scan-text",size:24,node:[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],980105)},328623,e=>{var t=e.i(456420);let n={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],328623)},853138,e=>{var t=e.i(456420);let n={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],853138)},725981,e=>{var t=e.i(456420);let n={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],725981)},901279,e=>{var t=e.i(456420);let n={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],901279)},534693,e=>{var t=e.i(456420);let n={name:"wand-sparkles",size:24,node:[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],aliases:["wand-2"]};n.node;let r=(0,t.f)(n);e.s(["f",0,r])},994533,e=>{var t=e.i(534693);e.s(["f",()=>t.f])},263676,e=>{var t=e.i(456420);let n={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};n.node;let r=(0,t.f)(n);e.s(["X",0,r],263676)},522016,(e,t,n)=>{e.i(247167),Object.defineProperty(n,"__esModule",{value:!0});var r={default:function(){return v},useLinkStatus:function(){return b}};for(var o in r)Object.defineProperty(n,o,{enumerable:!0,get:r[o]});let a=e.r(190809),i=e.r(843476),s=a._(e.r(271645)),l=e.r(195057),c=e.r(8372),u=e.r(818581),d=e.r(718967),f=e.r(405550),p=e.r(388540),h=e.r(91949),m=e.r(573668),g=e.r(509396);function v(t){var n;let r,o,a,[v,b]=(0,s.useOptimistic)(h.IDLE_LINK_STATUS),k=(0,s.useRef)(null),{href:w,as:x,children:j,prefetch:E=null,passHref:C,replace:R,shallow:M,scroll:S,onClick:P,onMouseEnter:D,onTouchStart:I,legacyBehavior:z=!1,onNavigate:N,transitionTypes:A,ref:T,unstable_dynamicOnHover:_,...F}=t;r=j,z&&("string"==typeof r||"number"==typeof r)&&(r=(0,i.jsx)("a",{children:r}));let L=s.default.useContext(c.AppRouterContext),O=!1!==E,U=!1===E?"none":!0===E?"full":"auto",$="none"!==U?"auto"===U?g.FetchStrategy.PPR:g.FetchStrategy.Full:g.FetchStrategy.PPR,B="string"==typeof(n=x||w)?n:(0,l.formatUrl)(n);if(z){if(r?.$$typeof===Symbol.for("react.lazy"))throw Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag.");o=s.default.Children.only(r)}let q=z?o&&"object"==typeof o&&o.ref:T,V,K=s.default.useCallback(e=>(null!==L&&(k.current=(0,h.mountLinkInstance)(e,B,L,$,O,b,V)),()=>{k.current&&((0,h.unmountLinkForCurrentNavigation)(k.current),k.current=null),(0,h.unmountPrefetchableInstance)(e)}),[O,B,L,$,b,V]),H={ref:(0,u.useMergedRef)(K,q),onClick(t){z||"function"!=typeof P||P(t),z&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(t),!L||t.defaultPrevented||function(t,n,r,o,a,i,s,l="none"){if("u">typeof window){let c,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((c=t.currentTarget.getAttribute("target"))&&"_self"!==c||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(n)){o&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),i){let e=!1;if(i({preventDefault:()=>{e=!0}}),e)return}let{navigate:d}=e.r(132916);d(n,o?"replace":"push",!1===a?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,r.current,s,l)}}(t,B,k,R,S,N,A,U)},onMouseEnter(e){z||"function"!=typeof D||D(e),z&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),L&&O&&(0,h.onNavigationIntent)(e.currentTarget,!0===_)},onTouchStart:function(e){z||"function"!=typeof I||I(e),z&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),L&&O&&(0,h.onNavigationIntent)(e.currentTarget,!0===_)}};return(0,d.isAbsoluteUrl)(B)?H.href=B:z&&!C&&("a"!==o.type||"href"in o.props)||(H.href=(0,f.addBasePath)(B)),a=z?s.default.cloneElement(o,H):(0,i.jsx)("a",{...F,...H,children:r}),(0,i.jsx)(y.Provider,{value:v,children:a})}let y=(0,s.createContext)(h.IDLE_LINK_STATUS),b=()=>(0,s.useContext)(y);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},818581,(e,t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return o}});let r=e.r(271645);function o(e,t){let n=(0,r.useRef)(null),o=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(n.current=a(e,r)),t&&(o.current=a(t,r))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},195057,(e,t,n)=>{e.i(247167),Object.defineProperty(n,"__esModule",{value:!0});var r={formatUrl:function(){return s},formatWithValidation:function(){return c},urlObjectKeys:function(){return l}};for(var o in r)Object.defineProperty(n,o,{enumerable:!0,get:r[o]});let a=e.r(190809)._(e.r(998183)),i=/https?|ftp|gopher|file/;function s(e){let{auth:t,hostname:n}=e,r=e.protocol||"",o=e.pathname||"",s=e.hash||"",l=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?`[${n}]`:n),e.port&&(c+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let u=e.search||l&&`?${l}`||"";return r&&!r.endsWith(":")&&(r+=":"),e.slashes||(!r||i.test(r))&&!1!==c?(c="//"+(c||""),o&&"/"!==o[0]&&(o="/"+o)):c||(c=""),s&&"#"!==s[0]&&(s="#"+s),u&&"?"!==u[0]&&(u="?"+u),o=o.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${r}${c}${o}${u}${s}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function c(e){return s(e)}},573668,(e,t,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"isLocalURL",{enumerable:!0,get:function(){return a}});let r=e.r(718967),o=e.r(652817);function a(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,o.hasBasePath)(n.pathname)}catch(e){return!1}}},718967,(e,t,n)=>{e.i(247167),Object.defineProperty(n,"__esModule",{value:!0});var r={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return w},MissingStaticPage:function(){return k},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return m},ST:function(){return g},WEB_VITALS:function(){return a},execOnce:function(){return i},getDisplayName:function(){return d},getLocationOrigin:function(){return c},getURL:function(){return u},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return x}};for(var o in r)Object.defineProperty(n,o,{enumerable:!0,get:r[o]});let a=["CLS","FCP","INP","LCP","TTFB"];function i(e){let t,n=!1;return(...r)=>(n||(n=!0,t=e(...r)),t)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>{let t=e.charCodeAt(0);return!!(t>=65&&t<=90||t>=97&&t<=122)&&s.test(e)};function c(){let{protocol:e,hostname:t,port:n}=window.location;return`${e}//${t}${n?":"+n:""}`}function u(){let{href:e}=window.location,t=c();return e.substring(t.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&f(n))return r;if(!r)throw Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${r}" instead.`);return r}let m="u">typeof performance,g=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class k extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class w extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function x(e){return JSON.stringify({message:e.message,stack:e.stack})}},772325,e=>{var t=e.i(722219);e.s(["z",0,t])},213056,e=>{var t=e.i(722219);e.s(["z",0,t])},282492,e=>{var t=e.i(722219);e.s(["z",0,t])},978056,e=>{var t=e.i(722219);e.s(["z",0,t])},411382,e=>{var t=e.i(722219);e.s(["z",0,t])},54105,e=>{var t=e.i(722219);e.s(["z",0,t])},999593,424553,e=>{var t=e.i(843476),n=e.i(257428),r=e.i(111110);function o(){let{t:e}=(0,r.b)();return(0,t.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,t.jsx)("ul",{className:"list-disc space-y-1 pl-5 text-muted-foreground",children:e.eula.summary.map(e=>(0,t.jsx)("li",{children:e},e))}),(0,t.jsx)("a",{href:"/eula",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-primary hover:underline",children:e.eula.viewFull})]})}e.s(["f",0,o],424553),e.s(["f",0,function({checked:e,onCheckedChange:a,disabled:i}){let{t:s}=(0,r.b)();return(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border p-3",children:[(0,t.jsx)("p",{className:"text-sm font-medium",children:s.eula.title}),(0,t.jsx)(o,{}),(0,t.jsxs)("label",{className:"flex items-start gap-2 text-sm",children:[(0,t.jsx)(n.f,{id:"eula-consent",className:"mt-0.5",checked:e,disabled:i,onCheckedChange:e=>a(!0===e)}),(0,t.jsx)("span",{children:s.eula.consentLabel})]})]})}],999593)},515288,e=>{var t=e.i(843476),n=e.i(975157);e.s(["N",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,n.f)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})},"O",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,n.f)("px-6",e),...r})},"u",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,n.f)("text-muted-foreground text-sm",e),...r})},"Y",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,n.f)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})},"v",0,function({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,n.f)("leading-none font-semibold",e),...r})}])},257428,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(820783),o=e.i(30030),a=e.i(981140),i=e.i(369340),s=e.i(635804),l=e.i(296626),c=e.i(248425),u=Object.defineProperty,d=(e,t)=>u(e,"name",{value:t,configurable:!0}),f="Checkbox",[p,h]=(0,o.f)(f),[m,g]=p(f);function v(e){let{__scopeCheckbox:r,checked:o,children:a,defaultChecked:s,disabled:l,form:c,name:u,onCheckedChange:d,required:p,value:h="on",internal_do_not_use_render:g}=e,[v,y]=(0,i.f)({prop:o,defaultProp:s??!1,onChange:d,caller:f}),[b,k]=n.useState(null),[w,E]=n.useState(null),[C,R]=n.useState(null),M=!b||!!c||!!b.closest("form"),S={checked:v,disabled:l,setChecked:y,control:b,setControl:k,name:u,form:c,value:h,userClick:C,onUserClick:R,required:p,defaultChecked:!j(s)&&s,isFormControl:M,bubbleInput:w,setBubbleInput:E};return(0,t.jsx)(m,{scope:r,...S,children:x(g)?g(S):a})}d(v,"CheckboxProvider");var y=n.forwardRef(d(function({__scopeCheckbox:e,onKeyDown:o,onClick:i,...s},l){let{control:u,value:f,disabled:p,checked:h,required:m,setControl:v,setChecked:y,onUserClick:b,isFormControl:k,bubbleInput:w}=g("CheckboxTrigger",e),x=(0,r.f)(l,v),C=n.useRef(h);return n.useEffect(()=>{let e=u?.form;if(e){let t=d(()=>y(C.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[u,y]),(0,t.jsx)(c.V.button,{type:"button",role:"checkbox","aria-checked":j(h)?"mixed":h,"aria-required":m,"data-state":E(h),"data-disabled":p?"":void 0,disabled:p,value:f,...s,ref:x,onKeyDown:(0,a.f)(o,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,a.f)(i,e=>{let t=e.isPropagationStopped();b({requestedChecked:!!j(h)||!h,hasConsumerStoppedPropagation:t}),y(e=>!!j(e)||!e),w&&k&&!t&&e.stopPropagation()})})},"CheckboxTrigger")),b=n.forwardRef(d(function(e,n){let{__scopeCheckbox:r,name:o,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return(0,t.jsx)(v,{__scopeCheckbox:r,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:u,name:o,form:d,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y,{...f,ref:n,__scopeCheckbox:r}),e&&(0,t.jsx)(w,{__scopeCheckbox:r})]})})},"Checkbox")),k=n.forwardRef(d(function(e,n){let{__scopeCheckbox:r,forceMount:o,...a}=e,i=g("CheckboxIndicator",r);return(0,t.jsx)(l.f,{present:o||j(i.checked)||!0===i.checked,children:(0,t.jsx)(c.V.span,{"data-state":E(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:n,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),w=n.forwardRef(d(function({__scopeCheckbox:e,onClick:o,...i},l){let{control:u,userClick:d,checked:f,defaultChecked:p,required:h,disabled:m,name:v,value:y,form:b,bubbleInput:k,setBubbleInput:w}=g("CheckboxBubbleInput",e),x=(0,r.f)(l,w),E=(0,s.f)(u),C=n.useRef(!1),R=n.useRef(f),M=n.useRef(d),S=n.useRef(null);n.useEffect(()=>{if(!k)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=R.current!==f;R.current=f;let n=null!==d&&d!==M.current;if(M.current=d,n)S.current=t?null:d,t&&(k.indeterminate=j(f),e.call(k,!j(f)&&f)),k.dispatchEvent(new Event("click",{bubbles:!d.hasConsumerStoppedPropagation}));else if(t){let t=S.current;S.current=null;let n=t?.requestedChecked===f;C.current=!0,k.indeterminate=j(f),e.call(k,!j(f)&&f),k.dispatchEvent(new Event("click",{bubbles:!(n&&t.hasConsumerStoppedPropagation)})),C.current=!1}},[k,f,d]);let P=n.useRef(!j(f)&&f);return(0,t.jsx)(c.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:p??P.current,required:h,disabled:m,name:v,value:y,form:b,...i,tabIndex:-1,ref:x,onClick:(0,a.f)(o,e=>{C.current&&e.stopPropagation()}),style:{...i.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function x(e){return"function"==typeof e}function j(e){return"indeterminate"===e}function E(e){return j(e)?"indeterminate":e?"checked":"unchecked"}d(x,"isFunction"),d(j,"isIndeterminate"),d(E,"getState");var C=e.i(689664),R=e.i(975157);let M=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(b,{ref:r,className:(0,R.f)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...n,children:(0,t.jsx)(k,{className:(0,R.f)("flex items-center justify-center text-current"),children:(0,t.jsx)(C.f,{className:"h-4 w-4"})})}));M.displayName=b.displayName,e.s(["f",0,M],257428)},776639,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(981140),o=e.i(820783),a=e.i(30030),i=e.i(610772),s=e.i(369340),l=e.i(726330),c=e.i(765491),u=e.i(774606),d=e.i(296626),f=e.i(248425),p=e.i(303536),h=e.i(934620),m=e.i(985369),g=e.i(186312),v=e.i(991918),y=Object.defineProperty,b=(e,t)=>y(e,"name",{value:t,configurable:!0}),k="Dialog",[w,x]=(0,a.f)(k),[j,E]=w(k),C=b(e=>{let{__scopeDialog:r,children:o,open:a,defaultOpen:l,onOpenChange:u,modal:d=!0}=e,f=n.useRef(null),p=n.useRef(null),{nodes:h,registry:m}=(0,c.D)(),[g,v]=(0,s.f)({prop:a,defaultProp:l??!1,onChange:u,caller:k}),[y,b]=n.useState(0),[w,x]=n.useState(0);return(0,t.jsx)(j,{scope:r,triggerRef:f,contentRef:p,contentId:(0,i.f)(),titleId:(0,i.f)(),descriptionId:(0,i.f)(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:b,setDescriptionCount:x,open:g,onOpenChange:v,onOpenToggle:n.useCallback(()=>v(e=>!e),[v]),modal:d,branchNodes:h,branchRegistry:m,children:o})},"Dialog"),R=n.forwardRef(b(function(e,n){let{__scopeDialog:a,...i}=e,s=E("DialogTrigger",a),l=(0,o.f)(n,s.triggerRef);return(0,t.jsx)(f.V.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":V(s.open),...i,ref:l,onClick:(0,r.f)(e.onClick,s.onOpenToggle)})},"DialogTrigger")),M="DialogPortal",[S,P]=w(M,{forceMount:void 0}),D=b(e=>{let{__scopeDialog:r,forceMount:o,children:a,container:i}=e,s=E(M,r);return(0,t.jsx)(S,{scope:r,forceMount:o,children:n.Children.map(a,e=>(0,t.jsx)(d.f,{present:o||s.open,children:(0,t.jsx)(u.f,{asChild:!0,container:i,children:e})}))})},"DialogPortal"),I="DialogOverlay",z=n.forwardRef(b(function(e,n){let r=P(I,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,i=E(I,e.__scopeDialog);return i.modal?(0,t.jsx)(d.f,{present:o||i.open,children:(0,t.jsx)(A,{...a,ref:n})}):null},"DialogOverlay")),N=(0,v.B)("DialogOverlay.RemoveScroll"),A=n.forwardRef(b(function(e,r){let{__scopeDialog:a,...i}=e,s=E(I,a),c=(0,l.y)(),u=(0,o.f)(r,c);return(0,t.jsx)(m.f,{as:N,allowPinchZoom:!0,shards:n.useMemo(()=>[s.contentRef,...s.branchNodes.map(e=>({current:e}))],[s.contentRef,s.branchNodes]),children:(0,t.jsx)(f.V.div,{"data-state":V(s.open),...i,ref:u,style:{pointerEvents:"auto",...i.style}})})},"DialogOverlayImpl")),T="DialogContent",_=n.forwardRef(b(function(e,n){let r=P(T,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,i=E(T,e.__scopeDialog);return(0,t.jsx)(d.f,{present:o||i.open,children:i.modal?(0,t.jsx)(F,{...a,ref:n}):(0,t.jsx)(L,{...a,ref:n})})},"DialogContent")),F=n.forwardRef(b(function(e,a){let i=E(T,e.__scopeDialog),s=n.useRef(null),l=(0,o.f)(a,i.contentRef,s);return n.useEffect(()=>{let e=s.current;if(e)return(0,g.f)(e)},[]),(0,t.jsx)(O,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:(0,r.f)(e.onCloseAutoFocus,e=>{e.preventDefault(),i.triggerRef.current?.focus()}),onPointerDownOutside:(0,r.f)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,r.f)(e.onFocusOutside,e=>e.preventDefault())})},"DialogContentModal")),L=n.forwardRef(b(function(e,r){let o=E(T,e.__scopeDialog),a=n.useRef(!1),i=n.useRef(!1);return(0,t.jsx)(O,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||o.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let n=t.target;o.triggerRef.current?.contains(n)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})},"DialogContentNonModal")),O=n.forwardRef(b(function(e,n){let{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,"aria-describedby":s,children:u,...d}=e,f=E(T,r);return(0,p.f)(),(0,t.jsx)(c.l,{registry:f.branchRegistry,children:(0,t.jsx)(c.v,{asChild:!0,loop:!0,trapped:o,branches:f.branchNodes,onMountAutoFocus:a,onUnmountAutoFocus:i,children:(0,t.jsx)(l.V,{role:"dialog",id:f.contentId,"aria-labelledby":f.titlePresent?f.titleId:void 0,"aria-describedby":f.descriptionPresent?q(s,f.descriptionId):s,"data-state":V(f.open),...d,ref:n,deferPointerDownOutside:!0,onDismiss:()=>f.onOpenChange(!1),children:u})})})},"DialogContentImpl")),U=n.forwardRef(b(function(e,n){let{__scopeDialog:r,...o}=e,a=E("DialogTitle",r),{setTitleCount:i}=a;return(0,h.f)(()=>(i(e=>e+1),()=>i(e=>e-1)),[i]),(0,t.jsx)(f.V.h2,{id:a.titleId,...o,ref:n})},"DialogTitle")),$=n.forwardRef(b(function(e,n){let{__scopeDialog:r,...o}=e,a=E("DialogDescription",r),{setDescriptionCount:i}=a;return(0,h.f)(()=>(i(e=>e+1),()=>i(e=>e-1)),[i]),(0,t.jsx)(f.V.p,{id:a.descriptionId,...o,ref:n})},"DialogDescription")),B=n.forwardRef(b(function(e,n){let{__scopeDialog:o,...a}=e,i=E("DialogClose",o);return(0,t.jsx)(f.V.button,{type:"button",...a,ref:n,onClick:(0,r.f)(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function q(...e){let t=new Set;for(let n of e)if("string"==typeof n)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(" "):void 0}function V(e){return e?"open":"closed"}b(q,"concatAriaDescribedby"),b(V,"getState");var K=e.i(263676),H=e.i(975157);let G=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(z,{ref:r,className:(0,H.f)("fixed inset-0 z-50 bg-black/50 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));G.displayName=z.displayName;let X=n.forwardRef(({className:e,children:n,...r},o)=>(0,t.jsxs)(D,{children:[(0,t.jsx)(G,{}),(0,t.jsxs)(_,{ref:o,onPointerDownOutside:e=>{e.preventDefault()},className:(0,H.f)("fixed inset-0 m-auto h-fit z-50 grid w-[calc(100%-2rem)] max-w-lg gap-4 rounded-2xl border bg-card p-6 shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...r,children:[n,(0,t.jsxs)(B,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,t.jsx)(K.X,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));X.displayName=_.displayName;let W=({className:e,...n})=>(0,t.jsx)("div",{className:(0,H.f)("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});W.displayName="DialogHeader";let Z=({className:e,...n})=>(0,t.jsx)("div",{className:(0,H.f)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});Z.displayName="DialogFooter";let J=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(U,{ref:r,className:(0,H.f)("text-lg font-semibold leading-none tracking-tight",e),...n}));J.displayName=U.displayName;let Q=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)($,{ref:r,className:(0,H.f)("text-sm text-muted-foreground",e),...n}));Q.displayName=$.displayName,e.s(["N",0,C,"d",0,X,"C",0,Q,"c",0,Z,"s",0,W,"F",0,J,"a",0,R],776639)},110204,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(248425),o=Object.defineProperty,a=n.forwardRef(o(function(e,n){return(0,t.jsx)(r.V.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0})),i=e.i(975157);e.s(["f",0,function({className:e,...n}){return(0,t.jsx)(a,{"data-slot":"label",className:(0,i.f)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}],110204)},699375,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(981140),o=e.i(820783),a=e.i(30030),i=e.i(369340),s=e.i(635804),l=e.i(248425),c=Object.defineProperty,u=(e,t)=>c(e,"name",{value:t,configurable:!0}),d="Switch",[f,p]=(0,a.f)(d),[h,m]=f(d);function g(e){let{__scopeSwitch:r,checked:o,children:a,defaultChecked:s,disabled:l,form:c,name:u,onCheckedChange:f,required:p,value:m="on",internal_do_not_use_render:g}=e,[v,y]=(0,i.f)({prop:o,defaultProp:s??!1,onChange:f,caller:d}),[b,k]=n.useState(null),[x,j]=n.useState(null),[E,C]=n.useState(null),R=!b||!!c||!!b.closest("form"),M={checked:v,setChecked:y,disabled:l,control:b,setControl:k,name:u,form:c,value:m,userClick:E,onUserClick:C,required:p,defaultChecked:s,isFormControl:R,bubbleInput:x,setBubbleInput:j};return(0,t.jsx)(h,{scope:r,...M,children:w(g)?g(M):a})}u(g,"SwitchProvider");var v=n.forwardRef(u(function({__scopeSwitch:e,onClick:a,...i},s){let{control:c,form:d,value:f,disabled:p,checked:h,required:g,setControl:v,setChecked:y,onUserClick:b,isFormControl:k,bubbleInput:w}=m("SwitchTrigger",e),j=(0,o.f)(s,v),E=n.useRef(h);return n.useEffect(()=>{let e=d?c?.ownerDocument.getElementById(d):c?.form;if(e instanceof HTMLFormElement){let t=u(()=>y(E.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[c,d,y]),(0,t.jsx)(l.V.button,{type:"button",role:"switch","aria-checked":h,"aria-required":g,"data-state":x(h),"data-disabled":p?"":void 0,disabled:p,value:f,...i,ref:j,onClick:(0,r.f)(a,e=>{let t=e.isPropagationStopped();b({requestedChecked:!h,hasConsumerStoppedPropagation:t}),y(e=>!e),w&&k&&!t&&e.stopPropagation()})})},"SwitchTrigger")),y=n.forwardRef(u(function(e,n){let{__scopeSwitch:r,name:o,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return(0,t.jsx)(g,{__scopeSwitch:r,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:u,name:o,form:d,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{...f,ref:n,__scopeSwitch:r}),e&&(0,t.jsx)(k,{__scopeSwitch:r})]})})},"Switch")),b=n.forwardRef(u(function(e,n){let{__scopeSwitch:r,...o}=e,a=m("SwitchThumb",r);return(0,t.jsx)(l.V.span,{"data-state":x(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:n})},"SwitchThumb")),k=n.forwardRef(u(function({__scopeSwitch:e,onClick:a,...i},c){let{control:u,userClick:d,checked:f,defaultChecked:p,required:h,disabled:g,name:v,value:y,form:b,bubbleInput:k,setBubbleInput:w}=m("SwitchBubbleInput",e),x=(0,o.f)(c,w),j=(0,s.f)(u),E=n.useRef(!1),C=n.useRef(f),R=n.useRef(d),M=n.useRef(null);n.useEffect(()=>{if(!k)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(!e)return;let t=C.current!==f;C.current=f;let n=null!==d&&d!==R.current;if(R.current=d,n)M.current=t?null:d,t&&e.call(k,f),k.dispatchEvent(new Event("click",{bubbles:!d.hasConsumerStoppedPropagation}));else if(t){let t=M.current;M.current=null;let n=t?.requestedChecked===f;E.current=!0,e.call(k,f),k.dispatchEvent(new Event("click",{bubbles:!(n&&t.hasConsumerStoppedPropagation)})),E.current=!1}},[k,f,d]);let S=n.useRef(f);return(0,t.jsx)(l.V.input,{type:"checkbox","aria-hidden":!0,defaultChecked:p??S.current,required:h,disabled:g,name:v,value:y,form:b,...i,tabIndex:-1,ref:x,onClick:(0,r.f)(a,e=>{E.current&&e.stopPropagation()}),style:{...i.style,...j,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function w(e){return"function"==typeof e}function x(e){return e?"checked":"unchecked"}u(w,"isFunction"),u(x,"getState");var j=e.i(975157);let E=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(y,{className:(0,j.f)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...n,ref:r,children:(0,t.jsx)(b,{className:(0,j.f)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));E.displayName=y.displayName,e.s(["f",0,E],699375)},677572,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(981140),o=e.i(30030),a=e.i(842727),i=e.i(296626),s=e.i(248425),l=e.i(586318),c=e.i(369340),u=e.i(610772),d=Object.defineProperty,f=(e,t)=>d(e,"name",{value:t,configurable:!0}),p="Tabs",[h,m]=(0,o.f)(p,[a.B]),g=(0,a.B)(),[v,y]=h(p),b=n.forwardRef(f(function(e,n){let{__scopeTabs:r,value:o,onValueChange:a,defaultValue:i,orientation:d="horizontal",dir:f,activationMode:h="automatic",...m}=e,g=(0,l.f)(f),[y,b]=(0,c.f)({prop:o,onChange:a,defaultProp:i??"",caller:p});return(0,t.jsx)(v,{scope:r,baseId:(0,u.f)(),value:y,onValueChange:b,orientation:d,dir:g,activationMode:h,children:(0,t.jsx)(s.V.div,{dir:g,"data-orientation":d,...m,ref:n})})},"Tabs")),k=n.forwardRef(f(function(e,n){let{__scopeTabs:r,loop:o=!0,...i}=e,l=y("TabsList",r),c=g(r);return(0,t.jsx)(a.F,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:o,children:(0,t.jsx)(s.V.div,{role:"tablist","aria-orientation":l.orientation,...i,ref:n})})},"TabsList")),w=n.forwardRef(f(function(e,n){let{__scopeTabs:o,value:i,disabled:l=!1,...c}=e,u=y("TabsTrigger",o),d=g(o),f=j(u.baseId,i),p=E(u.baseId,i),h=i===u.value;return(0,t.jsx)(a.M,{asChild:!0,...d,focusable:!l,active:h,children:(0,t.jsx)(s.V.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":p,"data-state":h?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:f,...c,ref:n,onMouseDown:(0,r.f)(e.onMouseDown,e=>{l||0!==e.button||!1!==e.ctrlKey?e.preventDefault():(e.currentTarget.focus(),u.onValueChange(i))}),onKeyDown:(0,r.f)(e.onKeyDown,e=>{!l&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&u.onValueChange(i)}),onFocus:(0,r.f)(e.onFocus,()=>{let e="manual"!==u.activationMode;h||l||!e||u.onValueChange(i)})})})},"TabsTrigger")),x=n.forwardRef(f(function(e,r){let{__scopeTabs:o,value:a,forceMount:l,children:c,...u}=e,d=y("TabsContent",o),f=j(d.baseId,a),p=E(d.baseId,a),h=a===d.value,m=n.useRef(h);return n.useEffect(()=>{let e=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(i.f,{present:l||h,children:({present:n})=>(0,t.jsx)(s.V.div,{"data-state":h?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":f,hidden:!n,id:p,tabIndex:0,...u,ref:r,style:{...e.style,animationDuration:m.current?"0s":void 0},children:n&&c})})},"TabsContent"));function j(e,t){return`${e}-trigger-${t}`}function E(e,t){return`${e}-content-${t}`}f(j,"makeTriggerId"),f(E,"makeContentId");var C=e.i(975157);let R=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(k,{ref:r,className:(0,C.f)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...n}));R.displayName=k.displayName;let M=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(w,{ref:r,className:(0,C.f)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...n}));M.displayName=w.displayName;let S=n.forwardRef(({className:e,...n},r)=>(0,t.jsx)(x,{ref:r,className:(0,C.f)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n}));S.displayName=x.displayName,e.s(["i",0,b,"S",0,S,"U",0,R,"k",0,M],677572)},637691,e=>{e.s(["f",0,"https://github.com/margrop/wrong-notebook"])},901219,e=>{var t=e.i(271645),n=e.i(127175);e.s(["a",0,function(e,r){var o;let[a,i]=(0,t.useState)(null),[s,l]=(0,t.useState)(!1),c=(0,t.useRef)(e),u=(0,t.useRef)(r);(0,t.useEffect)(()=>{c.current=e,u.current=r},[e,r]);let d=(0,t.useCallback)(async()=>{let e=c.current;if(e&&("u"<typeof document||"hidden"!==document.visibilityState))try{let t=await (0,n.h)(e);c.current===e&&(i(t),l(!1),u.current?.(t))}catch(t){t?.status===404&&c.current===e&&l(!0)}},[]);(0,t.useEffect)(()=>{if(!e)return;let t=setTimeout(d,0),r=(0,n.E)(d);return()=>{clearTimeout(t),r()}},[e,d]);let f="analyzing"===(o=a?.status)||"saving"===o;return(0,t.useEffect)(()=>{if(!e||!f)return;let t=setInterval(d,2500);return()=>clearInterval(t)},[e,f,d]),{task:a&&a.id===e?a:null,notFound:s,refresh:d,setTask:i}},"b",0,function(e=!0){let[r,o]=(0,t.useState)(null),[a,i]=(0,t.useState)(!1),s=(0,t.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{o(await (0,n.B)()),i(!1)}catch{i(!0)}},[]);(0,t.useEffect)(()=>{if(!e)return;let t=setTimeout(s,0),r=(0,n.E)(s);return window.addEventListener(n.y,s),()=>{clearTimeout(t),r(),window.removeEventListener(n.y,s)}},[e,s]);let l=(r?.activeCount??0)>0;return(0,t.useEffect)(()=>{if(!e)return;let t=setInterval(s,l?2500:3e4);return()=>clearInterval(t)},[e,l,s]),{data:r,error:a,refresh:s}}])},145447,e=>{var t=e.i(271645);let n=()=>()=>{};e.s(["f",0,function(){return(0,t.useSyncExternalStore)(n,()=>!0,()=>!1)}])},132411,954846,e=>{let t,n,r,o,a,i,s,l,c;var u=e.i(271645),d=e.i(41931);let f=globalThis,p=f.__backgroundTaskStore??=(t=[],n=new Set,r=!1,o=null,a=null,i=(e=!0)=>o||(e&&"u">typeof document&&"hidden"===document.visibilityState?Promise.resolve():o=(async()=>{try{for(let e of(t=(await d.k.get("/api/tasks")).tasks,n))e(t);s()}catch{}finally{o=null}})()),s=()=>{a&&clearInterval(a),a=setInterval(()=>void i(),t.some(e=>"running"===e.status)?3e3:15e3)},l=()=>{!r&&(r=!0,i().then(s).catch(()=>void 0),"u">typeof document&&document.addEventListener("visibilitychange",c))},c=()=>{"visible"===document.visibilityState&&i().then(s).catch(()=>void 0)},{getSnapshot:()=>t,refresh:async()=>{l(),await i(!1),s()},subscribe:e=>(n.add(e),l(),()=>{n.delete(e)})});e.s(["f",0,p],954846),e.s(["f",0,function(e){let[t,n]=(0,u.useState)(()=>p.getSnapshot());return(0,u.useEffect)(()=>{if(e)return p.subscribe(n)},[e]),{running:e?t.find(t=>"running"===t.status&&t.target===e)??null:null,refresh:()=>p.refresh()}}],132411)},127175,e=>{var t=e.i(41931);let n="wrong-notebook:import-tasks-changed";function r(){window.dispatchEvent(new Event(n))}function o(){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}async function a(e,n=o()){let i;for(let o=0;o<3;o++)try{let{task:o}=await t.k.post("/api/import-tasks",{...e,clientRequestId:n,subjectId:e.subjectId||void 0,targetSubjectId:e.targetSubjectId||void 0,paperLevel:e.paperLevel||void 0},{timeout:12e4});return r(),o}catch(e){if(i=e,!function(e){let t=e?.status;return void 0===t||408===t||502===t||503===t||504===t}(e)||2===o)break;await new Promise(e=>setTimeout(e,1e3*(o+1)))}throw i}async function i(e,n={}){let r=n.image?"?include=image":"",{task:o}=await t.k.get(`/api/import-tasks/${encodeURIComponent(e)}${r}`);return o}async function s(e,n){let o=await t.k.post(`/api/import-tasks/${encodeURIComponent(e)}/confirm`,n);return r(),o}async function l(e){let{task:n}=await t.k.post(`/api/import-tasks/${encodeURIComponent(e)}/retry`,{});return r(),n}async function c(e){await t.k.post(`/api/import-tasks/${encodeURIComponent(e)}/read`,{}),r()}async function u(e){await t.k.delete(`/api/import-tasks/${encodeURIComponent(e)}`),r()}e.s(["y",0,n,"I",0,s,"S",0,a,"x",0,u,"h",0,i,"B",0,function(){return t.k.get("/api/import-tasks")},"N",0,c,"c",0,o,"P",0,r,"E",0,function(e){let t=()=>{"visible"===document.visibilityState&&e()},n=t=>{t.persisted&&e()};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",e),window.addEventListener("pageshow",n),window.addEventListener("online",e),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",e),window.removeEventListener("pageshow",n),window.removeEventListener("online",e)}},"R",0,l])},905110,e=>{let t=["new","reviewing","mastered"];e.s(["z",0,50,"o",0,100,"P",0,1,"m",0,function(e,t=50){return"number"==typeof e&&e>=t/100},"A",0,function(e){return"string"==typeof e&&t.includes(e)}])}])})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,518515,e=>{var t=e.i(456420);let r={name:"camera",size:24,node:[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],518515)},325597,7891,e=>{var t=e.i(456420);let r={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],7891),e.s(["f",0,a],325597)},747819,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(522016),i=e.i(548161),s=e.i(632781),n=e.i(395925),l=e.i(583967),o=e.i(519455),c=e.i(515288),u=e.i(111110),d=e.i(201276),p=e.i(127175);let m=e=>new Promise(t=>setTimeout(t,e));async function f(e,t){for(;;){if("hidden"!==document.visibilityState){let r=await (0,p.h)(e);if(t(r),"analyzing"!==r.status&&"saving"!==r.status)return r}await m(2500)}}async function g(e,t,r){let a=[...e],i=async()=>{for(;a.length>0;)await r(a.shift())};await Promise.all(Array.from({length:Math.min(t,a.length)},i))}function h({item:e}){let{t:r}=(0,u.b)(),a=r.batchImport.status[e.status];return"success"===e.status?(0,t.jsxs)("span",{className:"flex items-start gap-1 text-green-700 dark:text-green-300",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 shrink-0 mt-0.5"}),e.imported?.duplicate?r.importFlow.duplicate:a]}):"failed"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-destructive",children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),a]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:["pending"!==e.status&&(0,t.jsx)(s.f,{className:"h-4 w-4 animate-spin"}),a]})}e.s(["f",0,function({images:e,subjectId:i,onClose:s}){let{t:l,language:m}=(0,u.b)(),[x,y]=(0,r.useState)(()=>e.map(()=>({status:"pending"}))),b=(0,r.useRef)(!1),v=(0,r.useRef)([]),w=(0,r.useCallback)((e,t)=>{y(r=>r.map((r,a)=>a===e?{...r,...t}:r))},[]),j=(0,r.useCallback)((e,t)=>{let r=t?.data,a=r?.message||(t instanceof Error?t.message:String(t)),i=l.errors[a];w(e,{status:"failed",error:"string"==typeof i?i:a}),d.V.error("[BatchImport]","Question import failed",{index:e,error:a})},[l.errors,w]),k=(0,r.useCallback)(async t=>{w(t,{status:"uploading",error:void 0});try{let r=v.current[t];if(r)await (0,p.R)(r);else{let r=e[t],a=await (0,p.S)({imageBase64:r.dataUrl,language:m,subjectId:i,targetSubjectId:i,mode:"auto",clientTimings:r.timings,imageInfo:r.info});v.current[t]=a.id,w(t,{taskId:a.id})}return w(t,{status:"analyzing"}),!0}catch(e){return j(t,e),!1}},[e,m,i,w,j]),S=(0,r.useCallback)(async e=>{let t=v.current[e];if(t)try{let r=await f(t,t=>w(e,{status:"saving"===t.status?"saving":"analyzing"}));if("saved"!==r.status||!r.errorItemId)throw{data:{message:r.error||"QUESTION_SAVE_FAILED"}};(0,p.N)(t).catch(()=>void 0),w(e,{status:"success",imported:{id:r.errorItemId,shortId:r.errorItemShortId,subjectId:i??null,notebookName:r.notebookName,duplicate:r.duplicate}})}catch(t){j(e,t)}},[i,w,j]),N=(0,r.useCallback)(async e=>{let t=[];await g(e,2,async e=>{await k(e)&&t.push(e)}),await Promise.all(t.map(S))},[k,S]),I=(0,r.useCallback)(async e=>{await k(e)&&await S(e)},[k,S]);(0,r.useEffect)(()=>{b.current||(b.current=!0,N(e.map((e,t)=>t)))},[e,N]);let D=x.filter(e=>"success"===e.status).length,T=x.flatMap((e,t)=>"failed"===e.status?[t]:[]),A=x.some(e=>"pending"===e.status||"uploading"===e.status||"analyzing"===e.status||"saving"===e.status),E=x.some(e=>"pending"===e.status||"uploading"===e.status),C=x.filter(e=>e.taskId&&"uploading"!==e.status).length;return(0,t.jsxs)(c.N,{children:[(0,t.jsxs)(c.Y,{className:"flex flex-row items-center justify-between gap-2 space-y-0",children:[(0,t.jsx)(c.v,{className:"text-base",children:l.batchImport.title}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:l.batchImport.summary.replace("{done}",String(D)).replace("{total}",String(x.length)).replace("{failed}",String(T.length))})]}),(0,t.jsxs)(c.O,{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"batch-upload-progress",children:E?l.batchImport.uploaded.replace("{done}",String(C)).replace("{total}",String(x.length)):A?l.importTasks.uploadedHint:null}),(0,t.jsx)("ul",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:x.map((r,i)=>(0,t.jsxs)("li",{className:"flex gap-3 rounded-lg border p-3",children:[(0,t.jsx)("img",{src:e[i].dataUrl,alt:"",className:"h-20 w-20 shrink-0 rounded object-contain bg-muted"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1 text-sm",children:[(0,t.jsx)("div",{className:"font-medium",children:l.batchImport.question.replace("{index}",String(i+1))}),(0,t.jsx)(h,{item:r}),"success"===r.status&&r.imported&&(0,t.jsxs)(a.default,{href:`/error-items/${r.imported.id}`,className:"block truncate text-xs text-primary hover:underline",children:[r.imported.notebookName," · ",r.imported.shortId]}),"failed"===r.status&&(0,t.jsxs)(t.Fragment,{children:[r.error&&(0,t.jsx)("p",{className:"line-clamp-2 text-xs text-destructive",children:r.error}),(0,t.jsxs)(o.f,{size:"sm",variant:"outline",className:"h-7",onClick:()=>I(i),children:[(0,t.jsx)(n.f,{className:"mr-1 h-3 w-3"}),l.batchImport.retry]})]})]})]},i))}),(0,t.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end gap-2",children:[T.length>1&&!A&&(0,t.jsxs)(o.f,{variant:"outline",onClick:()=>N(T),children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),l.batchImport.retryFailed]}),(0,t.jsx)(o.f,{onClick:s,disabled:E,children:l.batchImport.finish})]})]})]})}])},310115,569644,651304,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(456420);let i={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};i.node;let s=(0,a.f)(i);e.s(["f",0,s],569644);var n=e.i(519455);function l(e){return[...e.extensions,...e.unlistedExtensions??[]]}let o=[{key:"text",extensions:[".txt",".md",".markdown"],mimeTypes:["text/plain","text/markdown"],maxBytes:2097152,category:"text"},{key:"docx",extensions:[".docx"],unlistedExtensions:[".doc"],mimeTypes:["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/msword"],maxBytes:0x3200000,category:"doc"},{key:"xlsx",extensions:[".xlsx"],mimeTypes:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],maxBytes:0x1400000,category:"sheet"},{key:"csv",extensions:[".csv"],mimeTypes:["text/csv"],maxBytes:0xa00000,category:"sheet"},{key:"json",extensions:[".json"],mimeTypes:["application/json"],maxBytes:0x3200000,category:"data"},{key:"pdf",extensions:[".pdf"],mimeTypes:["application/pdf"],maxBytes:0x3200000,category:"pdf"}];o.filter(e=>"text"===e.key);let c=o.filter(e=>"text"!==e.key),u=[239,187,191],d=[255,254],p=[254,255];function m(e,t,r=0){return!(e.length<t.length+r)&&t.every((t,a)=>e[r+a]===t)}function f(e){let t=e;return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t.includes("\0")&&(t=t.replace(/\0/g,"")),t.replace(/\r\n/g,"\n").replace(/\r/g,"\n")}e.s(["b",0,c,"u",0,o,"a",0,l,"n",0,function(e){let t=new Uint8Array(e);if(m(t,u))return{text:f(new TextDecoder("utf-8").decode(t.subarray(u.length))),encoding:"utf-8"};if(m(t,d))return{text:f(new TextDecoder("utf-16le").decode(t.subarray(d.length))),encoding:"utf-16le"};if(m(t,p))return{text:f(new TextDecoder("utf-16be").decode(t.subarray(p.length))),encoding:"utf-16be"};try{let e=new TextDecoder("utf-8",{fatal:!0}).decode(t);return{text:f(e),encoding:"utf-8"}}catch{return{text:f(new TextDecoder("gb18030").decode(t)),encoding:"gb18030"}}},"G",0,function(e,t){let r=e.toLowerCase(),a=t.toLowerCase().trim();for(let e of o)if(l(e).some(e=>r.endsWith(e)))return e;if(a){for(let e of o)if(e.mimeTypes.includes(a))return e}return null}],651304);var g=e.i(111110),h=e.i(294114);e.s(["f",0,function({types:e,onFile:a,disabled:i=!1,inputRef:o,className:c}){let{t:u}=(0,g.b)(),d=(0,r.useRef)(null),p=o??d,m=Array.from(new Set(e.flatMap(e=>[...l(e),...e.mimeTypes]))).join(",");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.f,{type:"button",variant:"outline",onClick:()=>p.current?.click(),disabled:i,className:c,children:[(0,t.jsx)(s,{className:"mr-2 h-4 w-4"}),u.importFile.button]}),(0,t.jsx)("input",{ref:p,type:"file",accept:m,className:"hidden",onChange:t=>{let r=t.target,i=r.files?.[0];if(r.value="",!i)return;let s=e.find(e=>l(e).some(e=>i.name.toLowerCase().endsWith(e))||i.type&&e.mimeTypes.includes(i.type.toLowerCase()));s?i.size>s.maxBytes?h.c.error(u.importFile.tooLarge.replace("{max}",String(Math.round(s.maxBytes/1024/1024)))):a(i,s):h.c.error(u.importFile.unsupportedType)},"data-testid":"import-file-input","aria-label":u.importFile.button})]})}],310115)},430634,576019,847483,e=>{var t=e.i(843476),r=e.i(522016),a=e.i(548161),i=e.i(263676),s=e.i(519455),n=e.i(111110);e.s(["f",0,function({imported:e,onDismiss:l}){let{t:o}=(0,n.b)(),c=(e.duplicate?o.importFlow.duplicate:o.importFlow.imported).replace("{notebook}",e.notebookName||"-").replace("{id}",e.shortId||"-");return(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 rounded-lg border border-green-300 dark:border-green-800 bg-green-50 dark:bg-green-950/40 p-3 text-sm text-green-800 dark:text-green-200",role:"status",children:[(0,t.jsxs)("span",{className:"flex items-start gap-2 flex-1",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 mt-0.5 shrink-0"}),c]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,t.jsx)(r.default,{href:`/error-items/${e.id}`,children:(0,t.jsx)(s.f,{size:"sm",variant:"outline",className:"bg-background",children:o.importFlow.viewItem})}),(0,t.jsx)(s.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:l,"aria-label":o.detail.close,children:(0,t.jsx)(i.X,{className:"h-4 w-4"})})]})]})}],430634);var l=e.i(731335),o=e.i(532377),c=e.i(339501);e.s(["f",0,function({task:e,onRefresh:a,onDismiss:u}){let{t:d}=(0,n.b)(),p=(0,o.f)(a),m=(0,c.f)("analyzing"===e.status||"saving"===e.status);return(0,t.jsxs)("div",{className:"space-y-2 rounded-xl border bg-card p-3",role:"status","data-testid":"pending-import-task",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("p",{className:"flex-1 text-sm text-muted-foreground",children:d.importTasks.uploadedHint}),(0,t.jsx)(s.f,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:u,"aria-label":d.common.close,children:(0,t.jsx)(i.X,{className:"h-4 w-4"})})]}),(0,t.jsx)(l.f,{task:e,now:m,onReview:()=>p.openReview(e),onViewItem:()=>p.viewItem(e),onRetry:()=>p.retry(e),onDiscard:async()=>{await p.discard(e)&&u()}}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[d.importTasks.stageEstimate," ·"," ",(0,t.jsx)(r.default,{href:"/import-tasks",className:"text-primary hover:underline",children:d.importTasks.viewTasks})]})]})}],576019);var u=e.i(13285),d=e.i(632781);e.s(["f",0,function({parts:e,busy:r,onFinish:a,onDiscard:l}){let{t:o}=(0,n.b)();return(0,t.jsxs)("section",{className:"space-y-3 rounded-2xl border border-primary/40 bg-primary/5 p-4","data-testid":"question-parts",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,t.jsx)(u.f,{className:"h-4 w-4 text-primary"}),o.upload.parts.title.replace("{count}",String(e.length))]}),(0,t.jsx)("ol",{className:"flex gap-2 overflow-x-auto pb-1",children:e.map((e,r)=>(0,t.jsxs)("li",{className:"shrink-0 text-center text-xs text-muted-foreground",children:[(0,t.jsx)("img",{src:e,alt:o.upload.parts.part.replace("{n}",String(r+1)),className:"h-20 max-w-[8rem] rounded border bg-white object-contain"}),o.upload.parts.part.replace("{n}",String(r+1))]},r))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.upload.parts.hint}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,t.jsxs)(s.f,{onClick:a,disabled:r,className:"sm:flex-1",children:[r?(0,t.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(u.f,{className:"mr-2 h-4 w-4"}),o.upload.parts.finish.replace("{count}",String(e.length))]}),(0,t.jsxs)(s.f,{variant:"ghost",onClick:l,disabled:r,children:[(0,t.jsx)(i.X,{className:"mr-1 h-4 w-4"}),o.upload.parts.discard]})]})]})}],847483)},717448,798469,956738,315092,610554,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(13285),i=e.i(632781),s=e.i(325597),n=e.i(328623),l=e.i(519455),o=e.i(515288),c=e.i(310115),u=e.i(110204),d=e.i(624687),p=e.i(111110),m=e.i(294114),f=e.i(651304),g=e.i(201276),h=e.i(303163),x=e.i(825624);e.s(["f",0,function({onSubmit:e,isAnalyzing:y,defaultNotebookName:b,onCreateBatch:v,creatingBatch:w=!1,onSwitchToFileImport:j}){let{t:k}=(0,p.b)(),[S,N]=(0,r.useState)(""),I=(0,r.useDeferredValue)(S),D=(0,r.useMemo)(()=>v&&I.trim()?(0,x.J)(I):null,[I,v]),T=D?.detected?D.candidateCount:0,A=D?.ambiguous?D.candidateCount:0,E=S.length>x.i,C=y||w,F=S.trim(),P=async()=>{F&&await e(F)},R=async(e,t=!1)=>{F&&v&&("ai"===e&&E||await v(S,e,t))},z=async e=>{let t,r=(0,f.G)(e.name,e.type);if(r&&"text"!==r.key)return void(j?await (0,m.u)(k.importFile.bankFileHint,{confirmText:k.importFile.bankFileSwitch,cancelText:k.importFile.bankFileStay})&&j():m.c.info(k.importFile.bankFileHint));try{let r=await e.arrayBuffer();t=(0,f.n)(r).text}catch(e){g.V.error("text-input-zone","Failed to read import file",{error:(0,h.Z)(e)}),m.c.error(k.importFile.readFailed);return}S.trim()?N(await (0,m.u)(k.app.importFileReplaceConfirm,{confirmText:k.app.importFileReplace,cancelText:k.app.importFileAppend})?t:S+"\n"+t):N(t)},M=e=>v&&F?(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)(l.f,{variant:"link",size:"sm",onClick:()=>R("ai"),disabled:C||E,className:"h-auto whitespace-normal",children:[w?(0,t.jsx)(i.f,{className:"mr-1 h-3 w-3 animate-spin"}):(0,t.jsx)(a.f,{className:"mr-1 h-3 w-3"}),w?k.app.creatingBatch:e]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:k.app.aiSplitHint})]}):null;return(0,t.jsx)(o.N,{className:"rounded-2xl",children:(0,t.jsxs)(o.O,{className:"space-y-4 p-6",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(s.f,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:k.app?.textInputHint||"Enter question text"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)(u.f,{htmlFor:"question-text",children:k.editor?.question||"Question Text"}),(0,t.jsx)(c.f,{types:f.u,onFile:z,disabled:C})]}),(0,t.jsx)(d.f,{id:"question-text",value:S,onChange:e=>N(e.target.value),onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),F&&!C&&(T>1&&!E?R("local"):P()))},placeholder:k.app?.textInputPlaceholder||"Paste or type question text here...",className:"min-h-[200px] resize-y font-mono text-sm",disabled:C})]}),b&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[k.notebooks?.title||"My Notebooks",": ",b]}),v&&E&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:k.app.textTooLong}),T>1?(0,t.jsxs)("div",{className:"space-y-2","data-testid":"multi-detected",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[(0,t.jsx)(a.f,{className:"h-4 w-4"}),k.app.multiDetected.replace("{count}",String(T))]}),(D?.overflow??0)>0&&(0,t.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:k.app.overflowHint.replace("{count}",String(D?.overflow))}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,t.jsxs)(l.f,{onClick:()=>R("local"),disabled:C,size:"lg",className:"flex-1 bg-gradient-to-r from-indigo-600 to-violet-500 font-medium text-white hover:from-indigo-700 hover:to-violet-600",children:[w?(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),w?k.app.creatingBatch:k.app.splitPreview.replace("{count}",String(Math.min(T,60)))]}),(0,t.jsxs)(l.f,{onClick:P,disabled:C,size:"lg",variant:"outline",children:[y?(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),y?k.editor?.reanswering||"AI solving...":k.app.solveAsOne]})]}),M(k.app.aiSplitMulti)]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.f,{onClick:P,disabled:!F||C,className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 font-medium text-white hover:from-indigo-700 hover:to-violet-600",size:"lg",children:y?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}),k.editor?.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),k.app?.aiSolve||"AI Solve"]})}),A>1&&(0,t.jsxs)("div",{className:"space-y-1 rounded-lg bg-muted/60 p-3 text-center","data-testid":"sub-questions-hint",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:k.app.subQuestionsHint.replace("{count}",String(A))}),(0,t.jsxs)(l.f,{variant:"outline",size:"sm",onClick:()=>R("local",!0),disabled:C||E,children:[(0,t.jsx)(a.f,{className:"mr-1 h-3 w-3"}),k.app.splitAnyway.replace("{count}",String(A))]})]}),M(k.app.aiSplit)]}),(0,t.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:k.app?.textInputTip||"After entering the question, AI will automatically solve and generate analysis"})]})})}],717448);let y=new Map([["avif","image/avif"],["bmp","image/bmp"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["gif","image/gif"],["gz","application/gzip"],["htm","text/html"],["html","text/html"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","application/javascript"],["json","application/json"],["md","text/markdown"],["mjs","application/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["ogg","audio/ogg"],["pdf","application/pdf"],["png","image/png"],["ppt","application/powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["svg","image/svg+xml"],["tif","image/tiff"],["tiff","image/tiff"],["txt","text/plain"],["wasm","application/wasm"],["wav","audio/x-wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["zip","application/zip"]]);var b=class extends Error{constructor(e){super("DataTransferItem is not a file"),this.item=e,this.name="UnexpectedObjectError"}};function v(e,t,r){let{webkitRelativePath:a}=e,i="string"==typeof t?t:"string"==typeof a&&a.length>0?a:`./${e.name}`;return"string"!=typeof e.path&&w(e,"path",i),void 0!==r&&Object.defineProperty(e,"handle",{value:r,writable:!1,configurable:!1,enumerable:!0}),w(e,"relativePath",i),e}function w(e,t,r){Object.defineProperty(e,t,{value:r,writable:!1,configurable:!1,enumerable:!0})}let j=[".DS_Store","Thumbs.db"];async function k(e,{mimeTypes:t=y}={}){return(await S(e)).map(e=>"path"in e?function(e,t=y){let{name:r}=e;if(r&&-1!==r.lastIndexOf(".")&&!e.type){let a=r.split(".").pop().toLowerCase(),i=t.get(a);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}(e,t):e)}async function S(e){var t,r,a;if(N(e)&&N(e.dataTransfer))return D(e.dataTransfer,e.type);if(N(t=e)&&N(t.clipboardData)){let t;return T(((t=A((r=e.clipboardData).items).filter(e=>"file"===e.kind).map(e=>e.getAsFile()).filter(e=>null!==e)).length>0?t:A(r.files)).map(e=>v(e)))}if(N(a=e)&&N(a.target))return A(e.target.files).map(e=>v(e));return Array.isArray(e)&&e.every(e=>"getFile"in e&&"function"==typeof e.getFile)?I(e):[]}function N(e){return"object"==typeof e&&null!==e}async function I(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>v(e))}async function D(e,t){let r=A(e.items).filter(e=>"file"===e.kind);return"drop"!==t?r:T(function e(t){let r=[];for(let a of t)Array.isArray(a)?r.push(...e(a)):r.push(a);return r}(await Promise.all(r.map(E))))}function T(e){return e.filter(e=>-1===j.indexOf(e.name))}function A(e){return null===e?[]:Array.from(e)}async function E(e){if("function"!=typeof e.webkitGetAsEntry)return C(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let r=await F(e);return r?.kind==="directory"?P(r,`/${r.name}`):z(t)}return C(e,t)}async function C(e,t){let r=e.getAsFile(),a=await F(e);if(null!=a){let e=r??await a.getFile();return e.handle=a,v(e)}if(!r)throw new b(e);return v(r,t?.fullPath??void 0)}async function F(e){if(globalThis.isSecureContext&&"function"==typeof e.getAsFileSystemHandle)return e.getAsFileSystemHandle()}async function P(e,t){let r=[];for await(let a of e.values()){let e=`${t}/${a.name}`;if("directory"===a.kind)r.push(...await P(a,e));else{let t=await a.getFile();r.push(v(t,e,a))}}return r}async function R(e){return e.isDirectory?z(e):M(e)}function z(e){let t=e.createReader();return new Promise((e,r)=>{let a=[];!function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(R));a.push(e),i()}else try{e(await Promise.all(a))}catch(e){r(e)}},e=>{r(e)})}()})}async function M(e){return new Promise((t,r)=>{e.file(r=>{t(v(r,e.fullPath))},e=>{r(e)})})}let O=function(e,t){if(e&&t){let r=(Array.isArray(t)?t:t.split(",")).filter(e=>""!==e.trim());if(0===r.length)return!0;let a=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return r.some(e=>{let t=e.trim().toLowerCase();return"."===t.charAt(0)?a.toLowerCase().endsWith(t):t.endsWith("/*")?s===t.replace(/\/.*$/,""):i===t})}return!0},B=["KB","MB","GB","TB","PB"];function L(e){if(e<1024)return`${e} ${1===e?"byte":"bytes"}`;let t=e/1024,r=0;for(;t>=1024&&r<B.length-1;)t/=1024,r++;return`${Number(t.toFixed(2))} ${B[r]}`}function U(e){return{code:"file-too-large",message:`File is larger than ${L(e)}`}}function V(e){return{code:"file-too-small",message:`File is smaller than ${L(e)}`}}let $={code:"too-many-files",message:"Too many files"};function _(e,t){let r="application/x-moz-file"===e.type||O(e,t??"")||""===e.type&&"function"==typeof e.getAsFile;return[r,r?null:function(e=""){let t=e.split(","),r=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:"file-invalid-type",message:`File type must be ${r}`}}(t)]}function q(e,t,r){if(H(e.size)){if(H(t)&&H(r)){if(e.size>r)return[!1,U(r)];if(e.size<t)return[!1,V(t)]}else if(H(t)&&e.size<t)return[!1,V(t)];else if(H(r)&&e.size>r)return[!1,U(r)]}return[!0,null]}function H(e){return null!=e}function G(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function W(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>"Files"===e||"application/x-moz-file"===e)||Array.prototype.some.call(t.items??[],Z):!!e.target&&!!e.target.files}function Z(e){return"object"==typeof e&&null!==e&&"file"===e.kind}function X(e){e.preventDefault()}function K(...e){return(t,...r)=>e.some(e=>(!G(t)&&e&&e(t,...r),G(t)))}function Q(e){return Array.isArray(e)?e:"string"==typeof e?[e]:[]}function Y(e){if(H(e))return Array.isArray(e)?e.filter(e=>H(e)&&H(e.accept)):[{accept:e}]}function J(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(H(e))return Object.entries(e).reduce((e,[r,a])=>{let i=Q(a);return t&&r.endsWith("/*")&&i.some(et)?e.push(...i):e.push(r,...i),e},[]).filter(e=>ee(e)||et(e)).join(",")}function ee(e){return"audio/*"===e||"video/*"===e||"image/*"===e||"text/*"===e||"application/*"===e||/\w+\/[-+.\w]+/g.test(e)}function et(e){return/^.*\.[\w]+$/.test(e)}(0,r.forwardRef)(({children:e,...a},i)=>{let{open:s,...n}=ea(a);return(0,r.useImperativeHandle)(i,()=>({open:s}),[s]),(0,t.jsx)(t.Fragment,{children:e?.({...n,open:s})})}).displayName="Dropzone";let er={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function ea(e={}){let{accept:t,disabled:a=!1,getFilesFromEvent:i=k,maxSize:s=1/0,minSize:n=0,multiple:l=!0,maxFiles:o=0,onDragEnter:c,onDragLeave:u,onDragOver:d,onDrop:p,onDropAccepted:m,onDropRejected:f,onFileDialogCancel:g,onFileDialogOpen:h,useFsAccessApi:x=!1,autoFocus:y=!1,preventDropOnDocument:b=!0,noClick:v=!1,noKeyboard:w=!1,noDrag:j=!1,noDragEventsBubbling:S=!1,noPaste:N=!1,onError:I,validator:D,getErrorMessage:T}=e,A=(0,r.useMemo)(()=>(function(e){let t=Y(e);if(!H(t))return;let r={};for(let e of t)for(let[t,a]of Object.entries(e.accept)){let e=r[t]??(r[t]=[]);for(let t of Q(a))e.includes(t)||e.push(t)}return r})(t),[t]),E=(0,r.useMemo)(()=>J(A),[A]),C=(0,r.useMemo)(()=>J(A,{omitWildcardMimeTypesWithExtensions:!0}),[A]),F=(0,r.useMemo)(()=>(function(e){let t=Y(e);if(!H(t))return;let r=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let r=!0;return ee(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),r=!1),(Array.isArray(t)||"string"==typeof t)&&Q(t).every(et)||(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),r=!1),r}).reduce((e,[t,r])=>(e[t]=Q(r),e),{});return{description:H(e.description)&&""!==e.description?e.description:function(e){let t=[],r=Object.keys(e);for(let r of Object.values(e))for(let e of Q(r))t.includes(e)||t.push(e);return t.length>0?t.join(", "):r.length>0?r.join(", "):"Files"}(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return r.length>0?r:void 0})(t),[t]),P=(0,r.useMemo)(()=>"function"==typeof h?h:es,[h]),R=(0,r.useMemo)(()=>"function"==typeof g?g:es,[g]),z=(0,r.useRef)(null),M=(0,r.useRef)(null),[O,B]=(0,r.useReducer)(ei,er),{isFocused:L,isFileDialogActive:U}=O,V=(0,r.useRef)(U);V.current=U;let Z=(0,r.useRef)(null),en=(0,r.useCallback)(()=>{Z.current?.abort();let e=new AbortController;return Z.current=e,B({type:"setProcessing",isProcessing:!0}),e.signal},[]),el=(0,r.useCallback)(e=>{e.aborted||B({type:"setProcessing",isProcessing:!1})},[]);(0,r.useEffect)(()=>()=>Z.current?.abort(),[]);let eo=(0,r.useRef)("u">typeof window&&window.isSecureContext&&x&&"showOpenFilePicker"in window),ec=()=>{!eo.current&&U&&setTimeout(()=>{if(M.current){let{files:e}=M.current;e?.length||(B({type:"closeDialog"}),R())}},300)};(0,r.useEffect)(()=>(window.addEventListener("focus",ec,!1),()=>{window.removeEventListener("focus",ec,!1)}),[M,U,R,eo]);let eu=(0,r.useRef)([]),ed=(0,r.useRef)([]),ep=e=>{z.current&&e.target&&z.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),eu.current=[])};(0,r.useEffect)(()=>(b&&(document.addEventListener("dragover",X,!1),document.addEventListener("drop",ep,!1)),()=>{b&&(document.removeEventListener("dragover",X),document.removeEventListener("drop",ep))}),[z,b]),(0,r.useEffect)(()=>{let e=e=>{e.target&&(ed.current=[...ed.current,e.target]),W(e)&&B({isDragGlobal:!0,type:"setDragGlobal"})},t=e=>{ed.current=ed.current.filter(t=>t!==e.target&&null!==t),ed.current.length>0||B({isDragGlobal:!1,type:"setDragGlobal"})},r=()=>{ed.current=[],B({isDragGlobal:!1,type:"setDragGlobal"})},a=()=>{ed.current=[],B({isDragGlobal:!1,type:"setDragGlobal"})};return document.addEventListener("dragenter",e,!1),document.addEventListener("dragleave",t,!1),document.addEventListener("dragend",r,!1),document.addEventListener("drop",a,!1),()=>{document.removeEventListener("dragenter",e),document.removeEventListener("dragleave",t),document.removeEventListener("dragend",r),document.removeEventListener("drop",a)}},[z]),(0,r.useEffect)(()=>(!a&&y&&z.current&&z.current.focus(),()=>{}),[z,y,a]);let em=(0,r.useCallback)(e=>{I?I(e):console.error(e)},[I]),ef=(0,r.useCallback)(e=>{e.preventDefault(),e.persist?.(),eT(e),!V.current&&(eu.current=[...eu.current,e.target],W(e)&&Promise.resolve(i(e)).then(t=>{if(G(e)&&!S)return;let r=t.length>0?function({files:e,accept:t,minSize:r,maxSize:a,multiple:i,maxFiles:s=0,validator:n,getErrorMessage:l}){let o=[],c=[],u=(e,t)=>l&&"u">typeof File&&t instanceof File?{...e,message:l(e,t)}:e;e.forEach(e=>{let[i,s]=_(e,t),[n,l]=q(e,r,a);i&&n?o.push(e):c.push({file:e,errors:[s,l].filter(e=>null!=e).map(t=>u(t,e))})});let d=i?s>=1?s:1/0:1;return(o.length>d&&o.slice(d).forEach(e=>{c.push({file:e,errors:[u($,e)]})}),c.length>0)?{verdict:"reject",rejections:c}:{verdict:n?"unknown":"accept",rejections:c}}({files:t,accept:E,minSize:n,maxSize:s,multiple:l,maxFiles:o,validator:D,getErrorMessage:T}):null;B({isDragAccept:r?.verdict==="accept",isDragReject:r?.verdict==="reject",isDragUnknown:r?.verdict==="unknown",isDragActive:!0,dragFileRejections:r?.rejections??[],type:"setDraggedFiles"}),c&&c(e)}).catch(e=>em(e)))},[i,c,em,S,E,n,s,l,o,D,T]),eg=(0,r.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),eT(e),V.current)return!1;let t=W(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch{}return t&&d&&d(e),!1},[d,S]),eh=(0,r.useCallback)(e=>{e.preventDefault(),e.persist?.(),eT(e);let t=eu.current.filter(e=>z.current?.contains(e)),r=t.indexOf(e.target);-1!==r&&t.splice(r,1),eu.current=t,!(t.length>0)&&(B({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),W(e)&&u&&u(e))},[z,u,S]),ex=(0,r.useCallback)(async(e,t,r)=>{let a,i=(e,t)=>T?{...e,message:T(e,t)}:e,c=e=>{let r=[],a=[];e.forEach(({file:e,accepted:t,acceptError:s,sizeMatch:n,sizeError:l,customErrors:o})=>{let c=!o||Array.isArray(o)&&0===o.length;if(t&&n&&c)r.push(e);else{let t=[s,l];o&&(t=t.concat(o)),a.push({file:e,errors:t.filter(e=>null!=e).map(t=>i(t,e))})}});let s=l?o>=1?o:1/0:1;r.length>s&&r.splice(s).forEach(e=>{a.push({file:e,errors:[i($,e)]})}),B({acceptedFiles:r,fileRejections:a,type:"setFiles"}),p&&p(r,a,t),a.length>0&&f&&f(a,t),r.length>0&&m&&m(r,t)},u=e.map(e=>{let[t,r]=_(e,C),[a,i]=q(e,n,s);return{file:e,accepted:t,acceptError:r,sizeMatch:a,sizeError:i,customErrors:D?D(e):null}});if(!u.some(({customErrors:e})=>null!=e&&"function"==typeof e.then))return void c(u);try{a=await Promise.all(u.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){r.aborted||(el(r),em(e));return}r.aborted||c(a)},[B,l,C,n,s,o,p,m,f,D,T,em,el]),ey=(0,r.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),eT(e),eu.current=[],(!V.current||!e.dataTransfer)&&(B({type:"reset"}),W(e))){let t=en();Promise.resolve(i(e)).then(r=>{if(!t.aborted)return G(e)&&!S?void el(t):ex(r,e,t)}).catch(e=>{t.aborted||(el(t),em(e))})}},[i,ex,em,S,en,el]),eb=(0,r.useCallback)(e=>{if(!W(e))return;e.preventDefault(),e.persist?.(),eT(e);let t=en();Promise.resolve(i(e)).then(r=>{if(!t.aborted)return G(e)&&!S?void el(t):ex(r,e,t)}).catch(e=>{t.aborted||(el(t),em(e))})},[i,ex,em,S,en,el]),ev=(0,r.useCallback)(()=>{if(eo.current){let e;B({type:"openDialog"}),P(),window.showOpenFilePicker({multiple:l,types:F}).then(t=>(e=en(),i(t))).then(t=>{if(B({type:"closeDialog"}),!e.aborted)return ex(t,null,e)}).catch(t=>{(e&&el(e),t instanceof DOMException&&("AbortError"===t.name||t.code===t.ABORT_ERR))?(R(t),B({type:"closeDialog"})):t instanceof DOMException&&("SecurityError"===t.name||t.code===t.SECURITY_ERR)||t instanceof DOMException&&"NotAllowedError"===t.name?(eo.current=!1,M.current?(M.current.value="",M.current.click()):em(Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):em(t)});return}M.current&&(B({type:"openDialog"}),P(),M.current.value="",M.current.click())},[B,P,R,x,ex,em,F,l,en,el]),ew=(0,r.useCallback)(e=>{z.current?.isEqualNode(e.target)&&(" "===e.key||"Enter"===e.key||32===e.keyCode||13===e.keyCode)&&(e.preventDefault(),ev())},[z,ev]),ej=(0,r.useCallback)(()=>{B({type:"focus"})},[]),ek=(0,r.useCallback)(()=>{B({type:"blur"})},[]),eS=(0,r.useCallback)(()=>{v||(function(e=window.navigator.userAgent){return -1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")||-1!==e.indexOf("Edge/")}()?setTimeout(ev,0):ev())},[v,ev]),eN=e=>a?null:e,eI=e=>w?null:eN(e),eD=e=>j?null:eN(e),eT=e=>{S&&e.stopPropagation()},eA=(0,r.useMemo)(()=>({refKey:e="ref",role:t,onKeyDown:r,onFocus:i,onBlur:s,onClick:n,onDragEnter:l,onDragOver:o,onDragLeave:c,onDrop:u,onPaste:d,...p}={})=>{let m;return{onKeyDown:eI(K(r,ew)),onFocus:eI(K(i,ej)),onBlur:eI(K(s,ek)),onClick:eN(K(n,eS)),onDragEnter:eD(K(l,ef)),onDragOver:eD(K(o,eg)),onDragLeave:eD(K(c,eh)),onDrop:eD(K(u,ey)),onPaste:(m=K(d,eb),N?null:eN(m)),role:"string"==typeof t&&""!==t?t:"presentation",[e]:z,...!a&&!w?{tabIndex:0}:{},...a?{"aria-disabled":!0}:{},...p}},[z,ew,ej,ek,eS,ef,eg,eh,ey,eb,w,j,N,a]),eE=(0,r.useCallback)(e=>{e.stopPropagation()},[]),eC=(0,r.useMemo)(()=>({refKey:e="ref",onChange:t,onClick:r,...a}={})=>({accept:C,multiple:l,type:"file","aria-label":"file upload",style:{border:0,display:"block",height:0,margin:0,maxWidth:0,opacity:0,overflow:"hidden",padding:0,width:0},onChange:eN(K(t,ey)),onClick:eN(K(r,eE)),tabIndex:-1,[e]:M,...a}),[M,t,l,ey,a]);return{...O,isFocused:L&&!a,getRootProps:eA,getInputProps:eC,rootRef:z,inputRef:M,open:eN(ev)}}function ei(e,t){switch(t.type){case"focus":return{...e,isFocused:!0};case"blur":return{...e,isFocused:!1};case"openDialog":return{...er,isFileDialogActive:!0};case"closeDialog":return{...e,isFileDialogActive:!1};case"setDraggedFiles":return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case"setProcessing":return{...e,isProcessing:t.isProcessing};case"setFiles":return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case"setDragGlobal":return{...e,isDragGlobal:t.isDragGlobal};case"reset":return{...er};default:return e}}function es(){}var en=e.i(81968),el=e.i(145447);let eo={"image/*":[".jpg",".jpeg",".png",".webp",".gif",".bmp",".heic",".heif"]};function ec(e){return e&&"u">typeof navigator&&"mediaDevices"in navigator&&"getDisplayMedia"in navigator.mediaDevices}var eu=e.i(456420);let ed={name:"cloud-upload",size:24,node:[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],aliases:["upload-cloud"]};ed.node;let ep=(0,eu.f)(ed);function em({getRootProps:e,getInputProps:r,isDragActive:a,isAnalyzing:s}){let{t:n}=(0,p.b)();return(0,t.jsx)(o.N,{...e(),className:`group cursor-pointer rounded-2xl border-2 border-dashed shadow-none transition-all hover:border-primary/60 hover:bg-accent/40 ${a?"border-primary bg-accent/60":"border-border bg-card"}`,children:(0,t.jsxs)(o.O,{className:"flex min-h-[260px] flex-col items-center justify-center space-y-4 py-10 text-center md:min-h-[300px]",children:[(0,t.jsx)("input",{...r()}),(0,t.jsx)("div",{className:"rounded-2xl bg-accent p-4 text-primary transition-transform group-hover:scale-105",children:s?(0,t.jsx)(i.f,{className:"h-10 w-10 animate-spin"}):(0,t.jsx)(ep,{className:"h-10 w-10"})}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s?n.app.analyzing:n.upload.analyze}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s?n.app.analyzing:n.app.dragDrop}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:n.upload.support})]})]})})}var ef=e.i(518515),eg=e.i(569644);let eh={name:"images",size:24,node:[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]};eh.node;let ex=(0,eu.f)(eh);function ey({openSource:e,isAnalyzing:r}){let{t:a}=(0,p.b)(),i=[{key:"camera",icon:ef.f,label:a.upload.camera,desc:a.upload.cameraDesc},{key:"album",icon:ex,label:a.upload.album,desc:a.upload.albumDesc},{key:"file",icon:eg.f,label:a.upload.file,desc:a.upload.fileDesc}];return(0,t.jsx)("div",{className:"hidden grid-cols-3 gap-2 pointer-coarse:grid","data-testid":"image-sources",children:i.map(a=>(0,t.jsxs)(l.f,{type:"button",variant:"outline",onClick:()=>e(a.key),disabled:r,className:"flex h-auto flex-col gap-1 py-3","aria-description":a.desc,children:[(0,t.jsx)(a.icon,{className:"h-6 w-6"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a.label})]},a.key))})}function eb({cameraInput:e,albumInput:r,fileInput:a,handlePicked:i}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:e,type:"file",accept:"image/*",capture:"environment",className:"hidden",onChange:i,"data-testid":"camera-input"}),(0,t.jsx)("input",{ref:r,type:"file",accept:"image/*",className:"hidden",onChange:i,"data-testid":"album-input"}),(0,t.jsx)("input",{ref:a,type:"file",className:"hidden",onChange:i,"data-testid":"file-input"})]})}let ev={name:"clipboard-paste",size:24,node:[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]};ev.node;let ew=(0,eu.f)(ev);var ej=e.i(446513);function ek({onPaste:e,isAnalyzing:r}){let{t:a}=(0,p.b)();return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsxs)(l.f,{variant:"outline",onClick:e,disabled:r,className:"flex items-center gap-2 w-full sm:w-auto",children:[(0,t.jsx)(ew,{className:"h-4 w-4"}),a.upload.paste]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:a.upload.pasteDesc})]})}function eS({onScreenshot:e,isAnalyzing:r,isScreenshotting:a}){let{t:s}=(0,p.b)();return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsxs)(l.f,{variant:"outline",onClick:e,disabled:r||a,className:"flex items-center gap-2 w-full sm:w-auto",children:[a?(0,t.jsx)(i.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(ej.f,{className:"h-4 w-4"}),a?s.common.pleaseWait:s.upload.screenshot]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:s.upload.screenshotDesc})]})}e.s(["f",0,function({onImageSelect:e,isAnalyzing:a}){let i=function({onImageSelect:e,isAnalyzing:t}){let{t:a}=(0,p.b)(),[i,s]=(0,r.useState)(!1),n=(0,el.f)();(0,r.useEffect)(()=>{"Notification"in window&&"default"===Notification.permission&&Notification.requestPermission()},[]);let{getRootProps:l,getInputProps:o,isDragActive:c}=ea({onDrop:(0,r.useCallback)(t=>{let r=t[0];r&&e(r)},[e]),accept:eo,maxFiles:1,disabled:t}),u=function(){let[e,t]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if((0,en.f)()||"u"<typeof navigator||!navigator.mediaDevices?.enumerateDevices)return;let e=!1;return navigator.mediaDevices.enumerateDevices().then(r=>{e||t(r.some(e=>"videoinput"===e.kind))}).catch(()=>void 0),()=>{e=!0}},[]),e}(),d=(0,r.useRef)(null),f=(0,r.useRef)(null),h=(0,r.useRef)(null),x=(0,r.useCallback)(t=>{let r,a;e((a=(r=t.type||"image/png").split("/")[1]||"png",t instanceof File&&t.name?t:new File([t],`clipboard-${Date.now()}.${a}`,{type:r})))},[e]);(0,r.useEffect)(()=>{let e=e=>{if(t)return;let r=function(e){let t=e.target;if(t&&(t.isContentEditable||["INPUT","TEXTAREA"].includes(t.tagName)))return null;let r=Array.from(e.clipboardData?.items??[]).find(e=>"file"===e.kind&&e.type.startsWith("image/"));return r?.getAsFile()??null}(e);r&&(e.preventDefault(),x(r))};return window.addEventListener("paste",e),()=>window.removeEventListener("paste",e)},[t,x]);let y=async()=>{if(!(n&&"u">typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.read))return void m.c.warning(a.upload.pasteNotSupported);try{for(let e of(await navigator.clipboard.read())){let t=e.types.find(e=>e.startsWith("image/"));if(t){let r=await e.getType(t);x(r);return}}m.c.warning(a.upload.pasteNoImage)}catch(e){g.V.warn("[UploadZone]","Clipboard read failed",{error:e instanceof Error?e.message:String(e)}),e instanceof Error&&"NotAllowedError"===e.name?m.c.warning(a.upload.pastePermissionDenied):m.c.error(a.upload.pasteFailed)}},b=async()=>{if(!ec(n))return void m.c.warning(a.upload.screenshotNotSupported);s(!0);try{let t;"CaptureController"in window&&(t=new window.CaptureController);let r={video:!0,audio:!1,preferCurrentTab:!1};t&&(r.controller=t);let a=await navigator.mediaDevices.getDisplayMedia(r),[i]=a.getVideoTracks(),s=i.getSettings().displaySurface;if(t&&("browser"===s||"window"===s))try{t.setFocusBehavior("no-focus-change"),g.V.info("[UploadZone]","Screenshot focus behavior set to no-change",void 0,{sendToBackend:!1})}catch(e){g.V.warn("[UploadZone]","Unable to set screenshot focus behavior",{error:e})}let n=document.createElement("video");if(n.srcObject=a,n.muted=!0,n.autoplay=!0,n.playsInline=!0,await new Promise((e,t)=>{n.onloadedmetadata=()=>{n.play().then(()=>{e()}).catch(t)},n.onerror=t}),await new Promise(e=>setTimeout(e,500)),0===n.videoWidth||0===n.videoHeight)throw Error("视频没有有效尺寸");let l=document.createElement("canvas");l.width=n.videoWidth,l.height=n.videoHeight;let o=l.getContext("2d");if(!o)throw Error("无法获取canvas上下文");o.drawImage(n,0,0),a.getTracks().forEach(e=>e.stop()),l.toBlob(t=>{t?(e(new File([t],`screenshot-${Date.now()}.png`,{type:"image/png"})),g.V.info("[UploadZone]","Screenshot captured",void 0,{sendToBackend:!1})):m.c.error("截图转换失败")},"image/png",1)}catch(e){g.V.error("[UploadZone]","Screenshot failed",{error:e}),e instanceof Error&&("NotAllowedError"===e.name?m.c.warning(a.upload.screenshotPermissionDenied):m.c.error(`${a.upload.screenshotFailed}: ${e.message}`))}finally{s(!1)}};return{t:a,isClient:n,isAnalyzing:t,isDragActive:c,isScreenshotting:i,hasCamera:u,getRootProps:l,getInputProps:o,cameraInput:d,albumInput:f,fileInput:h,handlePicked:t=>{let r=t.target.files?.[0];t.target.value="",r&&e(r)},openSource:e=>{"camera"===e&&!1===u?m.c.warning(a.upload.noCamera):({camera:d,album:f,file:h})[e].current?.click()},handleClipboardRead:y,handleScreenshot:b}}({onImageSelect:e,isAnalyzing:a});return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(eb,{cameraInput:i.cameraInput,albumInput:i.albumInput,fileInput:i.fileInput,handlePicked:i.handlePicked}),i.isClient&&(0,t.jsx)(ey,{openSource:i.openSource,isAnalyzing:i.isAnalyzing}),(0,t.jsx)(em,{getRootProps:i.getRootProps,getInputProps:i.getInputProps,isDragActive:i.isDragActive,isAnalyzing:i.isAnalyzing}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:flex-wrap items-stretch sm:items-start justify-center gap-4",children:[i.isClient&&(0,t.jsx)(ek,{onPaste:()=>{i.handleClipboardRead()},isAnalyzing:i.isAnalyzing}),i.isClient&&ec(i.isClient)&&(0,t.jsx)(eS,{onScreenshot:()=>{i.handleScreenshot()},isAnalyzing:i.isAnalyzing,isScreenshotting:i.isScreenshotting})]})]})}],798469);var eN=e.i(168148),eI=e.i(975157);let eD={reading:3,converting:6,compressing:10,uploading:20,analyzing:50,processing:85,saving:95};function eT({status:e,message:a,className:s,completed:n}){let l,{t:o}=(0,p.b)(),[c]=(0,r.useState)(()=>Date.now()),[u,d]=(0,r.useState)(0);(0,r.useEffect)(()=>{let e=setInterval(()=>{d(Math.max(0,Math.floor((Date.now()-c)/1e3)))},1e3);return()=>clearInterval(e)},[c]);let m=eD[e],f=o.common.progress.estimated.replace("{percent}",String(m));return(0,t.jsx)("div",{className:(0,eI.f)("fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",s),children:(0,t.jsx)("div",{className:"w-full max-w-md p-6 space-y-6 bg-card rounded-lg border shadow-lg mx-4",children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-4 text-center",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.f,{className:"h-12 w-12 animate-spin text-primary"}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center"})]}),(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold tracking-tight","aria-live":"polite",children:a||o.common.progress[e]}),(0,t.jsx)(eN.f,{value:m,"aria-label":f,"aria-valuetext":f,className:"h-2 w-full"})]}),(0,t.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 text-sm text-muted-foreground tabular-nums",children:[(0,t.jsx)("span",{children:f}),(0,t.jsx)("span",{role:"timer","aria-live":"off",children:o.common.progress.elapsed.replace("{time}",(l=[Math.floor(u/60)%60,u%60],u>=3600&&l.unshift(Math.floor(u/3600)),l.map(e=>String(e).padStart(2,"0")).join(":")))})]}),n&&n.length>0&&(0,t.jsx)("ul",{className:"flex w-full flex-wrap justify-center gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","data-testid":"progress-stages",children:n.map(e=>{var r;return(0,t.jsxs)("li",{children:[e.label," ",(r=e.ms)<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(1)}s`]},e.label)})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.common.progress.estimateHint})]})})})}e.s(["f",0,function({status:e,message:r,className:a,completed:i}){return(0,el.f)()&&"idle"!==e?(0,t.jsx)(eT,{status:e,message:r,className:a,completed:i}):null}],956738);var eA=e.i(618566),eE=e.i(767077),eC=e.i(119472),eF=e.i(127175),eP=e.i(213761),eR=e.i(499930),ez=e.i(991722);function eM(e){return e.fixedSubjectId??(e.confirmBeforeImport?null:e.importSubjectId??null)}function eO(e,t){return[{label:t.upload.stages.read,ms:e.read??0},...void 0!==e.convert?[{label:t.upload.stages.convert,ms:e.convert}]:[],...void 0!==e.compress?[{label:t.upload.stages.compress,ms:(e.crop??0)+e.compress}]:[]]}async function eB(e,t){let r=[];for(let a of t){let t=await (0,eP.X)(e,a);r.push({dataUrl:t.dataUrl,info:(0,eP.N)(e,t),timings:{...e.timings,...t.timings}})}return r}function eL(e,t){let r=t=>e.reduce((e,r)=>e+r.timings[t],0);return{dataUrl:t.dataUrl,info:{sourceType:`stacked-${e.length}`,sourceBytes:e.reduce((e,t)=>e+(t.info.sourceBytes??0),0),outputWidth:t.width,outputHeight:t.height,outputBytes:t.bytes,quality:t.quality},timings:{read:r("read"),convert:r("convert"),crop:r("crop")+t.timings.crop,compress:r("compress")+t.timings.compress}}}function eU(e,t){return{imageBase64:e.dataUrl,language:t.language,subjectId:t.analyzeSubjectId,targetSubjectId:eM(t),clientTimings:e.timings,imageInfo:e.info}}function eV(e,t){return{source:"image",imageBase64:e.dataUrl,imageInfo:e.info,language:t.language,subjectId:t.analyzeSubjectId,targetSubjectId:eM(t)}}e.s(["u",0,4,"m",0,eU,"w",0,eV,"c",0,eO,"b",0,function(e,t){return{source:"text",splitter:e.splitter,forceNumbered:e.forceNumbered||void 0,text:e.text,language:e.language,subjectId:e.analyzeSubjectId??e.textNotebookId,targetSubjectId:eM(t)}},"G",0,function({questionText:e,language:t,textNotebook:r}){return{questionText:e,language:t,forImport:!0,subject:r?.name,subjectId:r?.id}},"d",0,function(e,t){return{questionText:t,answerText:e.answerText,analysis:e.analysis,knowledgePoints:e.knowledgePoints||[],wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:(0,ez.h)(e.mistakeStatus),subject:e.subject||"其他",requiresImage:!1,difficultyStars:e.difficultyStars??null,questionType:e.questionType??null,gradeSemester:e.gradeSemester??null}},"l",0,eB,"H",0,eL],315092),e.s(["f",0,function(e){let{logPrefix:t,t:a,language:i,analyzeSubjectId:s,fixedSubjectId:n,confirmBeforeImport:l,importSubjectId:o}=e,c=(0,eA.useRouter)(),[u,d]=(0,r.useState)(null),[p,f]=(0,r.useState)(!1),[x,y]=(0,r.useState)(null),[b,v]=(0,r.useState)([]),[w,j]=(0,r.useState)([]),k=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>k.current?.dispose(),[]);let S={fixedSubjectId:n,confirmBeforeImport:l,importSubjectId:o},N=async r=>{e.clearLastImported(),e.clearSaveError(),j([]),e.setAnalysisStep("reading");try{let a=await (0,eP.p)(r,()=>e.setAnalysisStep("converting"));k.current?.dispose(),k.current=a,g.V.info(t,"Image decoded",{format:a.format,sourceType:a.sourceType,sourceBytes:a.sourceBytes,width:a.width,height:a.height,decoder:a.decoder,...a.timings}),d(a.previewUrl),f(!0)}catch(i){let e=i instanceof eP.o?a.upload.decodeErrors[i.code].replace("{format}",i.format.toUpperCase()):(0,h.Z)(i);g.V.warn(t,"Image decode failed",{code:i instanceof eP.o?i.code:"UNKNOWN",format:i instanceof eP.o?i.format:"unknown",sourceType:r.type,sourceBytes:r.size}),m.c.error(e)}finally{e.setAnalysisStep("idle")}},I=async r=>{let n=Date.now();j(eO(r.timings,a));try{e.setAnalysisStep("uploading");let a=await (0,eF.S)(eU(r,{...S,language:i,analyzeSubjectId:s})),l=Date.now()-n;g.V.info(t,"Import task created",{taskId:a.id,...r.info,...r.timings,uploadMs:l}),e.setPendingTaskId(a.id),e.setTask(a)}catch(e){g.V.error(t,"Upload failed",{errorDuration:Date.now()-n,error:(0,h.Z)(e)}),m.c.error((0,eE.f)(e,a))}finally{e.setAnalysisStep("idle"),j([])}},D=async r=>{let i;e.setAnalysisStep("compressing");try{let e=await (0,eR.v)(r.map(e=>e.dataUrl));i=eL(r,e)}catch(i){g.V.error(t,"Stack parts failed",{parts:r.length,error:(0,h.Z)(i)}),m.c.error((0,eE.f)(i,a)),e.setAnalysisStep("idle");return}g.V.info(t,"Question parts stacked",{parts:r.length,width:i.info.outputWidth,height:i.info.outputHeight}),v([]),await I(i)},T=async r=>{let i=k.current;if(i&&!(b.length>=3)){f(!1),e.setAnalysisStep("compressing");try{let[e]=await eB(i,[r]);v(t=>[...t,e]),m.c.info(a.upload.parts.added.replace("{n}",String(b.length+1)))}catch(e){g.V.error(t,"Crop part failed",{error:(0,h.Z)(e)}),m.c.error((0,eE.f)(e,a))}finally{e.setAnalysisStep("idle")}}},A=async(r,i)=>{let s,n=k.current;if(n&&0!==r.length){f(!1),j(eO(n.timings,a)),e.setAnalysisStep("compressing");try{s=await eB(n,r)}catch(r){g.V.error(t,"Crop failed",{error:(0,h.Z)(r)}),m.c.error((0,eE.f)(r,a)),e.setAnalysisStep("idle");return}if(i){e.setAnalysisStep("idle"),j([]),e.clearLastImported(),e.clearSaveError(),y(s);return}if(b.length>0)return void await D([...b,s[0]]);await I(s[0])}},E=async r=>{let n=k.current;if(n){f(!1),j(eO(n.timings,a)),e.setAnalysisStep("compressing");try{let[l]=await eB(n,[r]);j(eO(l.timings,a)),e.setAnalysisStep("uploading");let o=await (0,eC.v)(eV(l,{...S,language:i,analyzeSubjectId:s}));g.V.info(t,"Image batch created",{batchId:o.id,...l.info}),c.push(`/import-batches/${o.id}`)}catch(e){g.V.error(t,"Image batch failed",{error:(0,h.Z)(e)}),m.c.error((0,eE.f)(e,a))}finally{e.setAnalysisStep("idle"),j([])}}};return{croppingImage:u,isCropperOpen:p,setIsCropperOpen:f,batchImages:x,setBatchImages:y,parts:b,setParts:v,completedStages:w,preparedRef:k,selectImage:N,cropRegions:A,addPart:T,uploadImage:I,uploadParts:D,autoSplitImage:E,finishParts:()=>D(b),discardParts:()=>v([]),closeBatch:()=>y(null),closeCropper:()=>f(!1)}}],610554)},598053,e=>{var t=e.i(271645),r=e.i(41931),a=e.i(201276),i=e.i(25197),s=e.i(111110),n=e.i(610554),l=e.i(618566),o=e.i(767077),c=e.i(303163),u=e.i(294114),d=e.i(119472),p=e.i(682638),m=e.i(825624),f=e.i(315092),g=e.i(901219),h=e.i(183444);e.s(["f",0,function({logPrefix:e,analyzeSubjectId:x,importSubjectId:y,textNotebook:b,fixedSubjectId:v}){let{t:w,language:j}=(0,s.b)(),k=(0,h.f)(e),[S,N]=(0,t.useState)("idle"),[I,D]=(0,t.useState)(null),[T,A]=(0,t.useState)(!1),[E,C]=(0,t.useState)(null),F=(0,g.a)(E),P=I?.timeouts?.analyze||18e4,R=P+1e4,z=function(e){let{logPrefix:s,t:n,language:g,analyzeSubjectId:h,importSubjectId:x,textNotebook:y,fixedSubjectId:b,confirmBeforeImport:v,aiTimeout:w}=e,j=(0,l.useRouter)(),[k,S]=(0,t.useState)(!1),[N,I]=(0,t.useState)("upload"),[D,T]=(0,t.useState)(null),[A,E]=(0,t.useState)(null),[C,F]=(0,t.useState)(null),P={fixedSubjectId:b,confirmBeforeImport:v,importSubjectId:x},R=async t=>{if(!v){e.setAnalysisStep("saving");let r=await (0,i.a)(t,{subjectId:x,imageUrl:null});F(r),E(null),a.V.info(s,"Imported without review",{id:r.id});return}E(null),T(t),I("review")};return{step:N,setStep:I,cancelReview:()=>{I("upload"),e.clearSaveError()},parsedData:D,setParsedData:T,currentImage:A,setCurrentImage:E,lastImported:C,dismissImported:()=>F(null),creatingBatch:k,submitText:async t=>{e.clearSaveError();let i=Date.now();a.V.info(s,"Starting text-based analysis",{textLength:t.length});try{e.setAnalysisStep("analyzing");let n=await r.k.post("/api/reanswer",(0,f.G)({questionText:t,language:g,textNotebook:y}),{timeout:w,recoverable:!0});e.setAnalysisStep("processing"),await R((0,f.d)(n,t)),a.V.info(s,"Text analysis completed",{totalDuration:Date.now()-i})}catch(e){a.V.error(s,"Text analysis failed",{errorDuration:Date.now()-i,error:(0,c.Z)(e)}),u.c.error((0,o.f)(e,n))}finally{e.setAnalysisStep("idle")}},createTextBatch:async(t,r,i=!1)=>{e.clearSaveError(),S(!0);try{if("local"===r){let e=(0,m.J)(t,{forceNumbered:i});if((0,p.X)(e)){let r;a.V.info(s,"Auto-splitting long text",{candidateCount:e.candidateCount,overflow:e.overflow,tooLong:e.tooLong});try{r=(0,p.U)(t,{forceNumbered:i})}catch(e){a.V.error(s,"Auto-split failed",{error:(0,c.Z)(e)}),u.c.error((0,c.Z)(e));return}let{batches:l,failures:o}=await (0,p.r)(r,{language:g,subjectId:h??y?.id,targetSubjectId:P.fixedSubjectId??(P.confirmBeforeImport?null:P.importSubjectId??null)});for(let e of(a.V.info(s,"Auto-split batches created",{count:l.length,failures:o.length}),l.length>0&&(u.c.success(n.app.autoSplitHint.replace("{count}",String(l.length)).replace("{max}",String(m.S))),j.push(`/import-batches/${l[0].id}`)),o))u.c.error(n.app.autoSplitFailed.replace("{index}",String(e.index+1)).replace("{error}",(0,c.Z)(e.error)));return}}let e=await (0,d.v)((0,f.b)({text:t,splitter:r,forceNumbered:i,language:g,analyzeSubjectId:h,textNotebookId:y?.id},P));a.V.info(s,"Text batch created",{batchId:e.id,splitter:r,questions:e.itemCount}),j.push(`/import-batches/${e.id}`)}catch(e){a.V.error(s,"Text batch failed",{error:(0,c.Z)(e)}),u.c.error((0,o.f)(e,n))}finally{S(!1)}}}}({logPrefix:e,t:w,language:j,analyzeSubjectId:x,importSubjectId:y,textNotebook:b,fixedSubjectId:v,confirmBeforeImport:T,aiTimeout:P,setAnalysisStep:N,clearSaveError:()=>k.setSaveError(null)}),M=(0,n.f)({logPrefix:e,t:w,language:j,analyzeSubjectId:x,fixedSubjectId:v,confirmBeforeImport:T,importSubjectId:y,setAnalysisStep:N,setPendingTaskId:C,setTask:F.setTask,clearLastImported:z.dismissImported,clearSaveError:()=>k.setSaveError(null)});(0,t.useEffect)(()=>{(0,i.x)().then(A),r.k.get("/api/settings").then(D).catch(t=>a.V.error(e,"Failed to fetch config",{error:t}))},[e]),(0,t.useEffect)(()=>{if("idle"===S)return;let e=setTimeout(()=>{a.V.warn("[Progress]","处理超时,关闭进度提示",{analysisStep:S,safetyTimeout:R}),N("idle")},R);return()=>clearTimeout(e)},[S,R]);let O=e=>k.run(()=>r.k.post("/api/error-items",e),e.subjectId),B=async e=>{await O({...e,originalImageUrl:z.currentImage||"",...v?{subjectId:v}:{}})&&(z.setStep("upload"),z.setParsedData(null),z.setCurrentImage(null))};return{step:z.step,cancelReview:z.cancelReview,saveError:k.saveError,dismissSaveError:k.dismissSaveError,analysisStep:S,setAnalysisStep:N,isBusy:"idle"!==S,parsedData:z.parsedData,currentImage:z.currentImage,aiTimeout:P,croppingImage:M.croppingImage,isCropperOpen:M.isCropperOpen,closeCropper:M.closeCropper,lastImported:z.lastImported,dismissImported:z.dismissImported,batchImages:M.batchImages,closeBatch:M.closeBatch,completedStages:M.completedStages,pendingTask:E?F.task:null,refreshPendingTask:F.refresh,dismissPendingTask:()=>C(null),selectImage:M.selectImage,cropRegions:M.cropRegions,submitText:z.submitText,saveQuestion:O,saveReviewed:B,createTextBatch:z.createTextBatch,autoSplitImage:M.autoSplitImage,creatingBatch:z.creatingBatch,parts:M.parts,addPart:M.addPart,finishParts:M.finishParts,discardParts:M.discardParts}}],598053)},682638,e=>{var t=e.i(825624),r=e.i(119472);let a=t.k;function i(e){let t=e=>e?.trim()?e.trim().slice(0,2e4):void 0;return{text:e.text,material:t(e.material),section:e.section?.trim()?e.section.trim().slice(0,500):void 0,label:e.label?.trim()?e.label.trim().slice(0,20):void 0,answer:t(e.answer),analysis:t(e.analysis),knowledgePoints:e.knowledgePoints?.length?e.knowledgePoints.slice(0,100):void 0,difficultyStars:e.difficultyStars??void 0,wrongAnswer:t(e.wrongAnswer),questionType:e.questionType?.trim()?e.questionType.trim().slice(0,100):void 0,image:e.image??void 0}}async function s(e,s){if(0===e.length)throw Error("STRUCTURED_ITEMS_EMPTY");if(e.length>a)throw Error("STRUCTURED_ITEMS_TOO_MANY");let n=s.clientRequestIdPrefix??`sb-${Math.random().toString(36).slice(2,10)}`,l=function(e,r=t.S,a=8388608){let i=[],s=[],n=0;for(let t of e){let e=t.image?.length??0;s.length>0&&(s.length>=r||n+e>a)&&(i.push(s),s=[],n=0),s.push(t),n+=e}return s.length>0&&i.push(s),i}(e),o=[],c=[];for(let e=0;e<l.length;e++){let t=l[e],a={source:"text",splitter:"local",items:t.map(i),language:s.language,subjectId:s.subjectId??void 0,targetSubjectId:s.targetSubjectId??void 0,paperLevel:s.paperLevel??void 0};0===e&&s.origin&&(a.origin=s.origin);try{let t=await (0,r.v)(a,`${n}-${e}`);o.push(t)}catch(r){c.push({index:e,items:t,error:r})}}return{batches:o,clientRequestIdPrefix:n,failures:c}}e.s(["e",0,a,"r",0,s,"X",0,function(e){return e.candidateCount>t.S||e.overflow>0||e.tooLong},"U",0,function(e,r={}){if(e.length>t.f)throw Error("TEXT_TOO_LONG_FOR_AUTO_SPLIT");let a=(0,t.J)(e,{forceNumbered:r.forceNumbered,maxLength:t.f,maxQuestions:t.k});if(a.tooLong)throw Error("TEXT_TOO_LONG_FOR_AUTO_SPLIT");if(a.overflow>0)throw Error("TOO_MANY_QUESTIONS_FOR_AUTO_SPLIT");return a.questions.map(e=>({text:e.text,material:e.material??null,section:e.section??null,label:e.label??null,answer:e.answer??null,analysis:e.analysis??null,knowledgePoints:e.knowledgePoints??null,difficultyStars:e.difficultyStars??null,wrongAnswer:e.wrongAnswer??null,questionType:e.questionType??null}))}])}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,518515,e=>{var t=e.i(456420);let r={name:"camera",size:24,node:[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],518515)},325597,7891,e=>{var t=e.i(456420);let r={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};r.node;let a=(0,t.f)(r);e.s(["f",0,a],7891),e.s(["f",0,a],325597)},747819,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(522016),i=e.i(548161),s=e.i(632781),n=e.i(395925),l=e.i(583967),o=e.i(519455),c=e.i(515288),u=e.i(111110),d=e.i(201276),p=e.i(127175);let m=e=>new Promise(t=>setTimeout(t,e));async function f(e,t){for(;;){if("hidden"!==document.visibilityState){let r=await (0,p.h)(e);if(t(r),"analyzing"!==r.status&&"saving"!==r.status)return r}await m(2500)}}async function g(e,t,r){let a=[...e],i=async()=>{for(;a.length>0;)await r(a.shift())};await Promise.all(Array.from({length:Math.min(t,a.length)},i))}function h({item:e}){let{t:r}=(0,u.b)(),a=r.batchImport.status[e.status];return"success"===e.status?(0,t.jsxs)("span",{className:"flex items-start gap-1 text-green-700 dark:text-green-300",children:[(0,t.jsx)(i.f,{className:"h-4 w-4 shrink-0 mt-0.5"}),e.imported?.duplicate?r.importFlow.duplicate:a]}):"failed"===e.status?(0,t.jsxs)("span",{className:"flex items-center gap-1 text-destructive",children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),a]}):(0,t.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:["pending"!==e.status&&(0,t.jsx)(s.f,{className:"h-4 w-4 animate-spin"}),a]})}e.s(["f",0,function({images:e,subjectId:i,onClose:s}){let{t:l,language:m}=(0,u.b)(),[x,y]=(0,r.useState)(()=>e.map(()=>({status:"pending"}))),v=(0,r.useRef)(!1),b=(0,r.useRef)([]),w=(0,r.useCallback)((e,t)=>{y(r=>r.map((r,a)=>a===e?{...r,...t}:r))},[]),j=(0,r.useCallback)((e,t)=>{let r=t?.data,a=r?.message||(t instanceof Error?t.message:String(t)),i=l.errors[a];w(e,{status:"failed",error:"string"==typeof i?i:a}),d.V.error("[BatchImport]","Question import failed",{index:e,error:a})},[l.errors,w]),k=(0,r.useCallback)(async t=>{w(t,{status:"uploading",error:void 0});try{let r=b.current[t];if(r)await (0,p.R)(r);else{let r=e[t],a=await (0,p.S)({imageBase64:r.dataUrl,language:m,subjectId:i,targetSubjectId:i,mode:"auto",clientTimings:r.timings,imageInfo:r.info});b.current[t]=a.id,w(t,{taskId:a.id})}return w(t,{status:"analyzing"}),!0}catch(e){return j(t,e),!1}},[e,m,i,w,j]),S=(0,r.useCallback)(async e=>{let t=b.current[e];if(t)try{let r=await f(t,t=>w(e,{status:"saving"===t.status?"saving":"analyzing"}));if("saved"!==r.status||!r.errorItemId)throw{data:{message:r.error||"QUESTION_SAVE_FAILED"}};(0,p.N)(t).catch(()=>void 0),w(e,{status:"success",imported:{id:r.errorItemId,shortId:r.errorItemShortId,subjectId:i??null,notebookName:r.notebookName,duplicate:r.duplicate}})}catch(t){j(e,t)}},[i,w,j]),N=(0,r.useCallback)(async e=>{let t=[];await g(e,2,async e=>{await k(e)&&t.push(e)}),await Promise.all(t.map(S))},[k,S]),I=(0,r.useCallback)(async e=>{await k(e)&&await S(e)},[k,S]);(0,r.useEffect)(()=>{v.current||(v.current=!0,N(e.map((e,t)=>t)))},[e,N]);let D=x.filter(e=>"success"===e.status).length,T=x.flatMap((e,t)=>"failed"===e.status?[t]:[]),A=x.some(e=>"pending"===e.status||"uploading"===e.status||"analyzing"===e.status||"saving"===e.status),E=x.some(e=>"pending"===e.status||"uploading"===e.status),C=x.filter(e=>e.taskId&&"uploading"!==e.status).length;return(0,t.jsxs)(c.N,{children:[(0,t.jsxs)(c.Y,{className:"flex flex-row items-center justify-between gap-2 space-y-0",children:[(0,t.jsx)(c.v,{className:"text-base",children:l.batchImport.title}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:l.batchImport.summary.replace("{done}",String(D)).replace("{total}",String(x.length)).replace("{failed}",String(T.length))})]}),(0,t.jsxs)(c.O,{className:"space-y-4",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"batch-upload-progress",children:E?l.batchImport.uploaded.replace("{done}",String(C)).replace("{total}",String(x.length)):A?l.importTasks.uploadedHint:null}),(0,t.jsx)("ul",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:x.map((r,i)=>(0,t.jsxs)("li",{className:"flex gap-3 rounded-lg border p-3",children:[(0,t.jsx)("img",{src:e[i].dataUrl,alt:"",className:"h-20 w-20 shrink-0 rounded object-contain bg-muted"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1 text-sm",children:[(0,t.jsx)("div",{className:"font-medium",children:l.batchImport.question.replace("{index}",String(i+1))}),(0,t.jsx)(h,{item:r}),"success"===r.status&&r.imported&&(0,t.jsxs)(a.default,{href:`/error-items/${r.imported.id}`,className:"block truncate text-xs text-primary hover:underline",children:[r.imported.notebookName," · ",r.imported.shortId]}),"failed"===r.status&&(0,t.jsxs)(t.Fragment,{children:[r.error&&(0,t.jsx)("p",{className:"line-clamp-2 text-xs text-destructive",children:r.error}),(0,t.jsxs)(o.f,{size:"sm",variant:"outline",className:"h-7",onClick:()=>I(i),children:[(0,t.jsx)(n.f,{className:"mr-1 h-3 w-3"}),l.batchImport.retry]})]})]})]},i))}),(0,t.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end gap-2",children:[T.length>1&&!A&&(0,t.jsxs)(o.f,{variant:"outline",onClick:()=>N(T),children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),l.batchImport.retryFailed]}),(0,t.jsx)(o.f,{onClick:s,disabled:E,children:l.batchImport.finish})]})]})]})}])},310115,569644,651304,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(456420);let i={name:"folder-open",size:24,node:[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]};i.node;let s=(0,a.f)(i);e.s(["f",0,s],569644);var n=e.i(519455);function l(e){return[...e.extensions,...e.unlistedExtensions??[]]}let o=[{key:"text",extensions:[".txt",".md",".markdown"],mimeTypes:["text/plain","text/markdown"],maxBytes:2097152,category:"text"},{key:"docx",extensions:[".docx"],unlistedExtensions:[".doc"],mimeTypes:["application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/msword"],maxBytes:0x3200000,category:"doc"},{key:"xlsx",extensions:[".xlsx"],mimeTypes:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],maxBytes:0x1400000,category:"sheet"},{key:"csv",extensions:[".csv"],mimeTypes:["text/csv"],maxBytes:0xa00000,category:"sheet"},{key:"json",extensions:[".json"],mimeTypes:["application/json"],maxBytes:0x3200000,category:"data"},{key:"pdf",extensions:[".pdf"],mimeTypes:["application/pdf"],maxBytes:0x3200000,category:"pdf"}];o.filter(e=>"text"===e.key);let c=o.filter(e=>"text"!==e.key),u=[239,187,191],d=[255,254],p=[254,255];function m(e,t,r=0){return!(e.length<t.length+r)&&t.every((t,a)=>e[r+a]===t)}function f(e){let t=e;return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t.includes("\0")&&(t=t.replace(/\0/g,"")),t.replace(/\r\n/g,"\n").replace(/\r/g,"\n")}e.s(["b",0,c,"u",0,o,"a",0,l,"n",0,function(e){let t=new Uint8Array(e);if(m(t,u))return{text:f(new TextDecoder("utf-8").decode(t.subarray(u.length))),encoding:"utf-8"};if(m(t,d))return{text:f(new TextDecoder("utf-16le").decode(t.subarray(d.length))),encoding:"utf-16le"};if(m(t,p))return{text:f(new TextDecoder("utf-16be").decode(t.subarray(p.length))),encoding:"utf-16be"};try{let e=new TextDecoder("utf-8",{fatal:!0}).decode(t);return{text:f(e),encoding:"utf-8"}}catch{return{text:f(new TextDecoder("gb18030").decode(t)),encoding:"gb18030"}}},"G",0,function(e,t){let r=e.toLowerCase(),a=t.toLowerCase().trim();for(let e of o)if(l(e).some(e=>r.endsWith(e)))return e;if(a){for(let e of o)if(e.mimeTypes.includes(a))return e}return null}],651304);var g=e.i(111110),h=e.i(294114);e.s(["f",0,function({types:e,onFile:a,disabled:i=!1,inputRef:o,className:c}){let{t:u}=(0,g.b)(),d=(0,r.useRef)(null),p=o??d,m=Array.from(new Set(e.flatMap(e=>[...l(e),...e.mimeTypes]))).join(",");return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.f,{type:"button",variant:"outline",onClick:()=>p.current?.click(),disabled:i,className:c,children:[(0,t.jsx)(s,{className:"mr-2 h-4 w-4"}),u.importFile.button]}),(0,t.jsx)("input",{ref:p,type:"file",accept:m,className:"hidden",onChange:t=>{let r=t.target,i=r.files?.[0];if(r.value="",!i)return;let s=e.find(e=>l(e).some(e=>i.name.toLowerCase().endsWith(e))||i.type&&e.mimeTypes.includes(i.type.toLowerCase()));s?i.size>s.maxBytes?h.c.error(u.importFile.tooLarge.replace("{max}",String(Math.round(s.maxBytes/1024/1024)))):a(i,s):h.c.error(u.importFile.unsupportedType)},"data-testid":"import-file-input","aria-label":u.importFile.button})]})}],310115)},430634,576019,847483,e=>{var t=e.i(843476),r=e.i(522016),a=e.i(548161),i=e.i(263676),s=e.i(519455),n=e.i(111110);e.s(["f",0,function({imported:e,onDismiss:l}){let{t:o}=(0,n.b)(),c=(e.duplicate?o.importFlow.duplicate:o.importFlow.imported).replace("{notebook}",e.notebookName||"-").replace("{id}",e.shortId||"-");return(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 rounded-lg border border-green-300 dark:border-green-800 bg-green-50 dark:bg-green-950/40 p-3 text-sm text-green-800 dark:text-green-200",role:"status",children:[(0,t.jsxs)("span",{className:"flex items-start gap-2 flex-1",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 mt-0.5 shrink-0"}),c]}),(0,t.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,t.jsx)(r.default,{href:`/error-items/${e.id}`,children:(0,t.jsx)(s.f,{size:"sm",variant:"outline",className:"bg-background",children:o.importFlow.viewItem})}),(0,t.jsx)(s.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:l,"aria-label":o.detail.close,children:(0,t.jsx)(i.X,{className:"h-4 w-4"})})]})]})}],430634);var l=e.i(731335),o=e.i(532377),c=e.i(339501);e.s(["f",0,function({task:e,onRefresh:a,onDismiss:u}){let{t:d}=(0,n.b)(),p=(0,o.f)(a),m=(0,c.f)("analyzing"===e.status||"saving"===e.status);return(0,t.jsxs)("div",{className:"space-y-2 rounded-xl border bg-card p-3",role:"status","data-testid":"pending-import-task",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)("p",{className:"flex-1 text-sm text-muted-foreground",children:d.importTasks.uploadedHint}),(0,t.jsx)(s.f,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:u,"aria-label":d.common.close,children:(0,t.jsx)(i.X,{className:"h-4 w-4"})})]}),(0,t.jsx)(l.f,{task:e,now:m,onReview:()=>p.openReview(e),onViewItem:()=>p.viewItem(e),onRetry:()=>p.retry(e),onDiscard:async()=>{await p.discard(e)&&u()}}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[d.importTasks.stageEstimate," ·"," ",(0,t.jsx)(r.default,{href:"/import-tasks",className:"text-primary hover:underline",children:d.importTasks.viewTasks})]})]})}],576019);var u=e.i(13285),d=e.i(632781);e.s(["f",0,function({parts:e,busy:r,onFinish:a,onDiscard:l}){let{t:o}=(0,n.b)();return(0,t.jsxs)("section",{className:"space-y-3 rounded-2xl border border-primary/40 bg-primary/5 p-4","data-testid":"question-parts",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold",children:[(0,t.jsx)(u.f,{className:"h-4 w-4 text-primary"}),o.upload.parts.title.replace("{count}",String(e.length))]}),(0,t.jsx)("ol",{className:"flex gap-2 overflow-x-auto pb-1",children:e.map((e,r)=>(0,t.jsxs)("li",{className:"shrink-0 text-center text-xs text-muted-foreground",children:[(0,t.jsx)("img",{src:e,alt:o.upload.parts.part.replace("{n}",String(r+1)),className:"h-20 max-w-[8rem] rounded border bg-white object-contain"}),o.upload.parts.part.replace("{n}",String(r+1))]},r))}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.upload.parts.hint}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,t.jsxs)(s.f,{onClick:a,disabled:r,className:"sm:flex-1",children:[r?(0,t.jsx)(d.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(u.f,{className:"mr-2 h-4 w-4"}),o.upload.parts.finish.replace("{count}",String(e.length))]}),(0,t.jsxs)(s.f,{variant:"ghost",onClick:l,disabled:r,children:[(0,t.jsx)(i.X,{className:"mr-1 h-4 w-4"}),o.upload.parts.discard]})]})]})}],847483)},717448,798469,956738,315092,610554,e=>{var t=e.i(843476),r=e.i(271645),a=e.i(13285),i=e.i(632781),s=e.i(325597),n=e.i(328623),l=e.i(519455),o=e.i(515288),c=e.i(310115),u=e.i(110204),d=e.i(624687),p=e.i(111110),m=e.i(294114),f=e.i(651304),g=e.i(201276),h=e.i(303163),x=e.i(825624);e.s(["f",0,function({onSubmit:e,isAnalyzing:y,defaultNotebookName:v,onCreateBatch:b,creatingBatch:w=!1,onSwitchToFileImport:j}){let{t:k}=(0,p.b)(),[S,N]=(0,r.useState)(""),I=(0,r.useDeferredValue)(S),D=(0,r.useMemo)(()=>b&&I.trim()?(0,x.J)(I):null,[I,b]),T=D?.detected?D.candidateCount:0,A=D?.ambiguous?D.candidateCount:0,E=S.length>x.i,C=y||w,F=S.trim(),P=async()=>{F&&await e(F)},R=async(e,t=!1)=>{F&&b&&("ai"===e&&E||await b(S,e,t))},z=async e=>{let t,r=(0,f.G)(e.name,e.type);if(r&&"text"!==r.key)return void(j?await (0,m.u)(k.importFile.bankFileHint,{confirmText:k.importFile.bankFileSwitch,cancelText:k.importFile.bankFileStay})&&j():m.c.info(k.importFile.bankFileHint));try{let r=await e.arrayBuffer();t=(0,f.n)(r).text}catch(e){g.V.error("text-input-zone","Failed to read import file",{error:(0,h.Z)(e)}),m.c.error(k.importFile.readFailed);return}S.trim()?N(await (0,m.u)(k.app.importFileReplaceConfirm,{confirmText:k.app.importFileReplace,cancelText:k.app.importFileAppend})?t:S+"\n"+t):N(t)},O=e=>b&&F?(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)(l.f,{variant:"link",size:"sm",onClick:()=>R("ai"),disabled:C||E,className:"h-auto whitespace-normal",children:[w?(0,t.jsx)(i.f,{className:"mr-1 h-3 w-3 animate-spin"}):(0,t.jsx)(a.f,{className:"mr-1 h-3 w-3"}),w?k.app.creatingBatch:e]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:k.app.aiSplitHint})]}):null;return(0,t.jsx)(o.N,{className:"rounded-2xl",children:(0,t.jsxs)(o.O,{className:"space-y-4 p-6",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(s.f,{className:"h-5 w-5"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:k.app?.textInputHint||"Enter question text"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)(u.f,{htmlFor:"question-text",children:k.editor?.question||"Question Text"}),(0,t.jsx)(c.f,{types:f.u,onFile:z,disabled:C})]}),(0,t.jsx)(d.f,{id:"question-text",value:S,onChange:e=>N(e.target.value),onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),F&&!C&&(T>1&&!E?R("local"):P()))},placeholder:k.app?.textInputPlaceholder||"Paste or type question text here...",className:"min-h-[200px] resize-y font-mono text-sm",disabled:C})]}),v&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[k.notebooks?.title||"My Notebooks",": ",v]}),b&&E&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:k.app.textTooLong}),T>1?(0,t.jsxs)("div",{className:"space-y-2","data-testid":"multi-detected",children:[(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[(0,t.jsx)(a.f,{className:"h-4 w-4"}),k.app.multiDetected.replace("{count}",String(T))]}),(D?.overflow??0)>0&&(0,t.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:k.app.overflowHint.replace("{count}",String(D?.overflow))}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,t.jsxs)(l.f,{onClick:()=>R("local"),disabled:C,size:"lg",className:"flex-1 bg-gradient-to-r from-indigo-600 to-violet-500 font-medium text-white hover:from-indigo-700 hover:to-violet-600",children:[w?(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),w?k.app.creatingBatch:k.app.splitPreview.replace("{count}",String(Math.min(T,60)))]}),(0,t.jsxs)(l.f,{onClick:P,disabled:C,size:"lg",variant:"outline",children:[y?(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),y?k.editor?.reanswering||"AI solving...":k.app.solveAsOne]})]}),O(k.app.aiSplitMulti)]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.f,{onClick:P,disabled:!F||C,className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 font-medium text-white hover:from-indigo-700 hover:to-violet-600",size:"lg",children:y?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4 animate-spin"}),k.editor?.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),k.app?.aiSolve||"AI Solve"]})}),A>1&&(0,t.jsxs)("div",{className:"space-y-1 rounded-lg bg-muted/60 p-3 text-center","data-testid":"sub-questions-hint",children:[(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:k.app.subQuestionsHint.replace("{count}",String(A))}),(0,t.jsxs)(l.f,{variant:"outline",size:"sm",onClick:()=>R("local",!0),disabled:C||E,children:[(0,t.jsx)(a.f,{className:"mr-1 h-3 w-3"}),k.app.splitAnyway.replace("{count}",String(A))]})]}),O(k.app.aiSplit)]}),(0,t.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:k.app?.textInputTip||"After entering the question, AI will automatically solve and generate analysis"})]})})}],717448);let y=new Map([["avif","image/avif"],["bmp","image/bmp"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["gif","image/gif"],["gz","application/gzip"],["htm","text/html"],["html","text/html"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","application/javascript"],["json","application/json"],["md","text/markdown"],["mjs","application/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["ogg","audio/ogg"],["pdf","application/pdf"],["png","image/png"],["ppt","application/powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["svg","image/svg+xml"],["tif","image/tiff"],["tiff","image/tiff"],["txt","text/plain"],["wasm","application/wasm"],["wav","audio/x-wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["zip","application/zip"]]);var v=class extends Error{constructor(e){super("DataTransferItem is not a file"),this.item=e,this.name="UnexpectedObjectError"}};function b(e,t,r){let{webkitRelativePath:a}=e,i="string"==typeof t?t:"string"==typeof a&&a.length>0?a:`./${e.name}`;return"string"!=typeof e.path&&w(e,"path",i),void 0!==r&&Object.defineProperty(e,"handle",{value:r,writable:!1,configurable:!1,enumerable:!0}),w(e,"relativePath",i),e}function w(e,t,r){Object.defineProperty(e,t,{value:r,writable:!1,configurable:!1,enumerable:!0})}let j=[".DS_Store","Thumbs.db"];async function k(e,{mimeTypes:t=y}={}){return(await S(e)).map(e=>"path"in e?function(e,t=y){let{name:r}=e;if(r&&-1!==r.lastIndexOf(".")&&!e.type){let a=r.split(".").pop().toLowerCase(),i=t.get(a);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}(e,t):e)}async function S(e){var t,r,a;if(N(e)&&N(e.dataTransfer))return D(e.dataTransfer,e.type);if(N(t=e)&&N(t.clipboardData)){let t;return T(((t=A((r=e.clipboardData).items).filter(e=>"file"===e.kind).map(e=>e.getAsFile()).filter(e=>null!==e)).length>0?t:A(r.files)).map(e=>b(e)))}if(N(a=e)&&N(a.target))return A(e.target.files).map(e=>b(e));return Array.isArray(e)&&e.every(e=>"getFile"in e&&"function"==typeof e.getFile)?I(e):[]}function N(e){return"object"==typeof e&&null!==e}async function I(e){return(await Promise.all(e.map(e=>e.getFile()))).map(e=>b(e))}async function D(e,t){let r=A(e.items).filter(e=>"file"===e.kind);return"drop"!==t?r:T(function e(t){let r=[];for(let a of t)Array.isArray(a)?r.push(...e(a)):r.push(a);return r}(await Promise.all(r.map(E))))}function T(e){return e.filter(e=>-1===j.indexOf(e.name))}function A(e){return null===e?[]:Array.from(e)}async function E(e){if("function"!=typeof e.webkitGetAsEntry)return C(e);let t=e.webkitGetAsEntry();if(t?.isDirectory){let r=await F(e);return r?.kind==="directory"?P(r,`/${r.name}`):z(t)}return C(e,t)}async function C(e,t){let r=e.getAsFile(),a=await F(e);if(null!=a){let e=r??await a.getFile();return e.handle=a,b(e)}if(!r)throw new v(e);return b(r,t?.fullPath??void 0)}async function F(e){if(globalThis.isSecureContext&&"function"==typeof e.getAsFileSystemHandle)return e.getAsFileSystemHandle()}async function P(e,t){let r=[];for await(let a of e.values()){let e=`${t}/${a.name}`;if("directory"===a.kind)r.push(...await P(a,e));else{let t=await a.getFile();r.push(b(t,e,a))}}return r}async function R(e){return e.isDirectory?z(e):O(e)}function z(e){let t=e.createReader();return new Promise((e,r)=>{let a=[];!function i(){t.readEntries(async t=>{if(t.length){let e=Promise.all(t.map(R));a.push(e),i()}else try{e(await Promise.all(a))}catch(e){r(e)}},e=>{r(e)})}()})}async function O(e){return new Promise((t,r)=>{e.file(r=>{t(b(r,e.fullPath))},e=>{r(e)})})}let B=function(e,t){if(e&&t){let r=(Array.isArray(t)?t:t.split(",")).filter(e=>""!==e.trim());if(0===r.length)return!0;let a=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return r.some(e=>{let t=e.trim().toLowerCase();return"."===t.charAt(0)?a.toLowerCase().endsWith(t):t.endsWith("/*")?s===t.replace(/\/.*$/,""):i===t})}return!0},M=["KB","MB","GB","TB","PB"];function L(e){if(e<1024)return`${e} ${1===e?"byte":"bytes"}`;let t=e/1024,r=0;for(;t>=1024&&r<M.length-1;)t/=1024,r++;return`${Number(t.toFixed(2))} ${M[r]}`}function U(e){return{code:"file-too-large",message:`File is larger than ${L(e)}`}}function V(e){return{code:"file-too-small",message:`File is smaller than ${L(e)}`}}let $={code:"too-many-files",message:"Too many files"};function _(e,t){let r="application/x-moz-file"===e.type||B(e,t??"")||""===e.type&&"function"==typeof e.getAsFile;return[r,r?null:function(e=""){let t=e.split(","),r=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:"file-invalid-type",message:`File type must be ${r}`}}(t)]}function q(e,t,r){if(H(e.size)){if(H(t)&&H(r)){if(e.size>r)return[!1,U(r)];if(e.size<t)return[!1,V(t)]}else if(H(t)&&e.size<t)return[!1,V(t)];else if(H(r)&&e.size>r)return[!1,U(r)]}return[!0,null]}function H(e){return null!=e}function G(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function W(e){let t=e.dataTransfer??e.clipboardData;return t?Array.prototype.some.call(t.types,e=>"Files"===e||"application/x-moz-file"===e)||Array.prototype.some.call(t.items??[],Z):!!e.target&&!!e.target.files}function Z(e){return"object"==typeof e&&null!==e&&"file"===e.kind}function X(e){e.preventDefault()}function K(...e){return(t,...r)=>e.some(e=>(!G(t)&&e&&e(t,...r),G(t)))}function Q(e){return Array.isArray(e)?e:"string"==typeof e?[e]:[]}function Y(e){if(H(e))return Array.isArray(e)?e.filter(e=>H(e)&&H(e.accept)):[{accept:e}]}function J(e,{omitWildcardMimeTypesWithExtensions:t=!1}={}){if(H(e))return Object.entries(e).reduce((e,[r,a])=>{let i=Q(a);return t&&r.endsWith("/*")&&i.some(et)?e.push(...i):e.push(r,...i),e},[]).filter(e=>ee(e)||et(e)).join(",")}function ee(e){return"audio/*"===e||"video/*"===e||"image/*"===e||"text/*"===e||"application/*"===e||/\w+\/[-+.\w]+/g.test(e)}function et(e){return/^.*\.[\w]+$/.test(e)}(0,r.forwardRef)(({children:e,...a},i)=>{let{open:s,...n}=ea(a);return(0,r.useImperativeHandle)(i,()=>({open:s}),[s]),(0,t.jsx)(t.Fragment,{children:e?.({...n,open:s})})}).displayName="Dropzone";let er={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,isDragGlobal:!1,isProcessing:!1,acceptedFiles:[],fileRejections:[],dragFileRejections:[]};function ea(e={}){let{accept:t,disabled:a=!1,getFilesFromEvent:i=k,maxSize:s=1/0,minSize:n=0,multiple:l=!0,maxFiles:o=0,onDragEnter:c,onDragLeave:u,onDragOver:d,onDrop:p,onDropAccepted:m,onDropRejected:f,onFileDialogCancel:g,onFileDialogOpen:h,useFsAccessApi:x=!1,autoFocus:y=!1,preventDropOnDocument:v=!0,noClick:b=!1,noKeyboard:w=!1,noDrag:j=!1,noDragEventsBubbling:S=!1,noPaste:N=!1,onError:I,validator:D,getErrorMessage:T}=e,A=(0,r.useMemo)(()=>(function(e){let t=Y(e);if(!H(t))return;let r={};for(let e of t)for(let[t,a]of Object.entries(e.accept)){let e=r[t]??(r[t]=[]);for(let t of Q(a))e.includes(t)||e.push(t)}return r})(t),[t]),E=(0,r.useMemo)(()=>J(A),[A]),C=(0,r.useMemo)(()=>J(A,{omitWildcardMimeTypesWithExtensions:!0}),[A]),F=(0,r.useMemo)(()=>(function(e){let t=Y(e);if(!H(t))return;let r=t.map(e=>{let t=Object.entries(e.accept).filter(([e,t])=>{let r=!0;return ee(e)||(console.warn(`Skipped "${e}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),r=!1),(Array.isArray(t)||"string"==typeof t)&&Q(t).every(et)||(console.warn(`Skipped "${e}" because an invalid file extension was provided.`),r=!1),r}).reduce((e,[t,r])=>(e[t]=Q(r),e),{});return{description:H(e.description)&&""!==e.description?e.description:function(e){let t=[],r=Object.keys(e);for(let r of Object.values(e))for(let e of Q(r))t.includes(e)||t.push(e);return t.length>0?t.join(", "):r.length>0?r.join(", "):"Files"}(t),accept:t}}).filter(e=>Object.keys(e.accept).length>0);return r.length>0?r:void 0})(t),[t]),P=(0,r.useMemo)(()=>"function"==typeof h?h:es,[h]),R=(0,r.useMemo)(()=>"function"==typeof g?g:es,[g]),z=(0,r.useRef)(null),O=(0,r.useRef)(null),[B,M]=(0,r.useReducer)(ei,er),{isFocused:L,isFileDialogActive:U}=B,V=(0,r.useRef)(U);V.current=U;let Z=(0,r.useRef)(null),en=(0,r.useCallback)(()=>{Z.current?.abort();let e=new AbortController;return Z.current=e,M({type:"setProcessing",isProcessing:!0}),e.signal},[]),el=(0,r.useCallback)(e=>{e.aborted||M({type:"setProcessing",isProcessing:!1})},[]);(0,r.useEffect)(()=>()=>Z.current?.abort(),[]);let eo=(0,r.useRef)("u">typeof window&&window.isSecureContext&&x&&"showOpenFilePicker"in window),ec=()=>{!eo.current&&U&&setTimeout(()=>{if(O.current){let{files:e}=O.current;e?.length||(M({type:"closeDialog"}),R())}},300)};(0,r.useEffect)(()=>(window.addEventListener("focus",ec,!1),()=>{window.removeEventListener("focus",ec,!1)}),[O,U,R,eo]);let eu=(0,r.useRef)([]),ed=(0,r.useRef)([]),ep=e=>{z.current&&e.target&&z.current.contains(e.target)&&e.defaultPrevented||(e.preventDefault(),eu.current=[])};(0,r.useEffect)(()=>(v&&(document.addEventListener("dragover",X,!1),document.addEventListener("drop",ep,!1)),()=>{v&&(document.removeEventListener("dragover",X),document.removeEventListener("drop",ep))}),[z,v]),(0,r.useEffect)(()=>{let e=e=>{e.target&&(ed.current=[...ed.current,e.target]),W(e)&&M({isDragGlobal:!0,type:"setDragGlobal"})},t=e=>{ed.current=ed.current.filter(t=>t!==e.target&&null!==t),ed.current.length>0||M({isDragGlobal:!1,type:"setDragGlobal"})},r=()=>{ed.current=[],M({isDragGlobal:!1,type:"setDragGlobal"})},a=()=>{ed.current=[],M({isDragGlobal:!1,type:"setDragGlobal"})};return document.addEventListener("dragenter",e,!1),document.addEventListener("dragleave",t,!1),document.addEventListener("dragend",r,!1),document.addEventListener("drop",a,!1),()=>{document.removeEventListener("dragenter",e),document.removeEventListener("dragleave",t),document.removeEventListener("dragend",r),document.removeEventListener("drop",a)}},[z]),(0,r.useEffect)(()=>(!a&&y&&z.current&&z.current.focus(),()=>{}),[z,y,a]);let em=(0,r.useCallback)(e=>{I?I(e):console.error(e)},[I]),ef=(0,r.useCallback)(e=>{e.preventDefault(),e.persist?.(),eT(e),!V.current&&(eu.current=[...eu.current,e.target],W(e)&&Promise.resolve(i(e)).then(t=>{if(G(e)&&!S)return;let r=t.length>0?function({files:e,accept:t,minSize:r,maxSize:a,multiple:i,maxFiles:s=0,validator:n,getErrorMessage:l}){let o=[],c=[],u=(e,t)=>l&&"u">typeof File&&t instanceof File?{...e,message:l(e,t)}:e;e.forEach(e=>{let[i,s]=_(e,t),[n,l]=q(e,r,a);i&&n?o.push(e):c.push({file:e,errors:[s,l].filter(e=>null!=e).map(t=>u(t,e))})});let d=i?s>=1?s:1/0:1;return(o.length>d&&o.slice(d).forEach(e=>{c.push({file:e,errors:[u($,e)]})}),c.length>0)?{verdict:"reject",rejections:c}:{verdict:n?"unknown":"accept",rejections:c}}({files:t,accept:E,minSize:n,maxSize:s,multiple:l,maxFiles:o,validator:D,getErrorMessage:T}):null;M({isDragAccept:r?.verdict==="accept",isDragReject:r?.verdict==="reject",isDragUnknown:r?.verdict==="unknown",isDragActive:!0,dragFileRejections:r?.rejections??[],type:"setDraggedFiles"}),c&&c(e)}).catch(e=>em(e)))},[i,c,em,S,E,n,s,l,o,D,T]),eg=(0,r.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),eT(e),V.current)return!1;let t=W(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch{}return t&&d&&d(e),!1},[d,S]),eh=(0,r.useCallback)(e=>{e.preventDefault(),e.persist?.(),eT(e);let t=eu.current.filter(e=>z.current?.contains(e)),r=t.indexOf(e.target);-1!==r&&t.splice(r,1),eu.current=t,!(t.length>0)&&(M({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragUnknown:!1,dragFileRejections:[]}),W(e)&&u&&u(e))},[z,u,S]),ex=(0,r.useCallback)(async(e,t,r)=>{let a,i=(e,t)=>T?{...e,message:T(e,t)}:e,c=e=>{let r=[],a=[];e.forEach(({file:e,accepted:t,acceptError:s,sizeMatch:n,sizeError:l,customErrors:o})=>{let c=!o||Array.isArray(o)&&0===o.length;if(t&&n&&c)r.push(e);else{let t=[s,l];o&&(t=t.concat(o)),a.push({file:e,errors:t.filter(e=>null!=e).map(t=>i(t,e))})}});let s=l?o>=1?o:1/0:1;r.length>s&&r.splice(s).forEach(e=>{a.push({file:e,errors:[i($,e)]})}),M({acceptedFiles:r,fileRejections:a,type:"setFiles"}),p&&p(r,a,t),a.length>0&&f&&f(a,t),r.length>0&&m&&m(r,t)},u=e.map(e=>{let[t,r]=_(e,C),[a,i]=q(e,n,s);return{file:e,accepted:t,acceptError:r,sizeMatch:a,sizeError:i,customErrors:D?D(e):null}});if(!u.some(({customErrors:e})=>null!=e&&"function"==typeof e.then))return void c(u);try{a=await Promise.all(u.map(async({customErrors:e,...t})=>({...t,customErrors:await e})))}catch(e){r.aborted||(el(r),em(e));return}r.aborted||c(a)},[M,l,C,n,s,o,p,m,f,D,T,em,el]),ey=(0,r.useCallback)(e=>{if(e.preventDefault(),e.persist?.(),eT(e),eu.current=[],(!V.current||!e.dataTransfer)&&(M({type:"reset"}),W(e))){let t=en();Promise.resolve(i(e)).then(r=>{if(!t.aborted)return G(e)&&!S?void el(t):ex(r,e,t)}).catch(e=>{t.aborted||(el(t),em(e))})}},[i,ex,em,S,en,el]),ev=(0,r.useCallback)(e=>{if(!W(e))return;e.preventDefault(),e.persist?.(),eT(e);let t=en();Promise.resolve(i(e)).then(r=>{if(!t.aborted)return G(e)&&!S?void el(t):ex(r,e,t)}).catch(e=>{t.aborted||(el(t),em(e))})},[i,ex,em,S,en,el]),eb=(0,r.useCallback)(()=>{if(eo.current){let e;M({type:"openDialog"}),P(),window.showOpenFilePicker({multiple:l,types:F}).then(t=>(e=en(),i(t))).then(t=>{if(M({type:"closeDialog"}),!e.aborted)return ex(t,null,e)}).catch(t=>{(e&&el(e),t instanceof DOMException&&("AbortError"===t.name||t.code===t.ABORT_ERR))?(R(t),M({type:"closeDialog"})):t instanceof DOMException&&("SecurityError"===t.name||t.code===t.SECURITY_ERR)||t instanceof DOMException&&"NotAllowedError"===t.name?(eo.current=!1,O.current?(O.current.value="",O.current.click()):em(Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):em(t)});return}O.current&&(M({type:"openDialog"}),P(),O.current.value="",O.current.click())},[M,P,R,x,ex,em,F,l,en,el]),ew=(0,r.useCallback)(e=>{z.current?.isEqualNode(e.target)&&(" "===e.key||"Enter"===e.key||32===e.keyCode||13===e.keyCode)&&(e.preventDefault(),eb())},[z,eb]),ej=(0,r.useCallback)(()=>{M({type:"focus"})},[]),ek=(0,r.useCallback)(()=>{M({type:"blur"})},[]),eS=(0,r.useCallback)(()=>{b||(function(e=window.navigator.userAgent){return -1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")||-1!==e.indexOf("Edge/")}()?setTimeout(eb,0):eb())},[b,eb]),eN=e=>a?null:e,eI=e=>w?null:eN(e),eD=e=>j?null:eN(e),eT=e=>{S&&e.stopPropagation()},eA=(0,r.useMemo)(()=>({refKey:e="ref",role:t,onKeyDown:r,onFocus:i,onBlur:s,onClick:n,onDragEnter:l,onDragOver:o,onDragLeave:c,onDrop:u,onPaste:d,...p}={})=>{let m;return{onKeyDown:eI(K(r,ew)),onFocus:eI(K(i,ej)),onBlur:eI(K(s,ek)),onClick:eN(K(n,eS)),onDragEnter:eD(K(l,ef)),onDragOver:eD(K(o,eg)),onDragLeave:eD(K(c,eh)),onDrop:eD(K(u,ey)),onPaste:(m=K(d,ev),N?null:eN(m)),role:"string"==typeof t&&""!==t?t:"presentation",[e]:z,...!a&&!w?{tabIndex:0}:{},...a?{"aria-disabled":!0}:{},...p}},[z,ew,ej,ek,eS,ef,eg,eh,ey,ev,w,j,N,a]),eE=(0,r.useCallback)(e=>{e.stopPropagation()},[]),eC=(0,r.useMemo)(()=>({refKey:e="ref",onChange:t,onClick:r,...a}={})=>({accept:C,multiple:l,type:"file","aria-label":"file upload",style:{border:0,display:"block",height:0,margin:0,maxWidth:0,opacity:0,overflow:"hidden",padding:0,width:0},onChange:eN(K(t,ey)),onClick:eN(K(r,eE)),tabIndex:-1,[e]:O,...a}),[O,t,l,ey,a]);return{...B,isFocused:L&&!a,getRootProps:eA,getInputProps:eC,rootRef:z,inputRef:O,open:eN(eb)}}function ei(e,t){switch(t.type){case"focus":return{...e,isFocused:!0};case"blur":return{...e,isFocused:!1};case"openDialog":return{...er,isFileDialogActive:!0};case"closeDialog":return{...e,isFileDialogActive:!1};case"setDraggedFiles":return{...e,isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject,isDragUnknown:t.isDragUnknown,dragFileRejections:t.dragFileRejections};case"setProcessing":return{...e,isProcessing:t.isProcessing};case"setFiles":return{...e,acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,dragFileRejections:[],isProcessing:!1,isDragReject:!1,isDragUnknown:!1};case"setDragGlobal":return{...e,isDragGlobal:t.isDragGlobal};case"reset":return{...er};default:return e}}function es(){}var en=e.i(81968),el=e.i(145447);let eo={"image/*":[".jpg",".jpeg",".png",".webp",".gif",".bmp",".heic",".heif"]};function ec(e){return e&&"u">typeof navigator&&"mediaDevices"in navigator&&"getDisplayMedia"in navigator.mediaDevices}var eu=e.i(456420);let ed={name:"cloud-upload",size:24,node:[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],aliases:["upload-cloud"]};ed.node;let ep=(0,eu.f)(ed);function em({getRootProps:e,getInputProps:r,isDragActive:a,isAnalyzing:s}){let{t:n}=(0,p.b)();return(0,t.jsx)(o.N,{...e(),className:`group cursor-pointer rounded-2xl border-2 border-dashed shadow-none transition-all hover:border-primary/60 hover:bg-accent/40 ${a?"border-primary bg-accent/60":"border-border bg-card"}`,children:(0,t.jsxs)(o.O,{className:"flex min-h-[260px] flex-col items-center justify-center space-y-4 py-10 text-center md:min-h-[300px]",children:[(0,t.jsx)("input",{...r()}),(0,t.jsx)("div",{className:"rounded-2xl bg-accent p-4 text-primary transition-transform group-hover:scale-105",children:s?(0,t.jsx)(i.f,{className:"h-10 w-10 animate-spin"}):(0,t.jsx)(ep,{className:"h-10 w-10"})}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold",children:s?n.app.analyzing:n.upload.analyze}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:s?n.app.analyzing:n.app.dragDrop}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:n.upload.support})]})]})})}var ef=e.i(518515),eg=e.i(569644);let eh={name:"images",size:24,node:[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]]};eh.node;let ex=(0,eu.f)(eh);function ey({openSource:e,isAnalyzing:r}){let{t:a}=(0,p.b)(),i=[{key:"camera",icon:ef.f,label:a.upload.camera,desc:a.upload.cameraDesc},{key:"album",icon:ex,label:a.upload.album,desc:a.upload.albumDesc},{key:"file",icon:eg.f,label:a.upload.file,desc:a.upload.fileDesc}];return(0,t.jsx)("div",{className:"hidden grid-cols-3 gap-2 pointer-coarse:grid","data-testid":"image-sources",children:i.map(a=>(0,t.jsxs)(l.f,{type:"button",variant:"outline",onClick:()=>e(a.key),disabled:r,className:"flex h-auto flex-col gap-1 py-3","aria-description":a.desc,children:[(0,t.jsx)(a.icon,{className:"h-6 w-6"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a.label})]},a.key))})}function ev({cameraInput:e,albumInput:r,fileInput:a,handlePicked:i}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:e,type:"file",accept:"image/*",capture:"environment",className:"hidden",onChange:i,"data-testid":"camera-input"}),(0,t.jsx)("input",{ref:r,type:"file",accept:"image/*",className:"hidden",onChange:i,"data-testid":"album-input"}),(0,t.jsx)("input",{ref:a,type:"file",className:"hidden",onChange:i,"data-testid":"file-input"})]})}var eb=e.i(515745),ew=e.i(446513);function ej({onPaste:e,isAnalyzing:r}){let{t:a}=(0,p.b)();return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsxs)(l.f,{variant:"outline",onClick:e,disabled:r,className:"flex items-center gap-2 w-full sm:w-auto",children:[(0,t.jsx)(eb.f,{className:"h-4 w-4"}),a.upload.paste]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:a.upload.pasteDesc})]})}function ek({onScreenshot:e,isAnalyzing:r,isScreenshotting:a}){let{t:s}=(0,p.b)();return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,t.jsxs)(l.f,{variant:"outline",onClick:e,disabled:r||a,className:"flex items-center gap-2 w-full sm:w-auto",children:[a?(0,t.jsx)(i.f,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(ew.f,{className:"h-4 w-4"}),a?s.common.pleaseWait:s.upload.screenshot]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center",children:s.upload.screenshotDesc})]})}e.s(["f",0,function({onImageSelect:e,isAnalyzing:a}){let i=function({onImageSelect:e,isAnalyzing:t}){let{t:a}=(0,p.b)(),[i,s]=(0,r.useState)(!1),n=(0,el.f)();(0,r.useEffect)(()=>{"Notification"in window&&"default"===Notification.permission&&Notification.requestPermission()},[]);let{getRootProps:l,getInputProps:o,isDragActive:c}=ea({onDrop:(0,r.useCallback)(t=>{let r=t[0];r&&e(r)},[e]),accept:eo,maxFiles:1,disabled:t}),u=function(){let[e,t]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if((0,en.f)()||"u"<typeof navigator||!navigator.mediaDevices?.enumerateDevices)return;let e=!1;return navigator.mediaDevices.enumerateDevices().then(r=>{e||t(r.some(e=>"videoinput"===e.kind))}).catch(()=>void 0),()=>{e=!0}},[]),e}(),d=(0,r.useRef)(null),f=(0,r.useRef)(null),h=(0,r.useRef)(null),x=(0,r.useCallback)(t=>{let r,a;e((a=(r=t.type||"image/png").split("/")[1]||"png",t instanceof File&&t.name?t:new File([t],`clipboard-${Date.now()}.${a}`,{type:r})))},[e]);(0,r.useEffect)(()=>{let e=e=>{if(t)return;let r=function(e){let t=e.target;if(t&&(t.isContentEditable||["INPUT","TEXTAREA"].includes(t.tagName)))return null;let r=Array.from(e.clipboardData?.items??[]).find(e=>"file"===e.kind&&e.type.startsWith("image/"));return r?.getAsFile()??null}(e);r&&(e.preventDefault(),x(r))};return window.addEventListener("paste",e),()=>window.removeEventListener("paste",e)},[t,x]);let y=async()=>{if(!(n&&"u">typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.read))return void m.c.warning(a.upload.pasteNotSupported);try{for(let e of(await navigator.clipboard.read())){let t=e.types.find(e=>e.startsWith("image/"));if(t){let r=await e.getType(t);x(r);return}}m.c.warning(a.upload.pasteNoImage)}catch(e){g.V.warn("[UploadZone]","Clipboard read failed",{error:e instanceof Error?e.message:String(e)}),e instanceof Error&&"NotAllowedError"===e.name?m.c.warning(a.upload.pastePermissionDenied):m.c.error(a.upload.pasteFailed)}},v=async()=>{if(!ec(n))return void m.c.warning(a.upload.screenshotNotSupported);s(!0);try{let t;"CaptureController"in window&&(t=new window.CaptureController);let r={video:!0,audio:!1,preferCurrentTab:!1};t&&(r.controller=t);let a=await navigator.mediaDevices.getDisplayMedia(r),[i]=a.getVideoTracks(),s=i.getSettings().displaySurface;if(t&&("browser"===s||"window"===s))try{t.setFocusBehavior("no-focus-change"),g.V.info("[UploadZone]","Screenshot focus behavior set to no-change",void 0,{sendToBackend:!1})}catch(e){g.V.warn("[UploadZone]","Unable to set screenshot focus behavior",{error:e})}let n=document.createElement("video");if(n.srcObject=a,n.muted=!0,n.autoplay=!0,n.playsInline=!0,await new Promise((e,t)=>{n.onloadedmetadata=()=>{n.play().then(()=>{e()}).catch(t)},n.onerror=t}),await new Promise(e=>setTimeout(e,500)),0===n.videoWidth||0===n.videoHeight)throw Error("视频没有有效尺寸");let l=document.createElement("canvas");l.width=n.videoWidth,l.height=n.videoHeight;let o=l.getContext("2d");if(!o)throw Error("无法获取canvas上下文");o.drawImage(n,0,0),a.getTracks().forEach(e=>e.stop()),l.toBlob(t=>{t?(e(new File([t],`screenshot-${Date.now()}.png`,{type:"image/png"})),g.V.info("[UploadZone]","Screenshot captured",void 0,{sendToBackend:!1})):m.c.error("截图转换失败")},"image/png",1)}catch(e){g.V.error("[UploadZone]","Screenshot failed",{error:e}),e instanceof Error&&("NotAllowedError"===e.name?m.c.warning(a.upload.screenshotPermissionDenied):m.c.error(`${a.upload.screenshotFailed}: ${e.message}`))}finally{s(!1)}};return{t:a,isClient:n,isAnalyzing:t,isDragActive:c,isScreenshotting:i,hasCamera:u,getRootProps:l,getInputProps:o,cameraInput:d,albumInput:f,fileInput:h,handlePicked:t=>{let r=t.target.files?.[0];t.target.value="",r&&e(r)},openSource:e=>{"camera"===e&&!1===u?m.c.warning(a.upload.noCamera):({camera:d,album:f,file:h})[e].current?.click()},handleClipboardRead:y,handleScreenshot:v}}({onImageSelect:e,isAnalyzing:a});return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(ev,{cameraInput:i.cameraInput,albumInput:i.albumInput,fileInput:i.fileInput,handlePicked:i.handlePicked}),i.isClient&&(0,t.jsx)(ey,{openSource:i.openSource,isAnalyzing:i.isAnalyzing}),(0,t.jsx)(em,{getRootProps:i.getRootProps,getInputProps:i.getInputProps,isDragActive:i.isDragActive,isAnalyzing:i.isAnalyzing}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:flex-wrap items-stretch sm:items-start justify-center gap-4",children:[i.isClient&&(0,t.jsx)(ej,{onPaste:()=>{i.handleClipboardRead()},isAnalyzing:i.isAnalyzing}),i.isClient&&ec(i.isClient)&&(0,t.jsx)(ek,{onScreenshot:()=>{i.handleScreenshot()},isAnalyzing:i.isAnalyzing,isScreenshotting:i.isScreenshotting})]})]})}],798469);var eS=e.i(168148),eN=e.i(975157);let eI={reading:3,converting:6,compressing:10,uploading:20,analyzing:50,processing:85,saving:95};function eD({status:e,message:a,className:s,completed:n}){let l,{t:o}=(0,p.b)(),[c]=(0,r.useState)(()=>Date.now()),[u,d]=(0,r.useState)(0);(0,r.useEffect)(()=>{let e=setInterval(()=>{d(Math.max(0,Math.floor((Date.now()-c)/1e3)))},1e3);return()=>clearInterval(e)},[c]);let m=eI[e],f=o.common.progress.estimated.replace("{percent}",String(m));return(0,t.jsx)("div",{className:(0,eN.f)("fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",s),children:(0,t.jsx)("div",{className:"w-full max-w-md p-6 space-y-6 bg-card rounded-lg border shadow-lg mx-4",children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-4 text-center",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.f,{className:"h-12 w-12 animate-spin text-primary"}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center"})]}),(0,t.jsxs)("div",{className:"space-y-2 w-full",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold tracking-tight","aria-live":"polite",children:a||o.common.progress[e]}),(0,t.jsx)(eS.f,{value:m,"aria-label":f,"aria-valuetext":f,className:"h-2 w-full"})]}),(0,t.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 text-sm text-muted-foreground tabular-nums",children:[(0,t.jsx)("span",{children:f}),(0,t.jsx)("span",{role:"timer","aria-live":"off",children:o.common.progress.elapsed.replace("{time}",(l=[Math.floor(u/60)%60,u%60],u>=3600&&l.unshift(Math.floor(u/3600)),l.map(e=>String(e).padStart(2,"0")).join(":")))})]}),n&&n.length>0&&(0,t.jsx)("ul",{className:"flex w-full flex-wrap justify-center gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","data-testid":"progress-stages",children:n.map(e=>{var r;return(0,t.jsxs)("li",{children:[e.label," ",(r=e.ms)<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(1)}s`]},e.label)})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.common.progress.estimateHint})]})})})}e.s(["f",0,function({status:e,message:r,className:a,completed:i}){return(0,el.f)()&&"idle"!==e?(0,t.jsx)(eD,{status:e,message:r,className:a,completed:i}):null}],956738);var eT=e.i(618566),eA=e.i(767077),eE=e.i(119472),eC=e.i(127175),eF=e.i(213761),eP=e.i(499930),eR=e.i(991722);function ez(e){return e.fixedSubjectId??(e.confirmBeforeImport?null:e.importSubjectId??null)}function eO(e,t){return[{label:t.upload.stages.read,ms:e.read??0},...void 0!==e.convert?[{label:t.upload.stages.convert,ms:e.convert}]:[],...void 0!==e.compress?[{label:t.upload.stages.compress,ms:(e.crop??0)+e.compress}]:[]]}async function eB(e,t){let r=[];for(let a of t){let t=await (0,eF.X)(e,a);r.push({dataUrl:t.dataUrl,info:(0,eF.N)(e,t),timings:{...e.timings,...t.timings}})}return r}function eM(e,t){let r=t=>e.reduce((e,r)=>e+r.timings[t],0);return{dataUrl:t.dataUrl,info:{sourceType:`stacked-${e.length}`,sourceBytes:e.reduce((e,t)=>e+(t.info.sourceBytes??0),0),outputWidth:t.width,outputHeight:t.height,outputBytes:t.bytes,quality:t.quality},timings:{read:r("read"),convert:r("convert"),crop:r("crop")+t.timings.crop,compress:r("compress")+t.timings.compress}}}function eL(e,t){return{imageBase64:e.dataUrl,language:t.language,subjectId:t.analyzeSubjectId,targetSubjectId:ez(t),clientTimings:e.timings,imageInfo:e.info}}function eU(e,t){return{source:"image",imageBase64:e.dataUrl,imageInfo:e.info,language:t.language,subjectId:t.analyzeSubjectId,targetSubjectId:ez(t)}}e.s(["u",0,4,"m",0,eL,"w",0,eU,"c",0,eO,"b",0,function(e,t){return{source:"text",splitter:e.splitter,forceNumbered:e.forceNumbered||void 0,text:e.text,language:e.language,subjectId:e.analyzeSubjectId??e.textNotebookId,targetSubjectId:ez(t)}},"G",0,function({questionText:e,language:t,textNotebook:r}){return{questionText:e,language:t,forImport:!0,subject:r?.name,subjectId:r?.id}},"d",0,function(e,t){return{questionText:t,answerText:e.answerText,analysis:e.analysis,knowledgePoints:e.knowledgePoints||[],wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:(0,eR.h)(e.mistakeStatus),subject:e.subject||"其他",requiresImage:!1,difficultyStars:e.difficultyStars??null,questionType:e.questionType??null,gradeSemester:e.gradeSemester??null}},"l",0,eB,"H",0,eM],315092),e.s(["f",0,function(e){let{logPrefix:t,t:a,language:i,analyzeSubjectId:s,fixedSubjectId:n,confirmBeforeImport:l,importSubjectId:o}=e,c=(0,eT.useRouter)(),[u,d]=(0,r.useState)(null),[p,f]=(0,r.useState)(!1),[x,y]=(0,r.useState)(null),[v,b]=(0,r.useState)([]),[w,j]=(0,r.useState)([]),k=(0,r.useRef)(null);(0,r.useEffect)(()=>()=>k.current?.dispose(),[]);let S={fixedSubjectId:n,confirmBeforeImport:l,importSubjectId:o},N=async r=>{e.clearLastImported(),e.clearSaveError(),j([]),e.setAnalysisStep("reading");try{let a=await (0,eF.p)(r,()=>e.setAnalysisStep("converting"));k.current?.dispose(),k.current=a,g.V.info(t,"Image decoded",{format:a.format,sourceType:a.sourceType,sourceBytes:a.sourceBytes,width:a.width,height:a.height,decoder:a.decoder,...a.timings}),d(a.previewUrl),f(!0)}catch(i){let e=i instanceof eF.o?a.upload.decodeErrors[i.code].replace("{format}",i.format.toUpperCase()):(0,h.Z)(i);g.V.warn(t,"Image decode failed",{code:i instanceof eF.o?i.code:"UNKNOWN",format:i instanceof eF.o?i.format:"unknown",sourceType:r.type,sourceBytes:r.size}),m.c.error(e)}finally{e.setAnalysisStep("idle")}},I=async r=>{let n=Date.now();j(eO(r.timings,a));try{e.setAnalysisStep("uploading");let a=await (0,eC.S)(eL(r,{...S,language:i,analyzeSubjectId:s})),l=Date.now()-n;g.V.info(t,"Import task created",{taskId:a.id,...r.info,...r.timings,uploadMs:l}),e.setPendingTaskId(a.id),e.setTask(a)}catch(e){g.V.error(t,"Upload failed",{errorDuration:Date.now()-n,error:(0,h.Z)(e)}),m.c.error((0,eA.f)(e,a))}finally{e.setAnalysisStep("idle"),j([])}},D=async r=>{let i;e.setAnalysisStep("compressing");try{let e=await (0,eP.v)(r.map(e=>e.dataUrl));i=eM(r,e)}catch(i){g.V.error(t,"Stack parts failed",{parts:r.length,error:(0,h.Z)(i)}),m.c.error((0,eA.f)(i,a)),e.setAnalysisStep("idle");return}g.V.info(t,"Question parts stacked",{parts:r.length,width:i.info.outputWidth,height:i.info.outputHeight}),b([]),await I(i)},T=async r=>{let i=k.current;if(i&&!(v.length>=3)){f(!1),e.setAnalysisStep("compressing");try{let[e]=await eB(i,[r]);b(t=>[...t,e]),m.c.info(a.upload.parts.added.replace("{n}",String(v.length+1)))}catch(e){g.V.error(t,"Crop part failed",{error:(0,h.Z)(e)}),m.c.error((0,eA.f)(e,a))}finally{e.setAnalysisStep("idle")}}},A=async(r,i)=>{let s,n=k.current;if(n&&0!==r.length){f(!1),j(eO(n.timings,a)),e.setAnalysisStep("compressing");try{s=await eB(n,r)}catch(r){g.V.error(t,"Crop failed",{error:(0,h.Z)(r)}),m.c.error((0,eA.f)(r,a)),e.setAnalysisStep("idle");return}if(i){e.setAnalysisStep("idle"),j([]),e.clearLastImported(),e.clearSaveError(),y(s);return}if(v.length>0)return void await D([...v,s[0]]);await I(s[0])}},E=async r=>{let n=k.current;if(n){f(!1),j(eO(n.timings,a)),e.setAnalysisStep("compressing");try{let[l]=await eB(n,[r]);j(eO(l.timings,a)),e.setAnalysisStep("uploading");let o=await (0,eE.v)(eU(l,{...S,language:i,analyzeSubjectId:s}));g.V.info(t,"Image batch created",{batchId:o.id,...l.info}),c.push(`/import-batches/${o.id}`)}catch(e){g.V.error(t,"Image batch failed",{error:(0,h.Z)(e)}),m.c.error((0,eA.f)(e,a))}finally{e.setAnalysisStep("idle"),j([])}}};return{croppingImage:u,isCropperOpen:p,setIsCropperOpen:f,batchImages:x,setBatchImages:y,parts:v,setParts:b,completedStages:w,preparedRef:k,selectImage:N,cropRegions:A,addPart:T,uploadImage:I,uploadParts:D,autoSplitImage:E,finishParts:()=>D(v),discardParts:()=>b([]),closeBatch:()=>y(null),closeCropper:()=>f(!1)}}],610554)},598053,e=>{var t=e.i(271645),r=e.i(41931),a=e.i(201276),i=e.i(25197),s=e.i(111110),n=e.i(610554),l=e.i(618566),o=e.i(767077),c=e.i(303163),u=e.i(294114),d=e.i(119472),p=e.i(682638),m=e.i(825624),f=e.i(315092),g=e.i(901219),h=e.i(183444);e.s(["f",0,function({logPrefix:e,analyzeSubjectId:x,importSubjectId:y,textNotebook:v,fixedSubjectId:b}){let{t:w,language:j}=(0,s.b)(),k=(0,h.f)(e),[S,N]=(0,t.useState)("idle"),[I,D]=(0,t.useState)(null),[T,A]=(0,t.useState)(!1),[E,C]=(0,t.useState)(null),F=(0,g.a)(E),P=I?.timeouts?.analyze||18e4,R=P+1e4,z=function(e){let{logPrefix:s,t:n,language:g,analyzeSubjectId:h,importSubjectId:x,textNotebook:y,fixedSubjectId:v,confirmBeforeImport:b,aiTimeout:w}=e,j=(0,l.useRouter)(),[k,S]=(0,t.useState)(!1),[N,I]=(0,t.useState)("upload"),[D,T]=(0,t.useState)(null),[A,E]=(0,t.useState)(null),[C,F]=(0,t.useState)(null),P={fixedSubjectId:v,confirmBeforeImport:b,importSubjectId:x},R=async t=>{if(!b){e.setAnalysisStep("saving");let r=await (0,i.a)(t,{subjectId:x,imageUrl:null});F(r),E(null),a.V.info(s,"Imported without review",{id:r.id});return}E(null),T(t),I("review")};return{step:N,setStep:I,cancelReview:()=>{I("upload"),e.clearSaveError()},parsedData:D,setParsedData:T,currentImage:A,setCurrentImage:E,lastImported:C,dismissImported:()=>F(null),creatingBatch:k,submitText:async t=>{e.clearSaveError();let i=Date.now();a.V.info(s,"Starting text-based analysis",{textLength:t.length});try{e.setAnalysisStep("analyzing");let n=await r.k.post("/api/reanswer",(0,f.G)({questionText:t,language:g,textNotebook:y}),{timeout:w,recoverable:!0});e.setAnalysisStep("processing"),await R((0,f.d)(n,t)),a.V.info(s,"Text analysis completed",{totalDuration:Date.now()-i})}catch(e){a.V.error(s,"Text analysis failed",{errorDuration:Date.now()-i,error:(0,c.Z)(e)}),u.c.error((0,o.f)(e,n))}finally{e.setAnalysisStep("idle")}},createTextBatch:async(t,r,i=!1)=>{e.clearSaveError(),S(!0);try{if("local"===r){let e=(0,m.J)(t,{forceNumbered:i});if((0,p.X)(e)){let r;a.V.info(s,"Auto-splitting long text",{candidateCount:e.candidateCount,overflow:e.overflow,tooLong:e.tooLong});try{r=(0,p.U)(t,{forceNumbered:i})}catch(e){a.V.error(s,"Auto-split failed",{error:(0,c.Z)(e)}),u.c.error((0,c.Z)(e));return}let{batches:l,failures:o}=await (0,p.r)(r,{language:g,subjectId:h??y?.id,targetSubjectId:P.fixedSubjectId??(P.confirmBeforeImport?null:P.importSubjectId??null)});for(let e of(a.V.info(s,"Auto-split batches created",{count:l.length,failures:o.length}),l.length>0&&(u.c.success(n.app.autoSplitHint.replace("{count}",String(l.length)).replace("{max}",String(m.S))),j.push(`/import-batches/${l[0].id}`)),o))u.c.error(n.app.autoSplitFailed.replace("{index}",String(e.index+1)).replace("{error}",(0,c.Z)(e.error)));return}}let e=await (0,d.v)((0,f.b)({text:t,splitter:r,forceNumbered:i,language:g,analyzeSubjectId:h,textNotebookId:y?.id},P));a.V.info(s,"Text batch created",{batchId:e.id,splitter:r,questions:e.itemCount}),j.push(`/import-batches/${e.id}`)}catch(e){a.V.error(s,"Text batch failed",{error:(0,c.Z)(e)}),u.c.error((0,o.f)(e,n))}finally{S(!1)}}}}({logPrefix:e,t:w,language:j,analyzeSubjectId:x,importSubjectId:y,textNotebook:v,fixedSubjectId:b,confirmBeforeImport:T,aiTimeout:P,setAnalysisStep:N,clearSaveError:()=>k.setSaveError(null)}),O=(0,n.f)({logPrefix:e,t:w,language:j,analyzeSubjectId:x,fixedSubjectId:b,confirmBeforeImport:T,importSubjectId:y,setAnalysisStep:N,setPendingTaskId:C,setTask:F.setTask,clearLastImported:z.dismissImported,clearSaveError:()=>k.setSaveError(null)});(0,t.useEffect)(()=>{(0,i.x)().then(A),r.k.get("/api/settings").then(D).catch(t=>a.V.error(e,"Failed to fetch config",{error:t}))},[e]),(0,t.useEffect)(()=>{if("idle"===S)return;let e=setTimeout(()=>{a.V.warn("[Progress]","处理超时,关闭进度提示",{analysisStep:S,safetyTimeout:R}),N("idle")},R);return()=>clearTimeout(e)},[S,R]);let B=e=>k.run(()=>r.k.post("/api/error-items",e),e.subjectId),M=async e=>{await B({...e,originalImageUrl:z.currentImage||"",...b?{subjectId:b}:{}})&&(z.setStep("upload"),z.setParsedData(null),z.setCurrentImage(null))};return{step:z.step,cancelReview:z.cancelReview,saveError:k.saveError,dismissSaveError:k.dismissSaveError,analysisStep:S,setAnalysisStep:N,isBusy:"idle"!==S,parsedData:z.parsedData,currentImage:z.currentImage,aiTimeout:P,croppingImage:O.croppingImage,isCropperOpen:O.isCropperOpen,closeCropper:O.closeCropper,lastImported:z.lastImported,dismissImported:z.dismissImported,batchImages:O.batchImages,closeBatch:O.closeBatch,completedStages:O.completedStages,pendingTask:E?F.task:null,refreshPendingTask:F.refresh,dismissPendingTask:()=>C(null),selectImage:O.selectImage,cropRegions:O.cropRegions,submitText:z.submitText,saveQuestion:B,saveReviewed:M,createTextBatch:z.createTextBatch,autoSplitImage:O.autoSplitImage,creatingBatch:z.creatingBatch,parts:O.parts,addPart:O.addPart,finishParts:O.finishParts,discardParts:O.discardParts}}],598053)},682638,e=>{var t=e.i(825624),r=e.i(119472);let a=t.k;function i(e){let t=e=>e?.trim()?e.trim().slice(0,2e4):void 0;return{text:e.text,material:t(e.material),section:e.section?.trim()?e.section.trim().slice(0,500):void 0,label:e.label?.trim()?e.label.trim().slice(0,20):void 0,answer:t(e.answer),analysis:t(e.analysis),knowledgePoints:e.knowledgePoints?.length?e.knowledgePoints.slice(0,100):void 0,difficultyStars:e.difficultyStars??void 0,wrongAnswer:t(e.wrongAnswer),questionType:e.questionType?.trim()?e.questionType.trim().slice(0,100):void 0,image:e.image??void 0}}async function s(e,s){if(0===e.length)throw Error("STRUCTURED_ITEMS_EMPTY");if(e.length>a)throw Error("STRUCTURED_ITEMS_TOO_MANY");let n=s.clientRequestIdPrefix??`sb-${Math.random().toString(36).slice(2,10)}`,l=function(e,r=t.S,a=8388608){let i=[],s=[],n=0;for(let t of e){let e=t.image?.length??0;s.length>0&&(s.length>=r||n+e>a)&&(i.push(s),s=[],n=0),s.push(t),n+=e}return s.length>0&&i.push(s),i}(e),o=[],c=[];for(let e=0;e<l.length;e++){let t=l[e],a={source:"text",splitter:"local",items:t.map(i),language:s.language,subjectId:s.subjectId??void 0,targetSubjectId:s.targetSubjectId??void 0,paperLevel:s.paperLevel??void 0};0===e&&s.origin&&(a.origin=s.origin);try{let t=await (0,r.v)(a,`${n}-${e}`);o.push(t)}catch(r){c.push({index:e,items:t,error:r})}}return{batches:o,clientRequestIdPrefix:n,failures:c}}e.s(["e",0,a,"r",0,s,"X",0,function(e){return e.candidateCount>t.S||e.overflow>0||e.tooLong},"U",0,function(e,r={}){if(e.length>t.f)throw Error("TEXT_TOO_LONG_FOR_AUTO_SPLIT");let a=(0,t.J)(e,{forceNumbered:r.forceNumbered,maxLength:t.f,maxQuestions:t.k});if(a.tooLong)throw Error("TEXT_TOO_LONG_FOR_AUTO_SPLIT");if(a.overflow>0)throw Error("TOO_MANY_QUESTIONS_FOR_AUTO_SPLIT");return a.questions.map(e=>({text:e.text,material:e.material??null,section:e.section??null,label:e.label??null,answer:e.answer??null,analysis:e.analysis??null,knowledgePoints:e.knowledgePoints??null,difficultyStars:e.difficultyStars??null,wrongAnswer:e.wrongAnswer??null,questionType:e.questionType??null}))}])}])})();
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const client_1 = require("@prisma/client");
|
|
8
8
|
const data_1 = require("../src/lib/tags/data");
|
|
9
9
|
const rebuild_1 = require("../src/lib/tags/seed/rebuild");
|
|
10
|
+
const university_grades_1 = require("../src/lib/tags/seed/university-grades");
|
|
10
11
|
const prisma = new client_1.PrismaClient();
|
|
11
12
|
async function main() {
|
|
12
13
|
console.log('[RebuildTags] Starting automatic system tag rebuild...');
|
|
@@ -65,6 +66,8 @@ async function main() {
|
|
|
65
66
|
// Politics
|
|
66
67
|
await tx.knowledgeTag.deleteMany({ where: { isSystem: true, subject: 'politics' } });
|
|
67
68
|
totalCreated += await (0, rebuild_1.seedStandardSubject)(tx, 'politics', data_1.POLITICS_CURRICULUM, data_1.POLITICS_GRADE_ORDER);
|
|
69
|
+
// 大学:只有年级根节点,知识点由 AI 在错题本内生成
|
|
70
|
+
totalCreated += await (0, university_grades_1.seedUniversityGrades)(tx);
|
|
68
71
|
console.log(`[RebuildTags] Created ${totalCreated} tags`);
|
|
69
72
|
// ========== STEP 3: 恢复关联关系 ==========
|
|
70
73
|
console.log('[RebuildTags] Step 3: Restoring associations...');
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* 增量补齐大学年级根节点(大一 ~ 大四),不删除或改动已有标签。
|
|
5
|
+
* 已有安装(PRESERVE_EXISTING_DATA=true)不会重建系统标签,靠本脚本补上年级节点。
|
|
6
|
+
* 源码运行:npx ts-node --compiler-options '{"module":"CommonJS"}' scripts/seed-university-grades.ts
|
|
7
|
+
* Docker 和安装包运行:node dist-scripts/scripts/seed-university-grades.js
|
|
8
|
+
*/
|
|
9
|
+
const client_1 = require("@prisma/client");
|
|
10
|
+
const error_message_1 = require("../src/lib/error-message");
|
|
11
|
+
const logger_1 = require("../src/lib/logger");
|
|
12
|
+
const university_grades_1 = require("../src/lib/tags/seed/university-grades");
|
|
13
|
+
const logger = (0, logger_1.createLogger)('seed-university-grades');
|
|
14
|
+
async function main() {
|
|
15
|
+
const prisma = new client_1.PrismaClient();
|
|
16
|
+
try {
|
|
17
|
+
const created = await prisma.$transaction((tx) => (0, university_grades_1.seedUniversityGrades)(tx), { timeout: 120000 });
|
|
18
|
+
logger.info({ created }, '大学年级节点同步完成');
|
|
19
|
+
}
|
|
20
|
+
finally {
|
|
21
|
+
await prisma.$disconnect();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
main().catch((error) => {
|
|
25
|
+
logger.error({ error: (0, error_message_1.getErrorMessage)(error) }, '大学年级节点同步失败');
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 大学学段的年级根节点。
|
|
4
|
+
*
|
|
5
|
+
* 大学没有内置课程知识点:只建「大一 ~ 大四」四个年级根节点,知识点由 AI 在错题本内
|
|
6
|
+
* 自由生成后挂在对应年级下(见 src/lib/tags/retag.ts 与 src/lib/ai/prompts)。
|
|
7
|
+
*
|
|
8
|
+
* 本文件不导入任何模块:Docker 与安装包构建时用 tsc 单独编译种子脚本,不读取路径别名。
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.UNIVERSITY_SUBJECTS = exports.UNIVERSITY_GRADES = void 0;
|
|
12
|
+
/** 大学年级节点名,与 src/lib/grade-options.ts 的 GRADE_NAMES 尾部一致 */
|
|
13
|
+
exports.UNIVERSITY_GRADES = ['大一', '大二', '大三', '大四'];
|
|
14
|
+
/** 可创建大学错题本的学科,与 NOTEBOOK_SUBJECTS 一致(单测保证不漂移) */
|
|
15
|
+
exports.UNIVERSITY_SUBJECTS = [
|
|
16
|
+
'math', 'english', 'chinese', 'physics', 'chemistry', 'biology', 'history', 'geography', 'politics',
|
|
17
|
+
];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.seedUniversityGrades = seedUniversityGrades;
|
|
4
|
+
// Docker 与安装包构建时用 tsc 单独编译种子脚本(不读取 tsconfig 路径别名),本文件及其依赖只能用相对路径导入
|
|
5
|
+
const university_1 = require("../data/university");
|
|
6
|
+
/**
|
|
7
|
+
* 增量补齐各学科的大学年级根节点(大一 ~ 大四),不建章节点和知识点。
|
|
8
|
+
* 保留已有节点与题目关联;重复执行不会重复创建。
|
|
9
|
+
*/
|
|
10
|
+
async function seedUniversityGrades(tx, subjects = university_1.UNIVERSITY_SUBJECTS) {
|
|
11
|
+
let created = 0;
|
|
12
|
+
for (const subject of subjects) {
|
|
13
|
+
for (const [index, name] of university_1.UNIVERSITY_GRADES.entries()) {
|
|
14
|
+
const existing = await tx.knowledgeTag.findFirst({
|
|
15
|
+
where: { subject, name, parentId: null, isSystem: true, userId: null, tagSet: 'default' },
|
|
16
|
+
select: { id: true, order: true },
|
|
17
|
+
});
|
|
18
|
+
const order = 13 + index;
|
|
19
|
+
if (existing) {
|
|
20
|
+
if (existing.order !== order) {
|
|
21
|
+
await tx.knowledgeTag.update({ where: { id: existing.id }, data: { order } });
|
|
22
|
+
}
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
await tx.knowledgeTag.create({
|
|
26
|
+
data: { name, subject, parentId: null, isSystem: true, tagSet: 'default', order },
|
|
27
|
+
});
|
|
28
|
+
created++;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return created;
|
|
32
|
+
}
|
package/launcher.js
CHANGED
|
@@ -184,14 +184,17 @@ function prepare(options = {}) {
|
|
|
184
184
|
if (!runPrisma(['migrate', 'deploy', '--schema', path.join(APP_DIR, 'prisma', 'schema.prisma')], env)) {
|
|
185
185
|
throw new Error('数据库迁移失败,已停止启动');
|
|
186
186
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
187
|
+
// 增量补齐语文课程与大学年级根节点,保留已有标签和题目关联
|
|
188
|
+
for (const script of ['seed-chinese-primary.js', 'seed-university-grades.js']) {
|
|
189
|
+
const seeded = spawnSync(process.execPath, [path.join(APP_DIR, 'dist-scripts', 'scripts', script)], {
|
|
190
|
+
cwd: APP_DIR,
|
|
191
|
+
env,
|
|
192
|
+
stdio: 'inherit',
|
|
193
|
+
windowsHide: true,
|
|
194
|
+
});
|
|
195
|
+
if (seeded.error) throw seeded.error;
|
|
196
|
+
if (seeded.status !== 0) throw new Error(`${script} 执行失败,已停止启动`);
|
|
197
|
+
}
|
|
195
198
|
return { dataDir, dbFile, env, version };
|
|
196
199
|
}
|
|
197
200
|
|