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
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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 i=(0,t.f)(n);e.s(["f",0,i],328623)},232660,e=>{var t=e.i(271645),n={x:0,y:0,width:0,height:0,unit:"px"},i=(e,t,n)=>Math.min(Math.max(e,t),n),r=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function a(e,t,i){return"%"===e.unit?{...n,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/i*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/i*100:0}}function l(e,t,i){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*i/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*i/100:0}:{...n,...e,unit:"px"}}function o(e,t,n,i,r,a=0,l=0,s=i,h=r){let c={...e},u=Math.min(a,i),d=Math.min(l,r),m=Math.min(s,i),g=Math.min(h,r);t&&(t>1?(d=(u=l?l*t:u)/t,m=s*t):(u=(d=a?a/t:d)*t,g=h/t)),c.y<0&&(c.height=Math.max(c.height+c.y,d),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,u),c.x=0);let p=i-(c.x+c.width);p<0&&(c.x=Math.min(c.x,i-u),c.width+=p);let f=r-(c.y+c.height);if(f<0&&(c.y=Math.min(c.y,r-d),c.height+=f),c.width<u&&(("sw"===n||"nw"==n)&&(c.x-=u-c.width),c.width=u),c.height<d&&(("nw"===n||"ne"==n)&&(c.y-=d-c.height),c.height=d),c.width>m&&(("sw"===n||"nw"==n)&&(c.x-=m-c.width),c.width=m),c.height>g&&(("nw"===n||"ne"==n)&&(c.y-=g-c.height),c.height=g),t){let e=c.width/c.height;if(e<t){let e=Math.max(c.width/t,d);("nw"===n||"ne"==n)&&(c.y-=e-c.height),c.height=e}else if(e>t){let e=Math.max(c.height*t,u);("sw"===n||"nw"==n)&&(c.x-=e-c.width),c.width=e}}return c}var s={capture:!0,passive:!1},h=0,c=class e extends t.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,t.createRef)();mediaRef=(0,t.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${h++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:n,width:i,height:r}=e.getBoundingClientRect();return{x:t,y:n,width:i,height:r}}componentDidUpdate(e){let{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){let{width:e,height:i}=this.getBox();e&&i&&n(l(t,e,i),a(t,e,i))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,s),this.document.addEventListener("pointerup",this.onDocPointerDone,s),this.document.addEventListener("pointercancel",this.onDocPointerDone,s),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,s),this.document.removeEventListener("pointerup",this.onDocPointerDone,s),this.document.removeEventListener("pointercancel",this.onDocPointerDone,s),!1)}onCropPointerDown=e=>{let{crop:t,disabled:n}=this.props,i=this.getBox();if(!t)return;let r=l(t,i.width,i.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,o=e.clientX,s=e.clientY,h=r.x,c=r.y;if(a){let t=e.clientX-i.x,n=e.clientY-i.y,l=0,u=0;"ne"===a||"e"==a?(l=t-(r.x+r.width),u=n-r.y,h=r.x,c=r.y+r.height):"se"===a||"s"===a?(l=t-(r.x+r.width),u=n-(r.y+r.height),h=r.x,c=r.y):"sw"===a||"w"==a?(l=t-r.x,u=n-(r.y+r.height),h=r.x+r.width,c=r.y):("nw"===a||"n"==a)&&(l=t-r.x,u=n-r.y,h=r.x+r.width,c=r.y+r.height),o=h+i.x+l,s=c+i.y+u}this.evData={startClientX:o,startClientY:s,startCropX:h,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:n,locked:i,keepSelection:r,onChange:o}=this.props,s=this.getBox();if(n||i||r&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let h=e.clientX-s.x,c=e.clientY-s.y,u={unit:"px",x:h,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:h,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,o(l(u,s.width,s.height),a(u,s.width,s.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:n,disabled:i,onChange:o,onDragStart:s}=this.props,h=this.getBox();if(i||!n||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,s&&s(e));let{evData:c}=this;c.clientX=e.clientX,c.clientY=e.clientY,r(n,t=c.isResize?this.resizeCrop():this.dragCrop())||o(l(t,h.width,h.height),a(t,h.width,h.height))};onComponentKeyDown=t=>{let{crop:n,disabled:r,onChange:o,onComplete:s}=this.props;if(r)return;let h=t.key,c=!1;if(!n)return;let u=this.getBox(),d=this.makePixelCrop(u),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===h?(d.x-=m,c=!0):"ArrowRight"===h?(d.x+=m,c=!0):"ArrowUp"===h?(d.y-=m,c=!0):"ArrowDown"===h&&(d.y+=m,c=!0),c){t.cancelable&&t.preventDefault(),d.x=i(d.x,0,u.width-d.width),d.y=i(d.y,0,u.height-d.height);let e=l(d,u.width,u.height),n=a(d,u.width,u.height);o(e,n),s&&s(e,n)}};onHandlerKeyDown=(t,n)=>{var i,s;let h,{aspect:c=0,crop:u,disabled:d,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(d||!u||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=o((i=l(u,y.width,y.height),s=t.key,h={...i},"ArrowLeft"===s?"nw"===n?(h.x-=b,h.y-=b,h.width+=b,h.height+=b):"w"===n?(h.x-=b,h.width+=b):"sw"===n?(h.x-=b,h.width+=b,h.height+=b):"ne"===n?(h.y+=b,h.width-=b,h.height-=b):"e"===n?h.width-=b:"se"===n&&(h.width-=b,h.height-=b):"ArrowRight"===s&&("nw"===n?(h.x+=b,h.y+=b,h.width-=b,h.height-=b):"w"===n?(h.x+=b,h.width-=b):"sw"===n?(h.x+=b,h.width-=b,h.height-=b):"ne"===n?(h.y-=b,h.width+=b,h.height+=b):"e"===n?h.width+=b:"se"===n&&(h.width+=b,h.height+=b)),"ArrowUp"===s?"nw"===n?(h.x-=b,h.y-=b,h.width+=b,h.height+=b):"n"===n?(h.y-=b,h.height+=b):"ne"===n?(h.y-=b,h.width+=b,h.height+=b):"sw"===n?(h.x+=b,h.width-=b,h.height-=b):"s"===n?h.height-=b:"se"===n&&(h.width-=b,h.height-=b):"ArrowDown"===s&&("nw"===n?(h.x+=b,h.y+=b,h.width-=b,h.height-=b):"n"===n?(h.y+=b,h.height-=b):"ne"===n?(h.y+=b,h.width-=b,h.height-=b):"sw"===n?(h.x-=b,h.width+=b,h.height+=b):"s"===n?h.height+=b:"se"===n&&(h.width+=b,h.height+=b)),h),c,n,y.width,y.height,m,g,p,f);if(!r(u,v)){let e=a(v,y.width,y.height);w(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:n,onComplete:i,onDragEnd:r}=this.props,o=this.getBox();this.unbindDocMove(),!(n||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,r&&r(e),i&&i(l(t,o.width,o.height),a(t,o.width,o.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),n=this.makePixelCrop(t),r=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return n.x=i(e.startCropX+r,0,t.width-n.width),n.y=i(e.startCropY+a,0,t.height-n.height),n}getPointRegion(e,t,n,i){let{evData:r}=this,a=r.clientX-e.x,l=r.clientY-e.y,o;return o=i&&t?"nw"===t||"n"===t||"ne"===t:l<r.startCropY,(n&&t?"nw"===t||"w"===t||"sw"===t:a<r.startCropX)?o?"nw":"sw":o?"ne":"se"}resolveMinDimensions(e,t,n=0,i=0){let r=Math.min(n,e.width),a=Math.min(i,e.height);return t&&(r||a)?t>1?r?[r,r/t]:[a*t,a]:a?[a*t,a]:[r,r/t]:[r,a]}resizeCrop(){let{evData:t}=this,{aspect:n=0,maxWidth:r,maxHeight:a}=this.props,l=this.getBox(),[s,h]=this.resolveMinDimensions(l,n,this.props.minWidth,this.props.minHeight),c=this.makePixelCrop(l),u=this.getPointRegion(l,t.ord,s,h),d=t.ord||u,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(s&&"nw"===d||"w"===d||"sw"===d)&&(m=Math.min(m,-s)),(h&&"nw"===d||"n"===d||"ne"===d)&&(g=Math.min(g,-h));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===u?(p.x=t.startCropX,p.width=m,n?p.height=p.width/n:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===u?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,n?p.height=p.width/n:p.height=g):"sw"===u?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),n?p.height=p.width/n:p.height=g):"nw"===u&&(p.x=t.startCropX+m,p.width=Math.abs(m),n?(p.height=p.width/n,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=o(p,n,u,l.width,l.height,s,h,r,a);return n||e.xyOrds.indexOf(d)>-1?c=f:e.xOrds.indexOf(d)>-1?(c.x=f.x,c.width=f.width):e.yOrds.indexOf(d)>-1&&(c.y=f.y,c.height=f.height),c.x=i(c.x,0,l.width-c.width),c.y=i(c.y,0,l.height-c.height),c}renderCropSelection(){let{ariaLabels:n=e.defaultProps.ariaLabels,disabled:i,locked:r,renderSelectionAddon:a,ruleOfThirds:l,crop:o}=this.props,s=this.getCropStyle();if(o)return t.default.createElement("div",{style:s,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":n.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!i&&!r&&t.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},t.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":n.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":n.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":n.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":n.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":n.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":n.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":n.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":n.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&t.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),l&&t.default.createElement(t.default.Fragment,null,t.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),t.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return l({...n,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:n,circularCrop:i,className:r,crop:a,disabled:l,locked:o,style:s,ruleOfThirds:h}=this.props,{cropIsActive:c,newCropIsBeingDrawn:u}=this.state,d=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",r,c&&"ReactCrop--active",l&&"ReactCrop--disabled",o&&"ReactCrop--locked",u&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&i&&"ReactCrop--circular-crop",a&&h&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",i&&"ReactCrop--no-animate");return t.default.createElement("div",{ref:this.componentRef,className:m,style:s},t.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},n),a?t.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},t.default.createElement("defs",null,t.default.createElement("mask",{id:`hole-${this.instanceId}`},t.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),i?t.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):t.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),t.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,d)}};e.s(["f",0,c])},12130,271945,e=>{var t=e.i(843476),n=e.i(271645),i=e.i(232660),r=e.i(519455),a=e.i(776639),l=e.i(263676),o=e.i(111110);async function s(e,t){let{naturalWidth:n,naturalHeight:i}=e;return Promise.all(t.map(t=>new Promise((r,a)=>{let l=document.createElement("canvas"),o=Math.round(t.x*n),s=Math.round(t.y*i);l.width=Math.max(1,Math.round(t.width*n)),l.height=Math.max(1,Math.round(t.height*i));let h=l.getContext("2d");h?(h.drawImage(e,o,s,l.width,l.height,0,0,l.width,l.height),l.toBlob(e=>e?r(e):a(Error("Canvas is empty")),"image/jpeg",.95)):a(Error("Canvas is not supported"))})))}let h={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},c=(0,n.forwardRef)(function({imageSrc:e,regions:i,onChange:r,imageStyle:a=h,onImageLoad:s},c){let{t:u}=(0,o.b)(),d=(0,n.useRef)(null),m=(0,n.useRef)(null),[g,p]=(0,n.useState)(null),f=e=>{let t=d.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},w=()=>{g&&g.width>=.02&&g.height>=.02&&r([...i,g]),m.current=null,p(null)},x=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:c,src:e,alt:"",draggable:!1,style:a,onLoad:s,className:"block"}),(0,t.jsxs)("div",{ref:d,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(d.current?.setPointerCapture(e.pointerId),m.current=f(e),p(null))},onPointerMove:e=>{var t,n,i,r;let a,l,o;if(!m.current)return;let s=f(e);p((t=m.current.x,n=m.current.y,i=s.x,r=s.y,l=(a=e=>Math.min(1,Math.max(0,e)))(Math.min(t,i)),o=a(Math.min(n,r)),{x:l,y:o,width:a(Math.max(t,i))-l,height:a(Math.max(n,r))-o}))},onPointerUp:w,onPointerCancel:w,children:[i.map((e,n)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:x(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:n+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":u.batchImport.removeRegion.replace("{index}",String(n+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>r(i.filter((e,t)=>t!==n)),children:(0,t.jsx)(l.X,{className:"h-3 w-3"})})]},n)),g&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:x(g)})]})]})});var u=e.i(456420);let d={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};d.node;let m=(0,u.f)(d),g={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};g.node;let p=(0,u.f)(g);function f({zoom:e,onZoomIn:n,onZoomOut:i,onReset:r}){let{t:a}=(0,o.b)(),l="outline-none focus-visible:ring-2 focus-visible:ring-white/70",s=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${l}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:s,onClick:i,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${l}`,onClick:r,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:s,onClick:n,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(m,{className:"h-4 w-4"})})]})}var w=e.i(201276),x=e.i(804536);let y="image-cropper-mode",b=["single","auto","multi"];e.s(["U",0,b,"p",0,y,"S",0,["image","text","file","direct"],"c",0,"question-input-mode","k",0,["image","text"]],271945);let v={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}};e.s(["f",0,function({imageSrc:e,open:l,onClose:h,onCropComplete:u,onMultiCropComplete:d,onRegionsSelected:m,allowMulti:g=!0,onAutoSplit:p,onAddPart:C,partCount:k=0}){let{t:M}=(0,o.b)(),D=/^(blob:|data:image\/)/i.test(e)?e:void 0,[E,_]=(0,n.useState)(),j=(0,n.useRef)(null),[R,I]=(0,x.y)(y,b,"single"),S=["single",...p?["auto"]:[],...d||m&&g?["multi"]:[]],N=S.includes(R)?R:"single",{containerRef:$,zoom:P,imageStyle:L,measureImage:A,zoomIn:H,zoomOut:O,reset:U}=function(e){let[t,i]=(0,n.useState)(null),r=(0,n.useRef)(null),a=(0,n.useCallback)(e=>{r.current=e,i(e)},[]),[l,o]=(0,n.useState)(1),s=(0,n.useRef)(1),[h,c]=(0,n.useState)(null),u=(0,n.useRef)(null),d=(0,n.useRef)(!1),m=(0,n.useCallback)((e,t,n)=>{let i=r.current,a=s.current,l=Math.min(5,Math.max(1,e));if(!i||l===a)return;if(1===a){let e=i.querySelector("img");e&&c(e.clientWidth)}let h=i.getBoundingClientRect(),d=(t??h.left+h.width/2)-h.left,m=(n??h.top+h.height/2)-h.top;u.current={viewX:d,viewY:m,contentX:i.scrollLeft+d,contentY:i.scrollTop+m,ratio:l/a},s.current=l,o(l)},[]);(0,n.useLayoutEffect)(()=>{let e=r.current,t=u.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,u.current=null)},[l]),(0,n.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(s.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},n=null,i=e=>{let[t,n]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-n.clientX,t.clientY-n.clientY),centerX:(t.clientX+n.clientX)/2,centerY:(t.clientY+n.clientY)/2}},r=e=>{2===e.touches.length&&(n={distance:i(e.touches).distance,zoom:s.current},d.current=!0)},a=e=>{if(!n||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:r,centerY:a}=i(e.touches);n.distance>0&&m(n.zoom*(t/n.distance),r,a)},l=e=>{e.touches.length<2&&(n=null,d.current=!1)},o=e=>{d.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",r,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",l),t.addEventListener("touchcancel",l),t.addEventListener("pointermove",o,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",r),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",l),t.removeEventListener("touchcancel",l),t.removeEventListener("pointermove",o,{capture:!0})}},[t,m]);let g=(0,n.useCallback)(e=>{e&&1===s.current&&c(e.clientWidth)},[]),p=(0,n.useCallback)(()=>m(1.25*s.current),[m]),f=(0,n.useCallback)(()=>m(s.current/1.25),[m]),w=(0,n.useCallback)(()=>{s.current=1,u.current=null,o(1)},[]),x=1!==l&&h?{...e,width:h*l,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,zoom:l,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:f,reset:w}}(v[N]);(0,n.useEffect)(()=>{U()},[e,U]);let[X,Y]=(0,n.useState)({src:e,regions:[]}),B=X.src===e?X.regions:[],T=t=>Y({src:e,regions:t}),z=(0,n.useRef)(null),K={single:M.batchImport.singleMode,auto:M.batchImport.autoMode,multi:M.batchImport.multiMode},F=async()=>{if(0!==B.length){if(m){m(B,!0),T([]);return}if(z.current&&d)try{d(await s(z.current,B)),T([])}catch(e){w.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},q=()=>E&&E.width>0&&E.height>0?{x:E.x/100,y:E.y/100,width:E.width/100,height:E.height/100}:{x:0,y:0,width:1,height:1},W=async()=>{let e=q();if("auto"===N&&p)return void p(e);if(m)return void m([e],!1);if(j.current&&u)try{let[t]=await s(j.current,[e]);u(t)}catch(e){w.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(a.N,{open:l,onOpenChange:e=>!e&&h(),children:(0,t.jsxs)(a.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(a.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(a.F,{children:M.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:$,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===N?(0,t.jsx)(c,{ref:z,imageSrc:D,regions:B,onChange:T,imageStyle:L,onImageLoad:e=>A(e.currentTarget)}):(0,t.jsx)(i.f,{crop:E,onChange:(e,t)=>_(t),children:(0,t.jsx)("img",{ref:j,alt:"Crop me",src:D,onLoad:function(e){_({unit:"%",x:0,y:0,width:100,height:100}),A(e.currentTarget)},style:L})})})}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(f,{zoom:P,onZoomIn:H,onZoomOut:O,onReset:U})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[S.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===S.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:S.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":N===e,onClick:()=>{U(),I(e)},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${N===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:K[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===N?`${M.batchImport.hint} ${M.batchImport.regionCount.replace("{count}",String(B.length))}`:"auto"===N?M.batchImport.autoHint:k>0?M.upload.parts.cropHint.replace("{n}",String(k+1)):M.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end",children:["multi"===N&&B.length>0&&(0,t.jsx)(r.f,{variant:"ghost",onClick:()=>T([]),children:M.batchImport.clear}),(0,t.jsx)(r.f,{variant:"outline",onClick:h,children:M.common.cancel||"Cancel"}),"multi"===N?(0,t.jsx)(r.f,{onClick:F,disabled:0===B.length,children:M.batchImport.start.replace("{count}",String(B.length))}):(0,t.jsxs)(t.Fragment,{children:["single"===N&&C&&(0,t.jsx)(r.f,{variant:"secondary",onClick:()=>C(q()),"data-testid":"crop-add-part",children:M.upload.parts.addNext}),(0,t.jsx)(r.f,{onClick:W,children:"auto"===N?M.batchImport.autoStart:k>0?M.upload.parts.confirm.replace("{count}",String(k+1)):M.common.confirm||"Confirm"})]})]})]})]})]})})}],12130)},574041,e=>{var t=e.i(843476),n=e.i(271645),i=e.i(263676),r=e.i(487486),a=e.i(793479),l=e.i(41931),o=e.i(201276);e.s(["f",0,function({value:e=[],onChange:s,placeholder:h="Enter tags...",className:c="",enterHint:u,subject:d,gradeStage:m}){let[g,p]=(0,n.useState)(""),[f,w]=(0,n.useState)([]),[x,y]=(0,n.useState)(!1),[b,v]=(0,n.useState)(0),C=(0,n.useRef)(null),k=(0,n.useRef)(null),M=(0,n.useCallback)(async t=>{try{let n=new URLSearchParams({q:t});d&&n.append("subject",d),m&&n.append("stage",m);let i=((await l.k.get(`/api/tags/suggestions?${n.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(i.slice(0,20)),y(i.length>0),v(0)}catch(e){o.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[d,m,e]);(0,n.useEffect)(()=>{g.trim()&&M(g)},[g,M]);let D=t=>{t.trim()&&!e.includes(t.trim())&&(s([...e,t.trim()]),p(""),w([]),y(!1),v(0))},E=t=>{s(e.filter(e=>e!==t))};return(0,n.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||C.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${c}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(r.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>E(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(i.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(a.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&f[b]?D(f[b]):g.trim()&&D(g)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),v(0)):"Backspace"===t.key&&!g&&e.length>0&&E(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?h:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,n)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${n===b?"bg-accent":""}`,onClick:()=>D(e),onMouseEnter:()=>v(n),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${g}"`:`Press Enter to create "${g}"`})]})}])},185592,e=>{var t=e.i(843476),n=e.i(975157);e.s(["f",0,function({options:e,value:i,onChange:r,className:a}){return(0,t.jsx)("div",{className:(0,n.f)("grid gap-1 rounded-xl bg-muted p-1",a),style:{gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`},role:"tablist",children:e.map(({value:e,label:a,icon:l})=>{let o=e===i;return(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":o,className:(0,n.f)("flex items-center justify-center gap-1.5 rounded-lg px-2 py-2.5 text-sm font-medium transition-all",o?"bg-card text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>r(e),children:[l&&(0,t.jsx)(l,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:a})]},e)})})}])},804536,e=>{var t=e.i(271645);let n=new Map,i=new Set;function r(e){return i.add(e),window.addEventListener("storage",e),()=>{i.delete(e),window.removeEventListener("storage",e)}}function a(e,a,l){let o=(0,t.useSyncExternalStore)(r,()=>(function(e){if(n.has(e))return n.get(e)??null;try{return window.localStorage.getItem(e)}catch{return null}})(e),()=>null);return[(0,t.useMemo)(()=>a(o),[a,o]),(0,t.useCallback)(t=>(function(e,t){try{window.localStorage.setItem(e,t),n.delete(e)}catch{n.set(e,t)}i.forEach(e=>e())})(e,l(t)),[e,l])]}let l=e=>e;e.s(["y",0,function(e,n,i){return a(e,(0,t.useCallback)(e=>n.includes(e??"")?e:i,[n,i]),l)},"x",0,a])},213761,e=>{let t={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class n extends Error{code;format;constructor(e,t,n){super(e,void 0===n?void 0:{cause:n}),this.code=e,this.format=t,this.name="ImageDecodeError"}}let i=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),r=new Set(["mif1","msf1","mif2"]),a=new Set(["avif","avis"]);function l(e,n,i=t){let r=Math.min(1,i.maxLongEdge/Math.max(e,n),Math.sqrt(i.maxPixels/Math.max(1,e*n)));return{width:Math.max(1,Math.floor(e*r)),height:Math.max(1,Math.floor(n*r)),scale:r}}async function o(e){let t,n;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let i=await (t=URL.createObjectURL(e),(n=new Image).decoding="async",new Promise((e,i)=>{n.onload=()=>e(n),n.onerror=()=>i(Error("IMAGE_ELEMENT_DECODE_FAILED")),n.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!i.naturalWidth||!i.naturalHeight)throw Error("IMAGE_EMPTY");return i}async function s(t){let{heicTo:n}=await e.A(462684);return n({blob:t,type:"image/jpeg",quality:.95})}function h(e,t){return new Promise((n,i)=>{e.toBlob(e=>e?n(e):i(Error("CANVAS_EMPTY")),"image/jpeg",t)})}function c(e,t,n,i,r,a,l){let o,s=((o=document.createElement("canvas")).width=a,o.height=l,o),h=s.getContext("2d");if(!h)throw Error("CANVAS_UNSUPPORTED");return h.fillStyle="#ffffff",h.fillRect(0,0,a,l),h.imageSmoothingEnabled=!0,h.imageSmoothingQuality="high",h.drawImage(e,t,n,i,r,0,0,a,l),s}async function u(e,t){var u;let d,m=performance.now(),g=await e.arrayBuffer(),p=performance.now()-m,f=function(e){let t=(t,n)=>String.fromCharCode(...e.subarray(t,n));if(e.length>=3&&255===e[0]&&216===e[1]&&255===e[2])return"jpeg";if(e.length>=8&&137===e[0]&&"PNG"===t(1,4))return"png";if(e.length>=12&&"RIFF"===t(0,4)&&"WEBP"===t(8,12))return"webp";if(e.length>=6&&("GIF87a"===t(0,6)||"GIF89a"===t(0,6)))return"gif";if(e.length>=2&&"BM"===t(0,2))return"bmp";if(e.length>=12&&"ftyp"===t(4,8)){let n=Math.min(e.length,(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0||e.length),l=[t(8,12)];for(let e=16;e+4<=n;e+=4)l.push(t(e,e+4));if(l.some(e=>i.has(e)))return"heic";if(l.some(e=>a.has(e)))return"avif";if(l.some(e=>r.has(e)))return"heic"}return"unknown"}(new Uint8Array(g,0,Math.min(g.byteLength,64))),w=e.type||"",x=performance.now(),y="native",b=new Blob([g],{type:w||"application/octet-stream"});try{d=await o(b)}catch(e){if("heic"!==f)throw new n("unknown"===f?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",f,e);t?.();try{d=await o(await s(b)),y="heic"}catch(e){throw new n("HEIC_DECODE_FAILED",f,e)}}let{width:v,height:C}=(u=d)instanceof HTMLImageElement?{width:u.naturalWidth,height:u.naturalHeight}:{width:u.width,height:u.height};if(!v||!C)throw new n("IMAGE_DECODE_FAILED",f);let k=l(v,C,{maxLongEdge:1600,maxPixels:1/0}),M=await h(c(d,0,0,v,C,k.width,k.height),.85),D=URL.createObjectURL(M),E=performance.now()-x;return{source:d,width:v,height:C,format:f,decoder:y,previewUrl:D,sourceType:w,sourceBytes:e.size,timings:{read:Math.round(p),convert:Math.round(E)},dispose:()=>{URL.revokeObjectURL(D),d instanceof HTMLImageElement||d.close()}}}let d={x:0,y:0,width:1,height:1};async function m(e,n=d,i=t){var r;let a=performance.now(),o=e=>Math.min(1,Math.max(0,e)),s=Math.round(o(n.x)*e.width),u=Math.round(o(n.y)*e.height),g=Math.max(1,Math.min(e.width-s,Math.round(o(n.width)*e.width))),p=Math.max(1,Math.min(e.height-u,Math.round(o(n.height)*e.height))),f=l(g,p,i),w=c(e.source,s,u,g,p,f.width,f.height),x=performance.now()-a,y=performance.now(),b=i.startQuality,v=await h(w,b);for(let t=0;v.size>i.maxBytes&&t<12;t++)b-.05>=i.minQuality-1e-9?b=Math.round((b-.05)*100)/100:(f={width:Math.max(1,Math.floor(.85*f.width)),height:Math.max(1,Math.floor(.85*f.height)),scale:.85*f.scale},w=c(e.source,s,u,g,p,f.width,f.height)),v=await h(w,b);return{dataUrl:await (r=v,new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=()=>t(n.error??Error("READ_FAILED")),n.readAsDataURL(r)})),width:f.width,height:f.height,bytes:v.size,quality:b,timings:{crop:Math.round(x),compress:Math.round(performance.now()-y)}}}e.s(["K",0,t,"o",0,n,"N",0,function(e,t){return{sourceType:e.sourceType||e.format,sourceBytes:e.sourceBytes,sourceWidth:e.width,sourceHeight:e.height,outputWidth:t.width,outputHeight:t.height,outputBytes:t.bytes,decoder:e.decoder,quality:t.quality}},"p",0,u,"X",0,m])},499930,e=>{var t=e.i(213761);function n(e,t=.008){let i=Math.max(0,e.x-t),r=Math.max(0,e.y-t);return{x:i,y:r,width:Math.min(1,e.x+e.width+t)-i,height:Math.min(1,e.y+e.height+t)-r}}async function i(e){let t=new Image;if(t.decoding="async",t.src=e,await t.decode(),!t.naturalWidth||!t.naturalHeight)throw Error("IMAGE_EMPTY");return t}async function r(e,n){let i=function(e,t=16,n=!1){let i=Math.max(...e.map(e=>e.width)),r=0,a=e.map(e=>{let a=n?i/e.width:e.scale??1,l={x:0,y:r,width:Math.round(e.width*a),height:Math.round(e.height*a)};return r+=l.height+t,l});return{width:Math.max(...a.map(e=>e.width)),height:r-t,rects:a}}(e.map(e=>({width:e.sw,height:e.sh,scale:e.scale})),16,n),r=document.createElement("canvas");r.width=i.width,r.height=i.height;let a=r.getContext("2d");if(!a)throw Error("CANVAS_UNSUPPORTED");a.fillStyle="#ffffff",a.fillRect(0,0,r.width,r.height),e.forEach((e,t)=>{let n=i.rects[t];a.drawImage(e.source,e.sx,e.sy,e.sw,e.sh,n.x,n.y,n.width,n.height)});let l=await createImageBitmap(r);try{return await (0,t.X)({source:l,width:r.width,height:r.height})}finally{l.close()}}async function a(e,i){let a=e.naturalWidth,l=e.naturalHeight,o=i.map(e=>n(e));return 1===o.length?(0,t.X)({source:e,width:a,height:l},o[0]):r(o.map(t=>({source:e,sx:Math.round(t.x*a),sy:Math.round(t.y*l),sw:Math.max(1,Math.round(t.width*a)),sh:Math.max(1,Math.round(t.height*l))})),!1)}async function l(e){return r((await Promise.all(e.map(i))).map(e=>({source:e,sx:0,sy:0,sw:e.naturalWidth,sh:e.naturalHeight})),!0)}async function o(e,t,i){let a=e.naturalWidth,l=e.naturalHeight,o=i.width/a,s=t.map(e=>n(e)).map(t=>({source:e,sx:Math.round(t.x*a),sy:Math.round(t.y*l),sw:Math.max(1,Math.round(t.width*a)),sh:Math.max(1,Math.round(t.height*l)),scale:o}));return s.push({source:i.source,sx:0,sy:0,sw:i.width,sh:i.height}),r(s,!1)}e.s(["y",0,i,"k",0,o,"M",0,a,"v",0,l])},119472,e=>{var t=e.i(41931),n=e.i(127175);async function i(e){let t;for(let n=0;n<3;n++)try{return await e()}catch(e){if(t=e,!function(e){let t=e?.status;return void 0===t||408===t||502===t||503===t||504===t}(e)||2===n)break;await new Promise(e=>setTimeout(e,1e3*(n+1)))}throw t}async function r(e,a=(0,n.c)()){let{batch:l}=await i(()=>t.k.post("/api/import-batches",{...e,clientRequestId:a,subjectId:e.subjectId||void 0,targetSubjectId:e.targetSubjectId||void 0,paperLevel:e.paperLevel||void 0,items:e.items?.map(e=>({...e})),origin:e.origin},{timeout:12e4}));return(0,n.P)(),l}async function a(e,n={}){let i=n.image?"?include=image":"",{batch:r}=await t.k.get(`/api/import-batches/${encodeURIComponent(e)}${i}`);return r}async function l(e,n,i){let{batch:r}=await t.k.patch(`/api/import-batches/${encodeURIComponent(e)}`,{version:n,draft:i});return r}async function o(e,r,a,l){let{batch:o}=await i(()=>t.k.post(`/api/import-batches/${encodeURIComponent(e)}/start`,{version:r,images:a,analysis:l},{timeout:12e4}));return(0,n.P)(),o}async function s(e){let{batch:i}=await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/retry`,{});return(0,n.P)(),i}async function h(e){let i=await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/confirm-all`,{});return(0,n.P)(),i}async function c(e){await t.k.delete(`/api/import-batches/${encodeURIComponent(e)}`),(0,n.P)()}async function u(e){await t.k.post(`/api/import-batches/${encodeURIComponent(e)}/read`,{}),(0,n.P)()}async function d(e,n,i){return t.k.post(`/api/import-batches/${encodeURIComponent(e)}/fix-text`,{items:n},{timeout:6e5,recoverable:!0,requestId:i})}e.s(["J",0,h,"n",0,function(e){return e?.status===409?e.data?.details?.batch??null:null},"v",0,r,"o",0,c,"w",0,a,"$",0,d,"f",0,u,"s",0,s,"S",0,l,"g",0,o])},25197,e=>{var t=e.i(41931);function n(e){return e.trim()?e:""}async function i(){try{return!!(await t.k.get("/api/user")).confirmBeforeImport}catch{return!1}}async function r(e,i){let r=await t.k.post("/api/error-items",{questionText:e.questionText,answerText:n(e.answerText),analysis:n(e.analysis),wrongAnswerText:e.wrongAnswerText||null,mistakeAnalysis:e.mistakeAnalysis||null,mistakeStatus:e.mistakeStatus||"unknown",knowledgePoints:e.knowledgePoints||[],difficultyStars:e.difficultyStars??null,recognizedGradeSemester:e.gradeSemester??null,hasFigure:e.hasFigure??!1,figureSvg:e.figureSvg??null,questionType:e.questionType??null,subjectId:i.subjectId||void 0,subjectName:i.subjectId?void 0:e.subject,originalImageUrl:i.imageUrl||"",paperLevel:i.paperLevel||void 0});return{id:r.id,shortId:r.shortId??null,subjectId:r.subjectId??null,notebookName:r.subject?.name??null,duplicate:r.duplicate}}e.i(201276),e.s(["x",0,i,"a",0,r],25197)},825624,e=>{let t=/^[\s ]+/,n="一二三四五六七八九十",i=[{family:"dot",pattern:/^(\d{1,3})\s*(?:.|\.(?!\d))\s*/},{family:"comma",pattern:/^(\d{1,3})\s*[、,,](?!\d)\s*/},{family:"paren",pattern:/^(\d{1,3})\s*[))]\s*/},{family:"colon",pattern:/^(\d{1,3})\s*[::](?!\d)\s*/},{family:"ti",pattern:/^第\s*(\d{1,3}|[一二三四五六七八九十]{1,3})\s*题\s*[..、::]?\s*/},{family:"example",pattern:/^(?:例题?|练习|习题)\s*(\d{1,3})\s*[..、::]?\s*/},{family:"q",pattern:/^(?:Q|Question|Problem|Exercise)\s*(\d{1,3})\s*[..::)]?\s+/i},{family:"cn",pattern:/^([一二三四五六七八九十]{1,3})\s*[、..]\s*/}];function r(e){let r=e.replace(t,"");for(let{family:e,pattern:t}of i){let i=r.match(t);if(!i||r.length<=i[0].length)continue;let a=function(e){if(/^\d+$/.test(e))return Number(e);if("十"===e)return 10;let t=e.indexOf("十");return -1===t?n.indexOf(e)+1:10*(0===t?1:n.indexOf(e[0])+1)+(t===e.length-1?0:n.indexOf(e[t+1])+1)}(i[1]);if(Number.isFinite(a)&&!(a<=0))return{value:a,family:e,prefixLength:i[0].length,label:i[1]}}return null}function a(e){let n=e.split("\n"),i=n[0]?.replace(t,"")??"",a=r(i);return a&&"cn"!==a.family&&(n[0]=i.slice(a.prefixLength)),n.join("\n")}function l(e){let t=[];for(let n of e)(n||0!==t.length&&""!==t[t.length-1])&&t.push(n);for(;t.length>0&&""===t[t.length-1];)t.pop();return t.join("\n")}let o=/(姓名|班级|学号|日期|得分|分数|评分|考号|座位号|家长签字|用时|Name\s*[::_]|Class\s*[::_]|Date\s*[::_]|Score\s*[::_])|_{3,}|共\s*\d+\s*(道|题|小题)|做完|答案(见|在)|最后一页|满分\s*\d+\s*分/i,s=/(阅读|材料|短文|文章|选文|诗歌|古诗|文言文|下[面列]的?(表格|图表|统计|信息)|根据.{0,20}(回答|完成)|passage|read the|according to the)/i,h=/^(参考答案|答案与解析|答案|Answers?|Answer Key)\s*[::]?$/i,c=/^(第[一二三四五六七八九十]+(部分|大题|节)|(Part|Section)\s+[A-Z0-9IVX]+\b)/i,u=/(选择|填空|判断|计算|解答|应用|解决问题|操作|作图|阅读|写作|作文|综合|口算|听力|单项|完形|题)/,d=/(\d{1,3})\s*[~~\-—–至到]\s*(\d{1,3})\s*(?:小?题|questions?)/i,m=/(小问|小题|下列问题|以下问题|下列各题|下面各题|完成下列|回答下列|回答以下|following questions|answer the following)/i;function g(e){let t=[],n=[];for(let i of e)i?n.push(i):n.length&&(t.push(n.join("\n")),n=[]);return n.length&&t.push(n.join("\n")),t}function p(e,t=[]){let n=e.trim();return!(!n||n.length>12||/[。!?!?,,、;;::..()()【】\[\]{}]$/.test(n)||/\d/.test(n)||/[。!?!?;;,,]/.test(n))&&!!(/(篇|章|节|部分|组)$/.test(n)||/^(Part|Section)\s+[A-Z0-9]+$/i.test(n))&&(!t.length||t.some(e=>{let t=r(e);return null!==t&&1===t.value}))}function f(e,t){let n=[];for(let i=0;i<e.length;i++){let r=e[i],a=[r];for(let n=i+1;n<e.length;n++){let i=e[n],l=a[a.length-1];if(i.family!==r.family)continue;let o=1===i.value&&[...t].some(e=>e>l.line&&e<i.line);(i.value===l.value+1||o)&&a.push(i)}a.length>n.length&&(n=a)}return n}function w(e,t,n){return!!c.test(e)||!!t&&"cn"===t.family&&"cn"!==n&&null!==n&&(e.length<=40||u.test(e.slice(0,20)))}function x(e,t,n,i,r){for(let a=e-1;a>=0;a--)if(t[a]){if(r.has(a)||w(t[a],n[a],i)||p(t[a]))return t[a];break}return null}function y(e){let t=e.match(d);if(!t)return null;let n=Number(t[1]),i=Number(t[2]);return n<=i?{from:n,to:i}:null}let b={answer:/^(?:【\s*(?:参考答案|答案)\s*】|(?:参考答案|答案)\s*[::]|Answer\s*[::])\s*(.*)$/i,analysis:/^(?:【\s*(?:解析|分析|详解|解答|点评)\s*】|(?:解析|分析|详解|解答|点评)\s*[::])\s*(.*)$/,knowledge:/^(?:【\s*(?:知识点|考点)\s*】|(?:知识点|考点)\s*[::])\s*(.*)$/,difficulty:/^(?:【\s*难度\s*】|难度\s*[::])\s*(.*)$/,questionType:/^(?:【\s*题型\s*】|题型\s*[::])\s*(.*)$/,wrongAnswer:/^(?:【\s*错答\s*】|我的答案\s*[::]|学生答案\s*[::])\s*(.*)$/},v={易:1,较易:2,中等:3,较难:4,难:5};function C(e){return e.split(/[、,,;;]/).map(e=>e.trim()).filter(Boolean)}function k(e){let t={answer:[],analysis:[],knowledge:[],difficulty:[],questionType:[],wrongAnswer:[]},n=[],i=null;for(let r of e){let e=null;for(let n of Object.keys(b)){let a=r.match(b[n]);if(!a)continue;e=n,i=n;let l=a[1].trim();l&&t[n].push(l);break}e||(i&&r.trim()?t[i].push(r.trim()):n.push(r))}let r={},a=t.answer.join("\n").trim();a&&(r.answer=a);let o=t.analysis.join("\n").trim();o&&(r.analysis=o);let s=t.knowledge.flatMap(C);s.length&&(r.knowledgePoints=s);let h=t.difficulty.join(" ").trim(),c=h?function(e){let t=e.trim();if(!t)return null;let n=t.match(/^(\d{1,2})\s*(?:星|级)?$/);if(n){let e=Number(n[1]);return e>=1&&e<=5?e:null}if(/^[★☆]{1,5}$/.test(t)){let e=(t.match(/★/g)??[]).length;return e>=1?e:null}return t in v?v[t]:null}(h):null;null!==c&&(r.difficultyStars=c);let u=t.questionType.join(" ").trim();u&&(r.questionType=u);let d=t.wrongAnswer.join("\n").trim();return d&&(r.wrongAnswer=d),{text:l(n),fields:r}}let M=/^(\d{1,3})\s*[..、,,)]\s*(\S[\s\S]*)$/,D=/^(\d{1,3})\s*[~~—–-]\s*(\d{1,3})\s*[::..、]?\s*([A-Za-z]+)$/;function E(e){let t=e.trim();if(!t)return null;let n=function(e){let t=e.trim().match(D);if(!t)return null;let n=Number(t[1]),i=Number(t[2]),r=t[3];if(!Number.isFinite(n)||!Number.isFinite(i)||n<=0||i<=n||i-n+1>60)return null;let a=i-n+1;return r.length!==a?null:Array.from({length:a},(e,t)=>({label:String(n+t),text:r[t]}))}(t);if(n)return n;let i=function(e){let t=e.trim(),n=[];for(let e of t.matchAll(/(\d{1,3})\s*[..、,,;;]\s*/g)){let i=e.index??0,r=t[i+e[0].length];r&&/\d/.test(r)||n.push({index:i,label:e[1],afterIndex:i+e[0].length})}if(n.length<2)return null;for(let e=1;e<n.length;e++)if(Number(n[e].label)<=Number(n[e-1].label))return null;let i=[];for(let e=0;e<n.length;e++){let r=n[e].afterIndex,a=e+1<n.length?n[e+1].index:t.length,l=t.slice(r,a).trim().replace(/[;;]+$/,"").trim();if(!l||l.length>30||/[。!?!?]/.test(l))return null;i.push({label:n[e].label,text:l})}return i}(t);if(i)return i.map(e=>({label:e.label??"",text:e.text})).filter(e=>e.label);let r=t.match(M);if(!r)return null;let a=Number(r[1]);return!Number.isFinite(a)||a<=0?null:[{label:r[1],text:r[2].trim()}]}function _(e){let t=e.match(/^(.*?)(?:【?\s*(?:解析|分析|详解|解答|点评)\s*】?\s*[::])([\s\S]*)$/);if(t){let n=t[1].replace(/^(?:【?\s*(?:参考答案|答案)\s*】?\s*[::])\s*/,"").trim(),i=t[2].trim();return i?{answer:n,analysis:i}:{answer:e.trim()}}return{answer:e.replace(/^(?:【?\s*(?:参考答案|答案)\s*】?\s*[::])\s*/,"").trim()||e.trim()}}function j(e,t){let n=[],i=!1;for(let r of e){let e={value:!1},a=[];for(let n of r.split("\n")){let i=n.trim()?E(n):null;if(!i){n.trim()&&a.push(n);continue}let r=!1;for(let l of i){let i=t.find(e=>e.label===l.label);if(!i){a.push(n);break}r=!0,e.value=!0;let o=_(l.text);o.answer&&!i.answer&&(i.answer=o.answer),o.analysis&&(i.analysis=i.analysis?`${i.analysis}
|
|
2
|
-
${o.analysis}`:o.analysis)}!r&&!a.includes(n)&&n.trim()&&!a.includes(n)&&a.push(n)}i=i||e.value,e.value?a.length&&n.push(a.join("\n")):n.push(r)}return[n,i]}e.s(["k",0,2e3,"f",0,1e6,"S",0,60,"i",0,2e4,"J",0,function(e,n={}){let i,u,b=void 0===n.maxLength?2e4:Math.min(Math.max(n.maxLength,1e3),1e6),v=void 0===n.maxQuestions?60:Math.min(Math.max(n.maxQuestions,2),2e3),C=e.length>b,M=e.slice(0,b).replace(/\r\n?/g,"\n").split("\n").map(e=>e.replace(t,"").replace(/[\s ]+$/,"")),D=M.map(e=>e?r(e):null),R=M.length;for(let e=0;e<M.length;e++)if(h.test(M[e])){R=e;break}let I=[],S=[];for(let e=0;e<R;e++){let t=D[e];t&&("cn"===t.family?S:I).push({...t,line:e})}let N=new Set;for(let e=0;e<R;e++)(c.test(M[e])||D[e]?.family==="cn"||p(M[e],M.slice(e+1,e+5)))&&N.add(e);let $=[],P=f(I,N);if(P.length<2){let e=f(S,new Set);e.length>=2&&($=[{chain:e,sectionHeading:null}])}else $=function(e,t,n,i){if(e.length<2)return[];let r=e[0].family,a=[0];for(let t=1;t<e.length;t++)1===e[t].value&&a.push(t);if(a.length<2){let a=x(e[0].line,t,n,r,i);return null!==a?[{chain:e,sectionHeading:a}]:[]}let l=[];for(let o=0;o<a.length;o++){let s=a[o],h=o+1<a.length?a[o+1]:e.length,c=e.slice(s,h),u=0===o?x(e[0].line,t,n,r,i):function(e,t,n,i,r,a){for(let l=e+1;l<t;l++)if(n[l]&&(a.has(l)||w(n[l],i[l],r)||p(n[l])))return n[l];return null}(e[s-1].line,e[s].line,t,n,r,i);if(null===u&&o>0){l[l.length-1].chain.push(...c);continue}l.push({chain:c,sectionHeading:u})}return l.filter(e=>e.chain.length>0)}(P,M,D,N);let L=$.length?$.flatMap(e=>e.chain):P,A=l(M.slice(0,R)),H=R<M.length?g(M.slice(R)):[],O=(u=r(M[L[0]?.line??0]??""))?u.label:null,U=e=>({questions:A?[{label:O,text:A,material:null,section:null,lineRange:{from:0,to:R}}]:[],ignored:H,detected:!1,ambiguous:e,candidateCount:e?L.length:+!!A,overflow:0,tooLong:C});if(L.length<2){if(!A)return U(!1);let e=k(A.split("\n")),t=U(!1);if(t.questions.length>0&&Object.keys(e.fields).length>0&&(t.questions[0]={...t.questions[0],text:a(e.text),...e.fields}),t.questions.length>0&&H.length){let[e,n]=j(H,t.questions);t.ignored=e,n||(t.ignored=H)}return t}let X=L[0].family;if(!n.forceNumbered&&function(e,t,n,i){let r=null;for(let a=t-1;a>=0;a--)if(e[a]){r=w(e[a],i[a],n)?null:e[a];break}return!(!r||o.test(r)||d.test(r))&&("paren"===n?r.length>=15||/[。?!?!::,,;;]$/.test(r):/[::]$/.test(r)&&m.test(r))}(M,L[0].line,X,D)){let e=U(!0);if(e.questions.length>0&&A){let t=k(A.split("\n"));Object.keys(t.fields).length>0&&(e.questions[0]={...e.questions[0],text:a(t.text),...t.fields})}return e}let Y=new Set(L.map(e=>e.line)),B=[],T=[],z=null,K=[],F=[],q=(e,t)=>{for(let n of g(e))(!o.test(n)||!(n.length<80))&&(s.test(n)||n.length>=80&&/[。!?.!?;;]/.test(n))?K.push({text:n,range:y(n)}):t?B.push(n):z&&!T.some(e=>e.section===z)?z=`${z}
|
|
3
|
-
${n}`:B.push(n)},W=L[0].line,G=[];for(let e=0;e<W;e++)M[e]&&(w(M[e],D[e],X)||p(M[e],M.slice(e+1,e+5)))?(q(G.splice(0),!0),z=M[e],F=[]):G.push(M[e]);q(G,!0);let Q=$.length>1,V=e=>{if(!Q)return -1;let t=0;for(let n=0;n<$.length;n++)if(e<(t+=$[n].chain.length))return n;return $.length-1};for(let e=0;e<L.length;e++){let t=L[e].line,n=e+1<L.length?L[e+1].line:R,i=V(e);if(Q&&i>=0){let e=$[i].sectionHeading;null!==e&&(z=e,F=[])}K.length&&(F=[...F.filter(e=>e.range),...K],K=[]);let r=n,o=null;for(let e=t+1;e<n;e++)if(M[e]&&!Y.has(e)&&w(M[e],D[e],X)){r=e,o=M[e];break}let h=M.slice(t,r),c=g(h),u=[];for(;c.length>1&&s.test(c[c.length-1].slice(0,30));)u.unshift(c.pop());let d=u.length?c.join("\n"):l(h),m=L[e].value,p=F.filter(e=>!e.range||m>=e.range.from&&m<=e.range.to),f=k(a(d).split("\n"));for(let i of(T.push({label:L[e].label,text:f.text,material:p.length?p.map(e=>e.text).join("\n\n"):null,section:z,lineRange:{from:t,to:n},...f.fields}),u))K.push({text:i,range:y(i)});null!==o&&(z=o,F=[],q(M.slice(r+1,n),!1))}if(Q&&H.length){let e=$.map(e=>e.sectionHeading).filter(e=>null!==e),t=H.join("\n");i=e.some(e=>t.includes(e))?function(e,t,n){let i=[],r=0,a=t.map(e=>{let t=n.slice(r,r+e.chain.length);return r+=e.chain.length,t}),l=-1;for(let r of e){let e=r.split("\n"),o=[],s=!1;for(let i of e){let e=i.trim();if(!e){o.push(i);continue}let r=t.findIndex(t=>t.sectionHeading&&e.includes(t.sectionHeading));if(r>=0){l=r;continue}let h=E(e);if(!h){o.push(i);continue}let c=l>=0?a[l]:n,u=!1;for(let e of h){let t=c.find(t=>t.label===e.label);if(!t){o.push(i);break}u=!0,s=!0;let n=_(e.text);n.answer&&!t.answer&&(t.answer=n.answer),n.analysis&&(t.analysis=t.analysis?`${t.analysis}
|
|
4
|
-
${n.analysis}`:n.analysis)}u||o.includes(i)||o.push(i)}s?o.length&&i.push(o.join("\n")):i.push(r)}return i}(H,$,T):H}else i=j(H,T)[0];let Z=T.slice(v);return{questions:T.slice(0,v),ignored:[...B,...i,...Z.map(e=>{var t;let n,i,r,a;return n=(t=e).text.trim(),r=(i=t.material?.trim())?`${i}
|
|
5
|
-
|
|
6
|
-
${n}`:n,a=[],(t.answer?.trim()&&a.push(`参考答案:${t.answer.trim()}`),t.analysis?.trim()&&a.push(`参考解析:${t.analysis.trim()}`),t.wrongAnswer?.trim()&&a.push(`学生作答:${t.wrongAnswer.trim()}`),a.length)?`${r}
|
|
7
|
-
|
|
8
|
-
${a.join("\n\n")}`:r})],detected:!0,ambiguous:!1,candidateCount:T.length,overflow:Z.length,tooLong:C}}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let n=e.trim().toLowerCase();return n?t[n]??null:null}])}])})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,314381,3198,e=>{var t=e.i(456420);let i={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],314381);var r=e.i(843476),a=e.i(271645),o=e.i(632781);let l={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};l.node;let s=(0,t.f)(l),c={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};c.node;let h=(0,t.f)(c);var d=e.i(395925),u=e.i(741120),m=e.i(759659),g=e.i(519455),p=e.i(111110),f=e.i(294114),w=e.i(201276),x=e.i(113381);let y=null;function b(e,t,i){let n=e?.firstElementChild;n&&(n.style.width="100%",n.style.height=`${i}px`,t?.setSize(e?.offsetWidth||n.offsetWidth||800,i))}function v(e,t){let i=(0,x.L)(e,t);for(let e of i)w.V.warn("[GGB]","命令执行失败",{...e});return i.map(e=>e.command+":"+e.message).join("\n")||void 0}e.s(["f",0,function({commands:e,height:t=700,showToolBar:i=!1,showAlgebraInput:n=!1,showMenuBar:l=!1,className:c="",onRegenerate:C,onDelete:k}){let{t:j}=(0,p.b)(),D=(0,a.useRef)(null),M=(0,a.useRef)(null),E=(0,a.useRef)(void 0),_=(0,a.useId)(),N=(0,a.useRef)(`ggb-${_.replace(/[^a-zA-Z0-9_-]/g,"")}`),[R,S]=(0,a.useState)(!0),[L,I]=(0,a.useState)(null),[P,z]=(0,a.useState)(!0),[$,H]=(0,a.useState)(!1),[A,B]=(0,a.useState)(!1),Y=(0,a.useMemo)(()=>(0,x.i)(e),[e]);(0,a.useEffect)(()=>{if(0===Y.length)return;let e=!1,r=N.current,a=D.current;return(y||(y=new Promise((e,t)=>{if(window.GGBApplet)return void e();let i=document.createElement("script");i.src="https://www.geogebra.org/apps/deployggb.js",i.async=!0,i.onload=()=>e(),i.onerror=()=>{y=null,t(Error("Failed to load GeoGebra"))},document.head.appendChild(i)}))).then(()=>{if(e)return;let o=window.GGBApplet;if(!o){I(j.geogebra.notLoaded),S(!1);return}if(a){a.innerHTML=`<div id="${r}" style="width:100%;height:${t}px"></div>`;try{new o({appName:"classic",width:"100%",height:t,showToolBar:i,showAlgebraInput:n,showMenuBar:l,showResetIcon:!0,enableRightClick:!0,enableShiftDragZoom:!0,language:"zh",appletOnLoad:i=>{e||(M.current=i,b(a,i,t),E.current=v(i,Y),S(!1))}},!0).inject(r)}catch(t){w.V.error("[GGB]","Init failed",{error:t}),e||(I(j.geogebra.initFailed),S(!1))}}}).catch(t=>{w.V.error("[GGB]","Script load failed",{error:t}),e||(I(j.geogebra.scriptFailed),S(!1))}),()=>{e=!0;try{let e=M.current;e?.remove&&e.remove()}catch(e){w.V.warn("[GGB]","Cleanup failed",{error:e})}M.current=null,a&&(a.innerHTML="")}},[Y,i,n,l]),(0,a.useEffect)(()=>{b(D.current,M.current,P?700:t)},[P,t]);let O=(0,a.useCallback)(()=>{let e=M.current;if(e)try{e.resetConstruction(),setTimeout(()=>{M.current&&(E.current=v(M.current,Y))},300)}catch(e){w.V.warn("[GGB]","Reset failed",{error:e})}},[Y]),X=(0,a.useCallback)(async()=>{if(C&&!$){H(!0);try{await C(E.current)}finally{H(!1)}}},[C,$]),U=(0,a.useCallback)(async()=>{if(k&&!A&&await (0,f.u)(j.geogebra.confirmDelete,{destructive:!0})){B(!0);try{await k()}catch{f.c.error(j.geogebra.deleteFailed)}finally{B(!1)}}},[k,A,j]);return 0===Y.length?null:(0,r.jsxs)("div",{className:`relative rounded-lg border bg-card ${c}`,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:j.geogebra.title}),R&&(0,r.jsx)(o.f,{className:"h-3 w-3 animate-spin text-muted-foreground"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[C&&(0,r.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1",onClick:X,title:j.geogebra.regenerate,disabled:$||R,children:[$?(0,r.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(u.f,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:j.geogebra.regenerate})]}),k&&(0,r.jsxs)(g.f,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs gap-1 text-destructive hover:text-destructive",onClick:U,title:j.geogebra.delete,disabled:A||$,children:[A?(0,r.jsx)(o.f,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(m.f,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:j.geogebra.delete})]}),(0,r.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:O,title:j.geogebra.reset,disabled:R,children:(0,r.jsx)(d.f,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(g.f,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>z(e=>!e),title:P?j.geogebra.shrink:j.geogebra.enlarge,children:P?(0,r.jsx)(h,{className:"h-3.5 w-3.5"}):(0,r.jsx)(s,{className:"h-3.5 w-3.5"})})]})]}),(0,r.jsx)("div",{ref:D,style:{width:"100%"}}),R&&(0,r.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 rounded-b-lg",style:{top:37},children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,r.jsx)(o.f,{className:"h-6 w-6 animate-spin text-primary"}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:j.geogebra.loading})]})}),L&&(0,r.jsx)("div",{className:"flex items-center justify-center text-sm text-destructive",style:{minHeight:t},children:L})]})}],3198)},856522,e=>{var t=e.i(456420);let i={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],856522)},328623,e=>{var t=e.i(456420);let i={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"]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],328623)},786563,e=>{var t=e.i(456420);let i={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};i.node;let n=(0,t.f)(i);e.s(["f",0,n],786563)},232660,e=>{var t=e.i(271645),i={x:0,y:0,width:0,height:0,unit:"px"},n=(e,t,i)=>Math.min(Math.max(e,t),i),r=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function a(e,t,n){return"%"===e.unit?{...i,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function o(e,t,n){return e.unit&&"px"!==e.unit?{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}:{...i,...e,unit:"px"}}function l(e,t,i,n,r,a=0,o=0,s=n,c=r){let h={...e},d=Math.min(a,n),u=Math.min(o,r),m=Math.min(s,n),g=Math.min(c,r);t&&(t>1?(u=(d=o?o*t:d)/t,m=s*t):(d=(u=a?a/t:u)*t,g=c/t)),h.y<0&&(h.height=Math.max(h.height+h.y,u),h.y=0),h.x<0&&(h.width=Math.max(h.width+h.x,d),h.x=0);let p=n-(h.x+h.width);p<0&&(h.x=Math.min(h.x,n-d),h.width+=p);let f=r-(h.y+h.height);if(f<0&&(h.y=Math.min(h.y,r-u),h.height+=f),h.width<d&&(("sw"===i||"nw"==i)&&(h.x-=d-h.width),h.width=d),h.height<u&&(("nw"===i||"ne"==i)&&(h.y-=u-h.height),h.height=u),h.width>m&&(("sw"===i||"nw"==i)&&(h.x-=m-h.width),h.width=m),h.height>g&&(("nw"===i||"ne"==i)&&(h.y-=g-h.height),h.height=g),t){let e=h.width/h.height;if(e<t){let e=Math.max(h.width/t,u);("nw"===i||"ne"==i)&&(h.y-=e-h.height),h.height=e}else if(e>t){let e=Math.max(h.height*t,d);("sw"===i||"nw"==i)&&(h.x-=e-h.width),h.width=e}}return h}var s={capture:!0,passive:!1},c=0,h=class e extends t.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,t.createRef)();mediaRef=(0,t.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${c++}`;state={cropIsActive:!1,newCropIsBeingDrawn:!1};getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:i,width:n,height:r}=e.getBoundingClientRect();return{x:t,y:i,width:n,height:r}}componentDidUpdate(e){let{crop:t,onComplete:i}=this.props;if(i&&!e.crop&&t){let{width:e,height:n}=this.getBox();e&&n&&i(o(t,e,n),a(t,e,n))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,s),this.document.addEventListener("pointerup",this.onDocPointerDone,s),this.document.addEventListener("pointercancel",this.onDocPointerDone,s),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,s),this.document.removeEventListener("pointerup",this.onDocPointerDone,s),this.document.removeEventListener("pointercancel",this.onDocPointerDone,s),!1)}onCropPointerDown=e=>{let{crop:t,disabled:i}=this.props,n=this.getBox();if(!t)return;let r=o(t,n.width,n.height);if(i)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.target.dataset.ord,l=e.clientX,s=e.clientY,c=r.x,h=r.y;if(a){let t=e.clientX-n.x,i=e.clientY-n.y,o=0,d=0;"ne"===a||"e"==a?(o=t-(r.x+r.width),d=i-r.y,c=r.x,h=r.y+r.height):"se"===a||"s"===a?(o=t-(r.x+r.width),d=i-(r.y+r.height),c=r.x,h=r.y):"sw"===a||"w"==a?(o=t-r.x,d=i-(r.y+r.height),c=r.x+r.width,h=r.y):("nw"===a||"n"==a)&&(o=t-r.x,d=i-r.y,c=r.x+r.width,h=r.y+r.height),l=c+n.x+o,s=h+n.y+d}this.evData={startClientX:l,startClientY:s,startCropX:c,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!!a,ord:a},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})};onComponentPointerDown=e=>{let{crop:t,disabled:i,locked:n,keepSelection:r,onChange:l}=this.props,s=this.getBox();if(i||n||r&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let c=e.clientX-s.x,h=e.clientY-s.y,d={unit:"px",x:c,y:h,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:c,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,l(o(d,s.width,s.height),a(d,s.width,s.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:i,disabled:n,onChange:l,onDragStart:s}=this.props,c=this.getBox();if(n||!i||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,s&&s(e));let{evData:h}=this;h.clientX=e.clientX,h.clientY=e.clientY,r(i,t=h.isResize?this.resizeCrop():this.dragCrop())||l(o(t,c.width,c.height),a(t,c.width,c.height))};onComponentKeyDown=t=>{let{crop:i,disabled:r,onChange:l,onComplete:s}=this.props;if(r)return;let c=t.key,h=!1;if(!i)return;let d=this.getBox(),u=this.makePixelCrop(d),m=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===c?(u.x-=m,h=!0):"ArrowRight"===c?(u.x+=m,h=!0):"ArrowUp"===c?(u.y-=m,h=!0):"ArrowDown"===c&&(u.y+=m,h=!0),h){t.cancelable&&t.preventDefault(),u.x=n(u.x,0,d.width-u.width),u.y=n(u.y,0,d.height-u.height);let e=o(u,d.width,d.height),i=a(u,d.width,d.height);l(e,i),s&&s(e,i)}};onHandlerKeyDown=(t,i)=>{var n,s;let c,{aspect:h=0,crop:d,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:f,onChange:w,onComplete:x}=this.props,y=this.getBox();if(u||!d||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let b=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,v=l((n=o(d,y.width,y.height),s=t.key,c={...n},"ArrowLeft"===s?"nw"===i?(c.x-=b,c.y-=b,c.width+=b,c.height+=b):"w"===i?(c.x-=b,c.width+=b):"sw"===i?(c.x-=b,c.width+=b,c.height+=b):"ne"===i?(c.y+=b,c.width-=b,c.height-=b):"e"===i?c.width-=b:"se"===i&&(c.width-=b,c.height-=b):"ArrowRight"===s&&("nw"===i?(c.x+=b,c.y+=b,c.width-=b,c.height-=b):"w"===i?(c.x+=b,c.width-=b):"sw"===i?(c.x+=b,c.width-=b,c.height-=b):"ne"===i?(c.y-=b,c.width+=b,c.height+=b):"e"===i?c.width+=b:"se"===i&&(c.width+=b,c.height+=b)),"ArrowUp"===s?"nw"===i?(c.x-=b,c.y-=b,c.width+=b,c.height+=b):"n"===i?(c.y-=b,c.height+=b):"ne"===i?(c.y-=b,c.width+=b,c.height+=b):"sw"===i?(c.x+=b,c.width-=b,c.height-=b):"s"===i?c.height-=b:"se"===i&&(c.width-=b,c.height-=b):"ArrowDown"===s&&("nw"===i?(c.x+=b,c.y+=b,c.width-=b,c.height-=b):"n"===i?(c.y+=b,c.height-=b):"ne"===i?(c.y+=b,c.width-=b,c.height-=b):"sw"===i?(c.x-=b,c.width+=b,c.height+=b):"s"===i?c.height+=b:"se"===i&&(c.width+=b,c.height+=b)),c),h,i,y.width,y.height,m,g,p,f);if(!r(d,v)){let e=a(v,y.width,y.height);w(v,e),x&&x(v,e)}};onDocPointerDone=e=>{let{crop:t,disabled:i,onComplete:n,onDragEnd:r}=this.props,l=this.getBox();this.unbindDocMove(),!(i||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,r&&r(e),n&&n(o(t,l.width,l.height),a(t,l.width,l.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))};onDragFocus=()=>{this.componentRef.current?.scrollTo(0,0)};getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),i=this.makePixelCrop(t),r=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return i.x=n(e.startCropX+r,0,t.width-i.width),i.y=n(e.startCropY+a,0,t.height-i.height),i}getPointRegion(e,t,i,n){let{evData:r}=this,a=r.clientX-e.x,o=r.clientY-e.y,l;return l=n&&t?"nw"===t||"n"===t||"ne"===t:o<r.startCropY,(i&&t?"nw"===t||"w"===t||"sw"===t:a<r.startCropX)?l?"nw":"sw":l?"ne":"se"}resolveMinDimensions(e,t,i=0,n=0){let r=Math.min(i,e.width),a=Math.min(n,e.height);return t&&(r||a)?t>1?r?[r,r/t]:[a*t,a]:a?[a*t,a]:[r,r/t]:[r,a]}resizeCrop(){let{evData:t}=this,{aspect:i=0,maxWidth:r,maxHeight:a}=this.props,o=this.getBox(),[s,c]=this.resolveMinDimensions(o,i,this.props.minWidth,this.props.minHeight),h=this.makePixelCrop(o),d=this.getPointRegion(o,t.ord,s,c),u=t.ord||d,m=t.clientX-t.startClientX,g=t.clientY-t.startClientY;(s&&"nw"===u||"w"===u||"sw"===u)&&(m=Math.min(m,-s)),(c&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-c));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===d?(p.x=t.startCropX,p.width=m,i?p.height=p.width/i:p.height=Math.abs(g),p.y=t.startCropY-p.height):"se"===d?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,i?p.height=p.width/i:p.height=g):"sw"===d?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),i?p.height=p.width/i:p.height=g):"nw"===d&&(p.x=t.startCropX+m,p.width=Math.abs(m),i?(p.height=p.width/i,p.y=t.startCropY-p.height):(p.height=Math.abs(g),p.y=t.startCropY+g));let f=l(p,i,d,o.width,o.height,s,c,r,a);return i||e.xyOrds.indexOf(u)>-1?h=f:e.xOrds.indexOf(u)>-1?(h.x=f.x,h.width=f.width):e.yOrds.indexOf(u)>-1&&(h.y=f.y,h.height=f.height),h.x=n(h.x,0,o.width-h.width),h.y=n(h.y,0,o.height-h.height),h}renderCropSelection(){let{ariaLabels:i=e.defaultProps.ariaLabels,disabled:n,locked:r,renderSelectionAddon:a,ruleOfThirds:o,crop:l}=this.props,s=this.getCropStyle();if(l)return t.default.createElement("div",{style:s,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":i.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!r&&t.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},t.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),t.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":i.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":i.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":i.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":i.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":i.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":i.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":i.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),t.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":i.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&t.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&t.default.createElement(t.default.Fragment,null,t.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),t.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return o({...i,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:i,circularCrop:n,className:r,crop:a,disabled:o,locked:l,style:s,ruleOfThirds:c}=this.props,{cropIsActive:h,newCropIsBeingDrawn:d}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",r,h&&"ReactCrop--active",o&&"ReactCrop--disabled",l&&"ReactCrop--locked",d&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&n&&"ReactCrop--circular-crop",a&&c&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return t.default.createElement("div",{ref:this.componentRef,className:m,style:s},t.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},i),a?t.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},t.default.createElement("defs",null,t.default.createElement("mask",{id:`hole-${this.instanceId}`},t.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),n?t.default.createElement("ellipse",{cx:`${a.x+a.width/2}${a.unit}`,cy:`${a.y+a.height/2}${a.unit}`,rx:`${a.width/2}${a.unit}`,ry:`${a.height/2}${a.unit}`,fill:"black"}):t.default.createElement("rect",{x:`${a.x}${a.unit}`,y:`${a.y}${a.unit}`,width:`${a.width}${a.unit}`,height:`${a.height}${a.unit}`,fill:"black"}))),t.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};e.s(["f",0,h])},469937,e=>{var t=e.i(843476),i=e.i(786563),n=e.i(111110),r=e.i(975157);let a=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:o,disabled:l,size:s="sm",showUnrated:c=!0,className:h}){let{t:d}=(0,n.b)(),u=e??0,m="sm"===s?"h-3.5 w-3.5":"h-5 w-5",g=u?d.difficulty.starsLabel.replace("{n}",String(u)):d.difficulty.unrated;return o?(0,t.jsxs)("span",{className:(0,r.f)("inline-flex items-center gap-0.5",h),role:"group","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:d.difficulty.clearHint,children:[a.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>o(e===u?null:e),"aria-label":d.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=u,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(i.f,{className:(0,r.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!u&&c&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:d.difficulty.unrated})]}):u?(0,t.jsx)("span",{className:(0,r.f)("inline-flex items-center",h),role:"img","aria-label":`${d.difficulty.label}${d.common.colon}${g}`,title:g,children:a.map(e=>(0,t.jsx)(i.f,{className:(0,r.f)(m,e<=u?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):c?(0,t.jsx)("span",{className:(0,r.f)("text-xs text-muted-foreground",h),children:d.difficulty.unrated}):null}])},12130,271945,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(232660),r=e.i(519455),a=e.i(776639),o=e.i(263676),l=e.i(111110);async function s(e,t){let{naturalWidth:i,naturalHeight:n}=e;return Promise.all(t.map(t=>new Promise((r,a)=>{let o=document.createElement("canvas"),l=Math.round(t.x*i),s=Math.round(t.y*n);o.width=Math.max(1,Math.round(t.width*i)),o.height=Math.max(1,Math.round(t.height*n));let c=o.getContext("2d");c?(c.drawImage(e,l,s,o.width,o.height,0,0,o.width,o.height),o.toBlob(e=>e?r(e):a(Error("Canvas is empty")),"image/jpeg",.95)):a(Error("Canvas is not supported"))})))}let c={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},h=(0,i.forwardRef)(function({imageSrc:e,regions:n,onChange:r,imageStyle:a=c,onImageLoad:s},h){let{t:d}=(0,l.b)(),u=(0,i.useRef)(null),m=(0,i.useRef)(null),[g,p]=(0,i.useState)(null),f=e=>{let t=u.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},w=()=>{g&&g.width>=.02&&g.height>=.02&&r([...n,g]),m.current=null,p(null)},x=e=>({left:`${100*e.x}%`,top:`${100*e.y}%`,width:`${100*e.width}%`,height:`${100*e.height}%`});return(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)("img",{ref:h,src:e,alt:"",draggable:!1,style:a,onLoad:s,className:"block"}),(0,t.jsxs)("div",{ref:u,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(u.current?.setPointerCapture(e.pointerId),m.current=f(e),p(null))},onPointerMove:e=>{var t,i,n,r;let a,o,l;if(!m.current)return;let s=f(e);p((t=m.current.x,i=m.current.y,n=s.x,r=s.y,o=(a=e=>Math.min(1,Math.max(0,e)))(Math.min(t,n)),l=a(Math.min(i,r)),{x:o,y:l,width:a(Math.max(t,n))-o,height:a(Math.max(i,r))-l}))},onPointerUp:w,onPointerCancel:w,children:[n.map((e,i)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:x(e),children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bg-sky-500 px-1.5 text-xs font-bold text-white",children:i+1}),(0,t.jsx)("button",{type:"button",className:"absolute -right-3 -top-3 flex h-6 w-6 items-center justify-center rounded-full bg-red-500 text-white shadow","aria-label":d.batchImport.removeRegion.replace("{index}",String(i+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>r(n.filter((e,t)=>t!==i)),children:(0,t.jsx)(o.X,{className:"h-3 w-3"})})]},i)),g&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:x(g)})]})]})});var d=e.i(456420);let u={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};u.node;let m=(0,d.f)(u),g={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};g.node;let p=(0,d.f)(g);function f({zoom:e,onZoomIn:i,onZoomOut:n,onReset:r}){let{t:a}=(0,l.b)(),o="outline-none focus-visible:ring-2 focus-visible:ring-white/70",s=`flex h-9 w-9 items-center justify-center rounded-full text-white transition-colors hover:bg-white/20 disabled:opacity-40 disabled:hover:bg-transparent ${o}`;return(0,t.jsxs)("div",{className:"flex items-center gap-0.5 rounded-full bg-black/60 p-1 shadow-lg backdrop-blur-sm",children:[(0,t.jsx)("button",{type:"button",className:s,onClick:n,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsxs)("button",{type:"button",className:`h-9 min-w-14 rounded-full px-2 text-center text-xs font-medium tabular-nums text-white hover:bg-white/20 ${o}`,onClick:r,"aria-label":a.common.cropper.resetZoom,title:a.common.cropper.resetZoom,children:[Math.round(100*e),"%"]}),(0,t.jsx)("button",{type:"button",className:s,onClick:i,disabled:e>=5,"aria-label":a.common.cropper.zoomIn,title:a.common.cropper.zoomIn,children:(0,t.jsx)(m,{className:"h-4 w-4"})})]})}var w=e.i(201276),x=e.i(804536);let y="image-cropper-mode",b=["single","auto","multi"];e.s(["U",0,b,"p",0,y,"S",0,["image","text","file","direct"],"c",0,"question-input-mode","k",0,["image","text"]],271945);let v={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}};e.s(["f",0,function({imageSrc:e,open:o,onClose:c,onCropComplete:d,onMultiCropComplete:u,onRegionsSelected:m,allowMulti:g=!0,onAutoSplit:p,onAddPart:C,partCount:k=0}){let{t:j}=(0,l.b)(),D=/^(blob:|data:image\/)/i.test(e)?e:void 0,[M,E]=(0,i.useState)(),_=(0,i.useRef)(null),[N,R]=(0,x.y)(y,b,"single"),S=["single",...p?["auto"]:[],...u||m&&g?["multi"]:[]],L=S.includes(N)?N:"single",{containerRef:I,zoom:P,imageStyle:z,measureImage:$,zoomIn:H,zoomOut:A,reset:B}=function(e){let[t,n]=(0,i.useState)(null),r=(0,i.useRef)(null),a=(0,i.useCallback)(e=>{r.current=e,n(e)},[]),[o,l]=(0,i.useState)(1),s=(0,i.useRef)(1),[c,h]=(0,i.useState)(null),d=(0,i.useRef)(null),u=(0,i.useRef)(!1),m=(0,i.useCallback)((e,t,i)=>{let n=r.current,a=s.current,o=Math.min(5,Math.max(1,e));if(!n||o===a)return;if(1===a){let e=n.querySelector("img");e&&h(e.clientWidth)}let c=n.getBoundingClientRect(),u=(t??c.left+c.width/2)-c.left,m=(i??c.top+c.height/2)-c.top;d.current={viewX:u,viewY:m,contentX:n.scrollLeft+u,contentY:n.scrollTop+m,ratio:o/a},s.current=o,l(o)},[]);(0,i.useLayoutEffect)(()=>{let e=r.current,t=d.current;e&&t&&(e.scrollLeft=t.contentX*t.ratio-t.viewX,e.scrollTop=t.contentY*t.ratio-t.viewY,d.current=null)},[o]),(0,i.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(s.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},i=null,n=e=>{let[t,i]=[e[0],e[1]];return{distance:Math.hypot(t.clientX-i.clientX,t.clientY-i.clientY),centerX:(t.clientX+i.clientX)/2,centerY:(t.clientY+i.clientY)/2}},r=e=>{2===e.touches.length&&(i={distance:n(e.touches).distance,zoom:s.current},u.current=!0)},a=e=>{if(!i||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:r,centerY:a}=n(e.touches);i.distance>0&&m(i.zoom*(t/i.distance),r,a)},o=e=>{e.touches.length<2&&(i=null,u.current=!1)},l=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",r,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",l,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",r),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",l,{capture:!0})}},[t,m]);let g=(0,i.useCallback)(e=>{e&&1===s.current&&h(e.clientWidth)},[]),p=(0,i.useCallback)(()=>m(1.25*s.current),[m]),f=(0,i.useCallback)(()=>m(s.current/1.25),[m]),w=(0,i.useCallback)(()=>{s.current=1,d.current=null,l(1)},[]),x=1!==o&&c?{...e,width:c*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:f,reset:w}}(v[L]);(0,i.useEffect)(()=>{B()},[e,B]);let[Y,O]=(0,i.useState)({src:e,regions:[]}),X=Y.src===e?Y.regions:[],U=t=>O({src:e,regions:t}),K=(0,i.useRef)(null),F={single:j.batchImport.singleMode,auto:j.batchImport.autoMode,multi:j.batchImport.multiMode},T=async()=>{if(0!==X.length){if(m){m(X,!0),U([]);return}if(K.current&&u)try{u(await s(K.current,X)),U([])}catch(e){w.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},G=()=>M&&M.width>0&&M.height>0?{x:M.x/100,y:M.y/100,width:M.width/100,height:M.height/100}:{x:0,y:0,width:1,height:1},W=async()=>{let e=G();if("auto"===L&&p)return void p(e);if(m)return void m([e],!1);if(_.current&&d)try{let[t]=await s(_.current,[e]);d(t)}catch(e){w.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(a.N,{open:o,onOpenChange:e=>!e&&c(),children:(0,t.jsxs)(a.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(a.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(a.F,{children:j.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:I,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===L?(0,t.jsx)(h,{ref:K,imageSrc:D,regions:X,onChange:U,imageStyle:z,onImageLoad:e=>$(e.currentTarget)}):(0,t.jsx)(n.f,{crop:M,onChange:(e,t)=>E(t),children:(0,t.jsx)("img",{ref:_,alt:"Crop me",src:D,onLoad:function(e){E({unit:"%",x:0,y:0,width:100,height:100}),$(e.currentTarget)},style:z})})})}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(f,{zoom:P,onZoomIn:H,onZoomOut:A,onReset:B})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[S.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===S.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:S.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":L===e,onClick:()=>{B(),R(e)},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${L===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:F[e]},e))}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"multi"===L?`${j.batchImport.hint} ${j.batchImport.regionCount.replace("{count}",String(X.length))}`:"auto"===L?j.batchImport.autoHint:k>0?j.upload.parts.cropHint.replace("{n}",String(k+1)):j.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end",children:["multi"===L&&X.length>0&&(0,t.jsx)(r.f,{variant:"ghost",onClick:()=>U([]),children:j.batchImport.clear}),(0,t.jsx)(r.f,{variant:"outline",onClick:c,children:j.common.cancel||"Cancel"}),"multi"===L?(0,t.jsx)(r.f,{onClick:T,disabled:0===X.length,children:j.batchImport.start.replace("{count}",String(X.length))}):(0,t.jsxs)(t.Fragment,{children:["single"===L&&C&&(0,t.jsx)(r.f,{variant:"secondary",onClick:()=>C(G()),"data-testid":"crop-add-part",children:j.upload.parts.addNext}),(0,t.jsx)(r.f,{onClick:W,children:"auto"===L?j.batchImport.autoStart:k>0?j.upload.parts.confirm.replace("{count}",String(k+1)):j.common.confirm||"Confirm"})]})]})]})]})]})})}],12130)},141176,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(456420);let r={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};r.node;let a=(0,n.f)(r);var o=e.i(772382),l=e.i(511445),s=e.i(624687),c=e.i(111110),h=e.i(975157);e.s(["f",0,function({value:e,onChange:n,className:r,...d}){let{t:u}=(0,c.b)(),[m,g]=(0,i.useState)("source"),p=(0,i.useId)(),f=[{mode:"source",label:u.markdownEditor.source,icon:a},{mode:"preview",label:u.markdownEditor.preview,icon:o.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":u.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:f.map(({mode:e,label:i,icon:n})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":m===e,"aria-controls":p,onClick:()=>g(e),className:(0,h.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",m===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(n,{className:"h-3.5 w-3.5"}),i]},e))})}),(0,t.jsx)("div",{id:p,role:"tabpanel",children:"source"===m?(0,t.jsx)(s.f,{value:e,onChange:e=>n(e.target.value),className:r,...d}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>g("source"),title:u.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:u.markdownEditor.empty})})})]})}],141176)},438465,674166,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(967489),r=e.i(856423),a=e.i(41931),o=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:s,className:c}){let[h,d]=(0,i.useState)([]),{t:u}=(0,l.b)();return(0,i.useEffect)(()=>{(async()=>{try{let e=await a.k.get("/api/notebooks");d(e)}catch(e){o.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(n.d,{value:e,onValueChange:s,children:[(0,t.jsx)(n.P,{className:c,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(n.U,{placeholder:u.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(n.r,{children:0===h.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:u.notebooks?.selector?.empty||"No notebooks available"}):h.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}],438465);var s=e.i(470279);e.s(["f",0,function({value:e,onChange:i,disabled:r}){let{groups:a,loading:o}=(0,s.f)(),l=a.filter(e=>e.isActive);return(0,t.jsxs)(n.d,{value:e,onValueChange:i,disabled:r||o,children:[(0,t.jsx)(n.P,{children:(0,t.jsx)(n.U,{placeholder:"选择卷别"})}),(0,t.jsx)(n.r,{children:l.map(e=>(0,t.jsx)(n.T,{value:e.id,children:e.name},e.id))})]})}],674166)},149704,e=>{var t=e.i(843476),i=e.i(111110),n=e.i(398019),r=e.i(184110),a=e.i(975157);let o={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:s,className:c}){let{t:h}=(0,i.b)();if(!e)return null;let d=(0,r.V)(l),u=(0,r.o)(s);return(0,t.jsx)("figure",{className:(0,a.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,n.d)(e),alt:h.figure.alt,className:(0,a.f)(o[u],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===u?{marginLeft:0,marginRight:"auto"}:"right"===u?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:d/100,maxWidth:`${Math.min(d,100)}%`}})})}])},574041,e=>{var t=e.i(843476),i=e.i(271645),n=e.i(263676),r=e.i(487486),a=e.i(793479),o=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:s,placeholder:c="Enter tags...",className:h="",enterHint:d,subject:u,gradeStage:m}){let[g,p]=(0,i.useState)(""),[f,w]=(0,i.useState)([]),[x,y]=(0,i.useState)(!1),[b,v]=(0,i.useState)(0),C=(0,i.useRef)(null),k=(0,i.useRef)(null),j=(0,i.useCallback)(async t=>{try{let i=new URLSearchParams({q:t});u&&i.append("subject",u),m&&i.append("stage",m);let n=((await o.k.get(`/api/tags/suggestions?${i.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));w(n.slice(0,20)),y(n.length>0),v(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,i.useEffect)(()=>{g.trim()&&j(g)},[g,j]);let D=t=>{t.trim()&&!e.includes(t.trim())&&(s([...e,t.trim()]),p(""),w([]),y(!1),v(0))},M=t=>{s(e.filter(e=>e!==t))};return(0,i.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||C.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${h}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(r.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>M(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(n.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(a.f,{ref:C,type:"text",value:g,onChange:e=>{p(e.target.value),e.target.value.trim()||(w([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),b>=0&&f[b]?D(f[b]):g.trim()&&D(g)):"ArrowDown"===t.key?(t.preventDefault(),v(e=>Math.min(e+1,f.length-1))):"ArrowUp"===t.key?(t.preventDefault(),v(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),v(0)):"Backspace"===t.key&&!g&&e.length>0&&M(e[e.length-1])},onFocus:()=>{f.length>0&&y(!0)},placeholder:0===e.length?c:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&f.length>0&&(0,t.jsx)("div",{ref:k,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:f.map((e,i)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${i===b?"bg-accent":""}`,onClick:()=>D(e),onMouseEnter:()=>v(i),children:e},e))}),g&&!x&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:d?`${d} "${g}"`:`Press Enter to create "${g}"`})]})}])},184110,e=>{let t=["left","center","right"],i="center";function n(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,i,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,n,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:i},"V",0,function(e){return n(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},804536,e=>{var t=e.i(271645);let i=new Map,n=new Set;function r(e){return n.add(e),window.addEventListener("storage",e),()=>{n.delete(e),window.removeEventListener("storage",e)}}function a(e,a,o){let l=(0,t.useSyncExternalStore)(r,()=>(function(e){if(i.has(e))return i.get(e)??null;try{return window.localStorage.getItem(e)}catch{return null}})(e),()=>null);return[(0,t.useMemo)(()=>a(l),[a,l]),(0,t.useCallback)(t=>(function(e,t){try{window.localStorage.setItem(e,t),i.delete(e)}catch{i.set(e,t)}n.forEach(e=>e())})(e,o(t)),[e,o])]}let o=e=>e;e.s(["y",0,function(e,i,n){return a(e,(0,t.useCallback)(e=>i.includes(e??"")?e:n,[i,n]),o)},"x",0,a])},213761,e=>{let t={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class i extends Error{code;format;constructor(e,t,i){super(e,void 0===i?void 0:{cause:i}),this.code=e,this.format=t,this.name="ImageDecodeError"}}let n=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),r=new Set(["mif1","msf1","mif2"]),a=new Set(["avif","avis"]);function o(e,i,n=t){let r=Math.min(1,n.maxLongEdge/Math.max(e,i),Math.sqrt(n.maxPixels/Math.max(1,e*i)));return{width:Math.max(1,Math.floor(e*r)),height:Math.max(1,Math.floor(i*r)),scale:r}}async function l(e){let t,i;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let n=await (t=URL.createObjectURL(e),(i=new Image).decoding="async",new Promise((e,n)=>{i.onload=()=>e(i),i.onerror=()=>n(Error("IMAGE_ELEMENT_DECODE_FAILED")),i.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!n.naturalWidth||!n.naturalHeight)throw Error("IMAGE_EMPTY");return n}async function s(t){let{heicTo:i}=await e.A(462684);return i({blob:t,type:"image/jpeg",quality:.95})}function c(e,t){return new Promise((i,n)=>{e.toBlob(e=>e?i(e):n(Error("CANVAS_EMPTY")),"image/jpeg",t)})}function h(e,t,i,n,r,a,o){let l,s=((l=document.createElement("canvas")).width=a,l.height=o,l),c=s.getContext("2d");if(!c)throw Error("CANVAS_UNSUPPORTED");return c.fillStyle="#ffffff",c.fillRect(0,0,a,o),c.imageSmoothingEnabled=!0,c.imageSmoothingQuality="high",c.drawImage(e,t,i,n,r,0,0,a,o),s}async function d(e,t){var d;let u,m=performance.now(),g=await e.arrayBuffer(),p=performance.now()-m,f=function(e){let t=(t,i)=>String.fromCharCode(...e.subarray(t,i));if(e.length>=3&&255===e[0]&&216===e[1]&&255===e[2])return"jpeg";if(e.length>=8&&137===e[0]&&"PNG"===t(1,4))return"png";if(e.length>=12&&"RIFF"===t(0,4)&&"WEBP"===t(8,12))return"webp";if(e.length>=6&&("GIF87a"===t(0,6)||"GIF89a"===t(0,6)))return"gif";if(e.length>=2&&"BM"===t(0,2))return"bmp";if(e.length>=12&&"ftyp"===t(4,8)){let i=Math.min(e.length,(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0||e.length),o=[t(8,12)];for(let e=16;e+4<=i;e+=4)o.push(t(e,e+4));if(o.some(e=>n.has(e)))return"heic";if(o.some(e=>a.has(e)))return"avif";if(o.some(e=>r.has(e)))return"heic"}return"unknown"}(new Uint8Array(g,0,Math.min(g.byteLength,64))),w=e.type||"",x=performance.now(),y="native",b=new Blob([g],{type:w||"application/octet-stream"});try{u=await l(b)}catch(e){if("heic"!==f)throw new i("unknown"===f?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",f,e);t?.();try{u=await l(await s(b)),y="heic"}catch(e){throw new i("HEIC_DECODE_FAILED",f,e)}}let{width:v,height:C}=(d=u)instanceof HTMLImageElement?{width:d.naturalWidth,height:d.naturalHeight}:{width:d.width,height:d.height};if(!v||!C)throw new i("IMAGE_DECODE_FAILED",f);let k=o(v,C,{maxLongEdge:1600,maxPixels:1/0}),j=await c(h(u,0,0,v,C,k.width,k.height),.85),D=URL.createObjectURL(j),M=performance.now()-x;return{source:u,width:v,height:C,format:f,decoder:y,previewUrl:D,sourceType:w,sourceBytes:e.size,timings:{read:Math.round(p),convert:Math.round(M)},dispose:()=>{URL.revokeObjectURL(D),u instanceof HTMLImageElement||u.close()}}}let u={x:0,y:0,width:1,height:1};async function m(e,i=u,n=t){var r;let a=performance.now(),l=e=>Math.min(1,Math.max(0,e)),s=Math.round(l(i.x)*e.width),d=Math.round(l(i.y)*e.height),g=Math.max(1,Math.min(e.width-s,Math.round(l(i.width)*e.width))),p=Math.max(1,Math.min(e.height-d,Math.round(l(i.height)*e.height))),f=o(g,p,n),w=h(e.source,s,d,g,p,f.width,f.height),x=performance.now()-a,y=performance.now(),b=n.startQuality,v=await c(w,b);for(let t=0;v.size>n.maxBytes&&t<12;t++)b-.05>=n.minQuality-1e-9?b=Math.round((b-.05)*100)/100:(f={width:Math.max(1,Math.floor(.85*f.width)),height:Math.max(1,Math.floor(.85*f.height)),scale:.85*f.scale},w=h(e.source,s,d,g,p,f.width,f.height)),v=await c(w,b);return{dataUrl:await (r=v,new Promise((e,t)=>{let i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>t(i.error??Error("READ_FAILED")),i.readAsDataURL(r)})),width:f.width,height:f.height,bytes:v.size,quality:b,timings:{crop:Math.round(x),compress:Math.round(performance.now()-y)}}}e.s(["K",0,t,"o",0,i,"N",0,function(e,t){return{sourceType:e.sourceType||e.format,sourceBytes:e.sourceBytes,sourceWidth:e.width,sourceHeight:e.height,outputWidth:t.width,outputHeight:t.height,outputBytes:t.bytes,decoder:e.decoder,quality:t.quality}},"p",0,d,"X",0,m])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,i="zh"){return("en"===i?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,i){return(i||"").trim()?"wrong_attempt":t(e)}])},401280,e=>{let t={single_choice:"single_choice",singlechoice:"single_choice","single choice":"single_choice","single-choice":"single_choice",multiple_choice:"multiple_choice",multiplechoice:"multiple_choice","multiple choice":"multiple_choice","multiple-choice":"multiple_choice",multichoice:"multiple_choice","multi choice":"multiple_choice",true_false:"true_false",truefalse:"true_false","true/false":"true_false","true false":"true_false","true-false":"true_false","true / false":"true_false",fill_blank:"fill_blank",fillblank:"fill_blank","fill in the blank":"fill_blank","fill-in-the-blank":"fill_blank",fillintheblank:"fill_blank",calculation:"calculation",solution:"solution",reading:"reading",cloze:"cloze",writing:"writing",other:"other",选择题:"single_choice",单项选择:"single_choice",单选:"single_choice",单选题:"single_choice",不定项:"multiple_choice",不定项选择:"multiple_choice",多项选择:"multiple_choice",多选:"multiple_choice",多选题:"multiple_choice",判断:"true_false",判断题:"true_false",是非:"true_false",是非题:"true_false",填空:"fill_blank",填空题:"fill_blank",口算:"calculation",计算:"calculation",计算题:"calculation",解答:"solution",解答题:"solution",应用:"solution",应用题:"solution",证明:"solution",证明题:"solution",简答:"solution",简答题:"solution",阅读:"reading",阅读理解:"reading",完形:"cloze",完形填空:"cloze",作文:"writing",写作:"writing",书面表达:"writing",其他:"other"};e.s(["O",0,"__none__","V",0,["single_choice","multiple_choice","true_false","fill_blank","calculation","solution","reading","cloze","writing","other"],"u",0,{single_choice:"Single Choice",multiple_choice:"Multiple Choice",true_false:"True / False",fill_blank:"Fill in the Blank",calculation:"Calculation",solution:"Solution",reading:"Reading Comprehension",cloze:"Cloze",writing:"Writing",other:"Other"},"H",0,{single_choice:"单选题",multiple_choice:"多选题",true_false:"判断题",fill_blank:"填空题",calculation:"计算题",solution:"解答题",reading:"阅读理解",cloze:"完形填空",writing:"写作",other:"其他"},"P",0,function(e){if("string"!=typeof e)return null;let i=e.trim().toLowerCase();return i?t[i]??null:null}])},597138,e=>{e.i(306831),e.s(["f",0,function(e){if(!e)return null;let t=e.toLowerCase();return t.includes("math")||t.includes("数学")?"math":t.includes("physics")||t.includes("物理")?"physics":t.includes("chemistry")||t.includes("化学")?"chemistry":t.includes("biology")||t.includes("生物")?"biology":t.includes("english")||t.includes("英语")?"english":t.includes("chinese")||t.includes("语文")?"chinese":t.includes("history")||t.includes("历史")?"history":t.includes("geography")||t.includes("地理")?"geography":t.includes("politics")||t.includes("政治")?"politics":null}])}])})();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,[711241,e=>{var s=e.i(456420);let t={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],711241)},508734,e=>{var s=e.i(456420);let t={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"}]]};t.node;let i=(0,s.f)(t);e.s(["f",0,i],508734)},590546,e=>{var s=e.i(843476),t=e.i(618566),i=e.i(519455),a=e.i(711241);e.s(["f",0,function({fallbackUrl:e,className:n}){let r=(0,t.useRouter)();return(0,s.jsx)(i.f,{variant:"ghost",size:"icon",onClick:()=>{r.push(e)},className:n,children:(0,s.jsx)(a.f,{className:"h-5 w-5"})})}])},912505,e=>{var s=e.i(843476),t=e.i(975157);e.s(["f",0,function({icon:e,title:i,description:a,action:n,className:r}){return(0,s.jsxs)("div",{className:(0,t.f)("flex flex-col items-center justify-center rounded-2xl border border-dashed bg-card/50 px-6 py-14 text-center",r),children:[(0,s.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-accent text-accent-foreground",children:(0,s.jsx)(e,{className:"h-7 w-7"})}),(0,s.jsx)("p",{className:"font-medium",children:i}),a&&(0,s.jsx)("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:a}),n&&(0,s.jsx)("div",{className:"mt-5",children:n})]})}])},393842,e=>{var s=e.i(843476),t=e.i(590546),i=e.i(975157);e.s(["f",0,function({title:e,description:a,backHref:n,actions:r,titleAddon:c,className:l}){return(0,s.jsxs)("div",{className:(0,i.f)("flex items-start gap-3",l),children:[n&&(0,s.jsx)(t.f,{fallbackUrl:n,className:"-ml-2 shrink-0"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("h1",{className:"truncate text-2xl font-bold tracking-tight sm:text-3xl",children:e}),c]}),a&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground sm:text-base",children:a})]}),r&&(0,s.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:r})]})}])},86963,e=>{var s=e.i(843476),t=e.i(632781);e.s(["f",0,function({label:e}){return(0,s.jsxs)("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-3 text-muted-foreground",children:[(0,s.jsx)(t.f,{className:"h-7 w-7 animate-spin text-primary"}),e&&(0,s.jsx)("p",{className:"text-sm",children:e})]})}])},35209,e=>{var s=e.i(271645),t=e.i(111110);e.s(["f",0,function(...e){let{t:i}=(0,t.b)(),a=[i.pageTitle.base,...e.map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0)].join("-");(0,s.useEffect)(()=>{document.title=a},[a])}])}],462684,e=>{e.v(s=>Promise.all(["static/chunks/2hh64gi4pmlk2.js"].map(s=>e.l(s))).then(()=>s(506175)))}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,367784,e=>{var i=e.i(456420);let s={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};s.node;let a=(0,i.f)(s);e.s(["f",0,a],367784)},713452,753817,e=>{var i=e.i(843476),s=e.i(271645),a=e.i(551757),t=e.i(632781),n=e.i(583967),r=e.i(456420);let l={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};l.node;let o=(0,r.f)(l);var d=e.i(519455),c=e.i(111110);function m({detail:e}){let{t:s}=(0,c.b)();return e?(0,i.jsxs)("p",{className:"mt-1 rounded bg-background/60 px-2 py-1 font-mono text-[11px] leading-relaxed text-red-700 dark:text-red-300 break-all select-text",children:[(0,i.jsx)("span",{className:"font-sans text-muted-foreground",children:s.settings.ai.providerErrorDetail}),e]}):null}e.s(["f",0,m],753817);var x=e.i(128093),p=e.i(41931),u=e.i(303163),h=e.i(201276);e.s(["f",0,function({config:e,saving:r,saveButton:l}){let{t:f,language:g}=(0,c.b)(),[j,v]=(0,s.useState)(!1),[y,N]=(0,s.useState)(null),b=e=>f.settings?.ai?.errors?.[e]||e.replace("UNKNOWN:",""),k=async()=>{let i=function(e,i){let s=e.aiProvider;if("openai"===s){let a=e.openai?.instances?.find(i=>i.id===e.openai?.activeInstanceId);return a?.apiKey?{ok:!0,body:{provider:s,apiKey:a.apiKey,baseUrl:a.baseUrl,model:a.model,language:i}}:{ok:!1,error:"API_KEY_REQUIRED"}}if("azure"===s){let a=e.azure;return a?.apiKey&&a.endpoint&&a.deploymentName?{ok:!0,body:{provider:s,apiKey:a.apiKey,endpoint:a.endpoint,deploymentName:a.deploymentName,apiVersion:a.apiVersion,model:a.model,language:i}}:{ok:!1,error:"AZURE_CONFIG_INCOMPLETE"}}if("minimax-code"===s)return{ok:!0,body:{provider:s,model:e.minimaxCode?.model,language:i}};if("gemini"===s||"anthropic"===s||(0,x.j)(s)){let a=e[s];return a?.apiKey?{ok:!0,body:{provider:s,apiKey:a.apiKey,baseUrl:a.baseUrl,model:a.model,language:i}}:{ok:!1,error:"API_KEY_REQUIRED"}}return{ok:!1,error:"UNSUPPORTED_PROVIDER"}}(e,g);if(!i.ok){if("UNSUPPORTED_PROVIDER"===i.error)return;N({success:!1,textSupport:!1,visionSupport:!1,textError:"AZURE_CONFIG_INCOMPLETE"===i.error?f.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete":f.settings?.ai?.validationApiKeyRequired||"API Key is required"});return}v(!0),N(null);try{N(await p.k.post("/api/ai/test",i.body))}catch(e){h.V.error("[AiConnectionTest]","AI connection test failed",{error:e}),N({success:!1,textSupport:!1,visionSupport:!1,textError:(0,u.Z)(e)})}finally{v(!1)}};return(0,i.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsxs)(d.f,{type:"button",variant:"outline",onClick:k,disabled:j||r,className:"flex-1",children:[j?(0,i.jsx)(t.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,i.jsx)(o,{className:"mr-2 h-4 w-4"}),j?f.settings?.ai?.testing||"Testing...":f.settings?.ai?.testConnection||"Test Connection"]}),l]}),y&&(0,i.jsxs)("div",{className:`p-3 rounded-md text-sm ${y.success?"bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-900":"bg-red-50 dark:bg-red-950/40 border border-red-200 dark:border-red-900"}`,children:[(0,i.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:y.success?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.f,{className:"h-4 w-4 text-green-600"}),(0,i.jsx)("span",{className:"text-green-700 dark:text-green-300",children:f.settings?.ai?.testSuccess||"Connection Successful"}),y.modelInfo&&(0,i.jsxs)("span",{className:"text-green-600 text-xs",children:["(",y.modelInfo,")"]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.f,{className:"h-4 w-4 text-red-600"}),(0,i.jsx)("span",{className:"text-red-700 dark:text-red-300",children:f.settings?.ai?.testFailed||"Connection Failed"})]})}),y.success&&(0,i.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsxs)("span",{className:"text-muted-foreground",children:[f.settings?.ai?.textSupport||"Text Generation",":"]}),(0,i.jsxs)("span",{className:"text-green-600",children:["✓ ",f.settings?.ai?.supported||"Supported"]})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsxs)("span",{className:"text-muted-foreground",children:[f.settings?.ai?.visionSupport||"Vision/Multimodal",":"]}),y.visionSupport?(0,i.jsxs)("span",{className:"text-green-600",children:["✓ ",f.settings?.ai?.supported||"Supported"]}):(0,i.jsxs)("span",{className:"text-amber-600",children:["✗ ",y.visionError?b(y.visionError):f.settings?.ai?.notSupported||"Not Supported"]})]}),!y.visionSupport&&(0,i.jsx)(m,{detail:y.visionErrorDetail}),(0,i.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:f.settings?.ai?.testNetworkNote})]}),!y.success&&y.textError&&(0,i.jsx)("p",{className:"text-red-600 text-xs mt-1",children:b(y.textError)}),!y.success&&(0,i.jsx)(m,{detail:y.textErrorDetail})]})]})}],713452)},10038,835467,e=>{var i=e.i(843476),s=e.i(632781),a=e.i(519455),t=e.i(110204),n=e.i(967489),r=e.i(713452),l=e.i(459649),o=e.i(118585),d=e.i(75977),c=e.i(482022),m=e.i(97923),x=e.i(367784),p=e.i(741120),u=e.i(487486),h=e.i(793479),f=e.i(975153),g=e.i(699375),j=e.i(111110),v=e.i(215519),y=e.i(306831);function N({checkin:e,autoCheckin:n,onAutoCheckinChange:r,busy:l,onCheckin:o}){let d,{t:c}=(0,j.b)(),{timeZone:m}=(0,v.M)(),x=c.settings?.ai?.minimaxCode,{today:p,last:h}=e,b=h&&"failed"!==h.status?h:null,k=!!(p?.checkedToday||b),C=String(b?.points??(p?p.points+p.bonusPoints:0)),w=String(b?.streakDays??p?.streakDays??0);return d=b?.trigger==="auto"&&"checked-in"===b.status?(x?.checkinAuto||"Checked in automatically today at {time} (+{points} credits, day {days} in a row)").replace("{time}",(0,y.r)(b.at,"HH:mm",m)).replace("{points}",C).replace("{days}",w):k?(x?.checkinDone||"Checked in today (+{points} credits, day {days} in a row)").replace("{points}",C).replace("{days}",w):h?.status==="failed"?(x?.checkinFailed||"Check-in failed: {error}").replace("{error}",h.error||""):e.autoCheckin?x?.checkinWillAuto||"Not checked in yet today. The app will check in automatically within the hour.":x?.checkinNotYet||"Not checked in yet today",(0,i.jsxs)("div",{className:"space-y-3 border-t pt-3",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,i.jsx)("span",{className:"text-muted-foreground",children:x?.checkinToday||"Today's check-in"}),(0,i.jsxs)(u.f,{variant:k?"default":h?.status==="failed"?"destructive":"secondary",children:[(0,i.jsx)(f.f,{className:"mr-1 h-3 w-3"}),k?x?.checkinSuccess||"Checked in":x?.checkinNotYet||"Not yet"]})]}),!k&&(0,i.jsxs)(a.f,{size:"sm",variant:"outline",onClick:o,disabled:l,children:[l&&(0,i.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),x?.checkinNow||"Check in now"]})]}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground break-words",children:d}),(0,i.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,i.jsxs)("div",{className:"space-y-1",children:[(0,i.jsx)(t.f,{htmlFor:"minimax-code-auto-checkin",children:x?.autoCheckin||"Daily auto check-in"}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:x?.autoCheckinHint})]}),(0,i.jsx)(g.f,{id:"minimax-code-auto-checkin",checked:n,onCheckedChange:r})]})]})}let b=["MiniMax-M3.1-Flash","MiniMax-M3","MiniMax-M2.7-highspeed","MiniMax-M2.7"];var k=e.i(271645),C=e.i(41931),w=e.i(303163),K=e.i(294114),S=e.i(201276);function M({value:e,onChange:n}){let{t:r}=(0,j.b)(),l=r.settings?.ai?.minimaxCode,{status:o,loading:d,pending:f,busy:g,refresh:v,login:y,logout:U,checkin:I}=function(){let{t:e}=(0,j.b)(),i=e.settings?.ai?.minimaxCode,[s,a]=(0,k.useState)(null),[t,n]=(0,k.useState)(!0),[r,l]=(0,k.useState)(null),[o,d]=(0,k.useState)(!1),c=(0,k.useRef)(null),m=(0,k.useCallback)(async()=>{n(!0);try{let e=await C.k.get("/api/minimax-code");a(e),e.pendingLogin&&l(e.pendingLogin)}catch(e){S.V.error("[MiniMaxCode]","Failed to load status",{error:e})}finally{n(!1)}},[]);(0,k.useEffect)(()=>{m()},[m]),(0,k.useEffect)(()=>{if(!r)return;let e=!1,s=async()=>{try{let a=await C.k.get("/api/minimax-code/login");if(e)return;if("pending"===a.status){c.current=setTimeout(s,r.intervalMs);return}l(null),"ok"===a.status?K.c.success(i?.loginSuccess||"Signed in"):"expired"===a.status?K.c.error(i?.loginExpired||"Authorization timed out"):"denied"===a.status&&K.c.error(i?.loginDenied||"Authorization declined"),m()}catch(s){if(e)return;l(null),K.c.error(`${i?.loginFailed||"Sign-in failed"}: ${(0,w.Z)(s)}`)}};return c.current=setTimeout(s,r.intervalMs),()=>{e=!0,c.current&&clearTimeout(c.current)}},[r,m,i]);let x=async()=>{d(!0);try{await C.k.delete("/api/minimax-code"),l(null),await m()}catch(e){K.c.error((0,w.Z)(e))}finally{d(!1)}},p=async()=>{d(!0);try{let e=await C.k.post("/api/minimax-code/checkin",{});"failed"===e.status?K.c.error((i?.checkinFailed||"Check-in failed: {error}").replace("{error}",e.error||"")):K.c.success(i?.checkinSuccess||"Checked in"),await m()}catch(e){K.c.error((0,w.Z)(e))}finally{d(!1)}};return{status:s,loading:t,pending:r,busy:o,refresh:m,login:async()=>{d(!0);try{let e=await C.k.post("/api/minimax-code/login",{});l(e),window.open(e.url,"_blank","noopener,noreferrer")}catch(e){K.c.error(`${i?.loginFailed||"Sign-in failed"}: ${(0,w.Z)(e)}`)}finally{d(!1)}},logout:x,checkin:p}}(),A=o?.login??"none",P=o?.account,z=o?.credits,E={none:l?.statusNone||"Not signed in",active:l?.statusActive||"Signed in",expired:l?.statusExpired||"Login expired"}[A];return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.intro}),(0,i.jsxs)("section",{className:"space-y-3 rounded-md border bg-background p-3","aria-label":l?.title||"MiniMax Code account",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.jsx)("h4",{className:"text-sm font-medium",children:l?.title||"MiniMax Code account"}),(0,i.jsx)(a.f,{variant:"ghost",size:"sm",onClick:()=>void v(),disabled:d,"aria-label":l?.refresh||"Refresh",children:(0,i.jsx)(p.f,{className:`h-4 w-4 ${d?"animate-spin":""}`})})]}),(0,i.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm",children:[(0,i.jsx)("dt",{className:"text-muted-foreground",children:l?.loginStatus||"Login status"}),(0,i.jsxs)("dd",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,i.jsx)(u.f,{variant:"active"===A?"default":"expired"===A?"destructive":"secondary",children:E}),P&&(0,i.jsx)("span",{className:"truncate text-muted-foreground",children:P.name||P.email||P.userId})]}),"active"===A&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("dt",{className:"text-muted-foreground",children:l?.credits||"Remaining credits"}),(0,i.jsx)("dd",{children:z?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"font-medium tabular-nums",children:z.total}),(0,i.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:(l?.creditsDetail||"Free {free} · Purchased {purchased}").replace("{free}",String(z.free)).replace("{purchased}",String(z.purchased))})]}):(0,i.jsx)("span",{className:"text-muted-foreground",children:l?.creditsUnavailable||"Unavailable"})})]})]}),"active"===A&&o&&(0,i.jsx)(N,{checkin:o.checkin,autoCheckin:e?.autoCheckin!==!1,onAutoCheckinChange:i=>n({...e,autoCheckin:i}),busy:g,onCheckin:()=>void I()}),f?(0,i.jsxs)("div",{className:"space-y-1 rounded-md bg-muted/50 p-3 text-sm",children:[(0,i.jsxs)("p",{className:"flex items-center gap-2",children:[(0,i.jsx)(s.f,{className:"h-4 w-4 animate-spin"}),l?.waiting]}),f.userCode&&(0,i.jsxs)("p",{children:[l?.userCode||"Verification code",": ",(0,i.jsx)("span",{className:"font-mono font-medium",children:f.userCode})]}),(0,i.jsxs)("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[l?.openLink||"Open the authorization page"," ",(0,i.jsx)(c.f,{className:"h-3 w-3"})]})]}):(0,i.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,i.jsxs)(a.f,{size:"sm",onClick:()=>void y(),disabled:g,children:[g?(0,i.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,i.jsx)(m.f,{className:"mr-2 h-4 w-4"}),"none"===A?l?.login||"Sign in with browser":l?.relogin||"Sign in again"]}),"none"!==A&&(0,i.jsxs)(a.f,{size:"sm",variant:"outline",onClick:()=>void U(),disabled:g,children:[(0,i.jsx)(x.f,{className:"mr-2 h-4 w-4"}),l?.logout||"Sign out"]})]})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{htmlFor:"minimax-code-model",children:l?.model||"Model"}),(0,i.jsx)(h.f,{id:"minimax-code-model",list:"minimax-code-models",value:e?.model||"",onChange:i=>n({...e,model:i.target.value}),placeholder:"MiniMax-M3.1-Flash"}),(0,i.jsx)("datalist",{id:"minimax-code-models",children:b.map(e=>(0,i.jsx)("option",{value:e},e))}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.modelHint})]}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:l?.risk})]})}var U=e.i(77071),I=e.i(759659),A=e.i(464034),P=e.i(434901),z=e.i(37038),E=e.i(62189);function T({value:e,onChange:s}){let{t:r}=(0,j.b)(),l=(0,E.f)("openai"),o=e?.instances||[],d=e?.activeInstanceId,c=o.find(e=>e.id===d),m=(i,a)=>{s({...e,instances:o.map(e=>e.id===d?{...e,[i]:a}:e)})},x=async()=>{if(!d||!await (0,K.u)(r.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0}))return;let e=o.filter(e=>e.id!==d);s({instances:e,activeInstanceId:e[0]?.id})};return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)(t.f,{children:r.settings?.ai?.instances||"Instance"}),(0,i.jsxs)(a.f,{type:"button",variant:"outline",size:"sm",onClick:()=>{if(o.length>=10)return;let e={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let i=16*Math.random()|0;return("x"===e?i:3&i|8).toString(16)}),name:`Instance ${o.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};s({instances:[...o,e],activeInstanceId:e.id})},disabled:o.length>=10,className:"h-7 px-2 text-xs",children:[(0,i.jsx)(U.f,{className:"h-3 w-3 mr-1"}),r.settings?.ai?.addInstance||"Add"]})]}),o.length>0?(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsxs)(n.d,{value:d||"",onValueChange:i=>s({...e,activeInstanceId:i}),children:[(0,i.jsx)(n.P,{className:"flex-1",children:(0,i.jsx)(n.U,{placeholder:r.settings?.ai?.selectInstance||"Select Instance"})}),(0,i.jsx)(n.r,{children:o.map(e=>(0,i.jsx)(n.T,{value:e.id,children:e.name},e.id))})]}),o.length>1&&(0,i.jsx)(a.f,{type:"button",variant:"outline",size:"icon",onClick:x,className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,i.jsx)(I.f,{className:"h-4 w-4"})})]}):(0,i.jsx)("p",{className:"text-sm text-muted-foreground",children:r.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),o.length>=10&&(0,i.jsx)("p",{className:"text-xs text-amber-600",children:r.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),c&&(0,i.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)(t.f,{children:[r.settings?.ai?.instanceName||"Instance Name"," ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(h.f,{value:c.name||"",onChange:e=>m("name",e.target.value),placeholder:"e.g. GLM-4V",className:c.name?.trim()?"":"border-destructive"})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(P.f,{label:(0,i.jsxs)(i.Fragment,{children:["API Key ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,i.jsx)(z.f,{value:c.apiKey||"",onChange:e=>m("apiKey",e.target.value),placeholder:"sk-...",className:c.apiKey?.trim()?"":"border-destructive"})]}),(0,i.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,i.jsxs)(t.f,{children:["Base URL ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(h.f,{value:c.baseUrl||"",onChange:e=>m("baseUrl",e.target.value),placeholder:"https://api.openai.com/v1",className:c.baseUrl?.trim()?"":"border-destructive"})]}),(0,i.jsx)(A.f,{provider:"openai",apiKey:c.apiKey,baseUrl:c.baseUrl,currentModel:c.model,onModelChange:e=>m("model",e),docsHref:l?.models})]})]})}function R({provider:e}){let{t:s}=(0,j.b)(),a=s.settings.ai.providerDocs,t=(0,E.f)(e);if(!t)return null;let n=[t.cn&&{href:t.cn,label:t.intl?a.cn:a.official},t.intl&&{href:t.intl,label:t.cn?a.intl:a.official}].filter(e=>!!e);return(0,i.jsxs)("p",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,i.jsx)("span",{children:a.title}),n.map(e=>(0,i.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 underline",children:[e.label,(0,i.jsx)(c.f,{className:"h-3 w-3"})]},e.href))]})}var F=e.i(128093);function D({provider:e,value:s,onChange:a}){let{t:n}=(0,j.b)(),r=F.$[e],l=(e,i)=>a({...s,[e]:i}),o={qwen:n.settings?.ai?.qwenBaseUrlHint,stepfun:n.settings?.ai?.stepfunBaseUrlHint,volcengine:n.settings?.ai?.volcengineBaseUrlHint,"volcengine-agent":n.settings?.ai?.volcengineAgentBaseUrlHint,"volcengine-coding":n.settings?.ai?.volcengineCodingBaseUrlHint};return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:["volcengine-free"===e&&(0,i.jsxs)("div",{className:"rounded-md border border-green-200 bg-green-50 p-3 text-xs text-green-800 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",children:[(0,i.jsx)("p",{className:"font-medium",children:n.settings.ai.volcengineFree.title}),(0,i.jsx)("p",{className:"mt-1",children:n.settings.ai.volcengineFree.body})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(P.f,{label:"API Key",href:r.docs.apiKey,linkText:n.settings.ai.docLinks.apiKey}),(0,i.jsx)(z.f,{value:s?.apiKey||"",onChange:e=>l("apiKey",e.target.value),placeholder:"sk-..."}),(0,i.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,i.jsx)("a",{href:r.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:r.consoleUrl})]})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"Base URL (Optional)"}),(0,i.jsx)(h.f,{value:s?.baseUrl||"",onChange:e=>l("baseUrl",e.target.value),placeholder:r.baseUrl}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:o[e]??n.settings?.ai?.vendorBaseUrlHint})]}),(0,i.jsx)(A.f,{provider:e,apiKey:s?.apiKey,baseUrl:s?.baseUrl,currentModel:s?.model||r.model,onModelChange:e=>l("model",e),docsHref:r.docs.models})]})}e.s(["f",0,function({config:e,setConfig:c,loading:m,saving:x,onSave:p}){let{t:u,language:h}=(0,j.b)();return m?(0,i.jsx)("div",{className:"flex justify-center py-4",children:(0,i.jsx)(s.f,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,i.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:u.settings?.tabs?.ai||"AI Provider"}),(0,i.jsxs)(n.d,{value:e.aiProvider,onValueChange:e=>c(i=>({...i,aiProvider:e})),children:[(0,i.jsx)(n.P,{children:(0,i.jsx)(n.U,{})}),(0,i.jsxs)(n.r,{children:[(0,i.jsx)(n.T,{value:"minimax",children:(0,F.z)("minimax",h)}),(0,i.jsx)(n.T,{value:"minimax-code",children:"MiniMax Code OAuth"}),F.U.filter(e=>"minimax"!==e).map(e=>(0,i.jsx)(n.T,{value:e,children:(0,F.z)(e,h)},e)),(0,i.jsx)(n.T,{value:"anthropic",children:"Anthropic / Compatible"}),(0,i.jsx)(n.T,{value:"azure",children:"Azure OpenAI"}),(0,i.jsx)(n.T,{value:"openai",children:"OpenAI / Compatible"}),(0,i.jsx)(n.T,{value:"gemini",children:"Google Gemini"})]})]}),(0,i.jsx)(R,{provider:e.aiProvider})]}),"openai"===e.aiProvider&&(0,i.jsx)(T,{value:e.openai,onChange:e=>c(i=>({...i,openai:e}))}),"gemini"===e.aiProvider&&(0,i.jsx)(d.f,{value:e.gemini,onChange:e=>c(i=>({...i,gemini:e}))}),"minimax-code"===e.aiProvider&&(0,i.jsx)(M,{value:e.minimaxCode,onChange:e=>c(i=>({...i,minimaxCode:e}))}),"anthropic"===e.aiProvider&&(0,i.jsx)(l.f,{value:e.anthropic,onChange:e=>c(i=>({...i,anthropic:e}))}),(0,F.j)(e.aiProvider)&&(0,i.jsx)(D,{provider:e.aiProvider,value:e[e.aiProvider],onChange:e=>c(i=>({...i,[i.aiProvider]:e}))},e.aiProvider),"azure"===e.aiProvider&&(0,i.jsx)(o.f,{value:e.azure,onChange:e=>c(i=>({...i,azure:e}))}),(0,i.jsx)(r.f,{config:e,saving:x,saveButton:(0,i.jsxs)(a.f,{onClick:p,disabled:x,className:"flex-1",children:[x&&(0,i.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),u.settings?.ai?.save||"Save AI Settings"]})})]})}],10038),e.s(["f",0,function(e,i){if(!(0,y.L)(e.timeZone??y.J))return i.settings.general.invalidTimeZone;if("openai"===e.aiProvider)for(let s of e.openai?.instances||[]){if(!s.name?.trim())return i.settings?.ai?.validationNameRequired||"Instance name is required";if(!s.apiKey?.trim())return i.settings?.ai?.validationApiKeyRequired||"API Key is required";if(!s.baseUrl?.trim())return i.settings?.ai?.validationBaseUrlRequired||"Base URL is required";if(!s.model?.trim())return i.settings?.ai?.validationModelRequired||"Model name is required"}if("azure"===e.aiProvider){if(!e.azure?.endpoint?.trim())return i.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(!e.azure?.deploymentName?.trim())return i.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required";if(!e.azure?.apiKey?.trim())return i.settings?.ai?.validationApiKeyRequired||"API Key is required"}return null}],835467)},459649,464034,434901,62189,118585,75977,97923,e=>{var i=e.i(843476),s=e.i(793479),a=e.i(37038),t=e.i(110204),n=e.i(271645),r=e.i(519455),l=e.i(967489),o=e.i(482022),d=e.i(741120),c=e.i(632781),m=e.i(41931),x=e.i(111110),p=e.i(128093),u=e.i(201276);function h({provider:e,apiKey:a,baseUrl:f,currentModel:g,onModelChange:j,docsHref:v}){let{t:y}=(0,x.b)(),[N,b]=(0,n.useState)([]),[k,C]=(0,n.useState)(!1),[w,K]=(0,n.useState)(null),[S,M]=(0,n.useState)(g||""),[U,I]=(0,n.useState)(!1),[A,P]=(0,n.useState)(g);g!==A&&(P(g),M(g||""));let z=async()=>{if(!a)return void K(y.modelSelector?.enterApiKeyFirst||"Please enter API Key first");C(!0),K(null);try{let i=await m.k.post("/api/ai/models",{provider:e,apiKey:a,...f&&{baseUrl:f}});if("error"in i&&"string"==typeof i.error){K(i.error),I(!0),b([]);return}b(i.models),0===i.models.length&&(K(y.modelSelector?.noVisionModel||"No vision model found, please enter manually"),I(!0))}catch(i){u.V.error("[ModelSelector]","Failed to fetch models",{error:i});let e=i instanceof Error&&i.message||y.modelSelector?.fetchFailed||"Failed to fetch models";K(e+(y.modelSelector?.enterManually||", please enter manually")),I(!0)}finally{C(!1)}};return(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)(t.f,{className:"flex-1",children:y.modelSelector?.modelName||"Model Name"}),v&&(0,i.jsxs)("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[y.settings.ai.docLinks.models,(0,i.jsx)(o.f,{className:"h-3 w-3"})]}),(0,i.jsx)(r.f,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:k||!a,children:k?(0,i.jsx)(c.f,{className:"h-3 w-3 animate-spin"}):(0,i.jsx)(d.f,{className:"h-3 w-3"})})]}),w&&(0,i.jsx)("p",{className:"text-xs text-yellow-600",children:w}),U||0===N.length?(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(s.f,{value:S,onChange:e=>{var i;M(i=e.target.value),j(i)},placeholder:(0,p.j)(e)?p.$[e].model:"openai"===e?"gpt-6.1-sol":"gemini-1.5-flash"}),N.length>0&&(0,i.jsx)(r.f,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>I(!1),children:y.modelSelector?.selectFromList||"Select from List"})]}):(0,i.jsx)("div",{className:"space-y-2",children:(0,i.jsxs)(l.d,{value:g,onValueChange:e=>{"_custom"===e?I(!0):(I(!1),M(e),j(e))},children:[(0,i.jsx)(l.P,{children:(0,i.jsx)(l.U,{placeholder:y.modelSelector?.selectModel||"Select Model"})}),(0,i.jsxs)(l.r,{children:[N.map(e=>(0,i.jsxs)(l.T,{value:e.id,children:[e.name,e.owned_by&&` (${e.owned_by})`]},e.id)),(0,i.jsx)(l.T,{value:"_custom",children:y.modelSelector?.customInput||"Custom Input..."})]})]})})]})}function f({label:e,href:s,linkText:a}){return s?(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.jsx)(t.f,{children:e}),(0,i.jsxs)("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground underline",children:[a,(0,i.jsx)(o.f,{className:"h-3 w-3"})]})]}):(0,i.jsx)(t.f,{children:e})}e.s(["f",0,h],464034),e.s(["f",0,f],434901);let g={openai:{intl:"https://platform.openai.com/docs/api-reference",apiKey:"https://platform.openai.com/docs/quickstart",models:"https://platform.openai.com/docs/models"},anthropic:{intl:"https://docs.anthropic.com/en/api/overview",apiKey:"https://docs.anthropic.com/en/api/getting-started",models:"https://docs.anthropic.com/en/docs/about-claude/models/overview"},azure:{intl:"https://learn.microsoft.com/azure/ai-foundry/openai/reference",apiKey:"https://learn.microsoft.com/azure/ai-foundry/openai/how-to/create-resource",models:"https://learn.microsoft.com/azure/ai-foundry/openai/concepts/models"},gemini:{intl:"https://ai.google.dev/gemini-api/docs",apiKey:"https://ai.google.dev/gemini-api/docs/api-key",models:"https://ai.google.dev/gemini-api/docs/models"}};function j(e){return(0,p.j)(e)?p.$[e].docs:g[e]??null}e.s(["f",0,j],62189),e.s(["f",0,function({value:e,onChange:n}){let{t:r}=(0,x.b)(),l=j("anthropic"),o=(i,s)=>n({...e,[i]:s});return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(f,{label:"API Key",href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,i.jsx)(a.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"sk-ant-..."})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"Base URL (Optional)"}),(0,i.jsx)(s.f,{value:e?.baseUrl||"",onChange:e=>o("baseUrl",e.target.value),placeholder:"https://api.anthropic.com"}),(0,i.jsx)("p",{className:"text-xs text-muted-foreground",children:r.settings?.ai?.anthropicBaseUrlHint})]}),(0,i.jsx)(h,{provider:"anthropic",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>o("model",e),docsHref:l?.models})]})}],459649),e.s(["f",0,function({value:e,onChange:n}){let{t:r}=(0,x.b)(),l=j("azure"),o=(i,s)=>n({...e,[i]:s}),d=e=>e?.trim()?"":"border-destructive";return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)(t.f,{children:[r.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,i.jsx)(s.f,{value:e?.endpoint||"",onChange:e=>o("endpoint",e.target.value),placeholder:r.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:d(e?.endpoint)})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(f,{label:(0,i.jsxs)(i.Fragment,{children:[r.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.models,linkText:r.settings.ai.docLinks.models}),(0,i.jsx)(s.f,{value:e?.deploymentName||"",onChange:e=>o("deploymentName",e.target.value),placeholder:r.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:d(e?.deploymentName)})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(f,{label:(0,i.jsxs)(i.Fragment,{children:["API Key ",(0,i.jsx)("span",{className:"text-destructive",children:"*"})]}),href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,i.jsx)(a.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:d(e?.apiKey)})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:r.settings?.ai?.azureApiVersion||"API Version"}),(0,i.jsx)(s.f,{value:e?.apiVersion||"",onChange:e=>o("apiVersion",e.target.value),placeholder:r.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:r.settings?.ai?.azureModel||"Model Display Name"}),(0,i.jsx)(s.f,{value:e?.model||"",onChange:e=>o("model",e.target.value),placeholder:"gpt-4o"})]})]})}],118585),e.s(["f",0,function({value:e,onChange:n}){let{t:r}=(0,x.b)(),l=j("gemini"),o=(i,s)=>n({...e,[i]:s});return(0,i.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(f,{label:"API Key",href:l?.apiKey,linkText:r.settings.ai.docLinks.apiKey}),(0,i.jsx)(a.f,{value:e?.apiKey||"",onChange:e=>o("apiKey",e.target.value),placeholder:"AIza..."})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(t.f,{children:"Base URL (Optional)"}),(0,i.jsx)(s.f,{value:e?.baseUrl||"",onChange:e=>o("baseUrl",e.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,i.jsx)(h,{provider:"gemini",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>o("model",e),docsHref:l?.models})]})}],75977);var v=e.i(456420);let y={name:"log-in",size:24,node:[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]]};y.node;let N=(0,v.f)(y);e.s(["f",0,N],97923)},37038,e=>{var i=e.i(843476),s=e.i(271645),a=e.i(772382),t=e.i(580860),n=e.i(519455),r=e.i(793479),l=e.i(111110),o=e.i(975157);e.s(["f",0,function({className:e,...d}){let{t:c}=(0,l.b)(),[m,x]=(0,s.useState)(!1);return(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(r.f,{type:m?"text":"password",className:(0,o.f)("pr-10",e),...d}),(0,i.jsx)(n.f,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>x(!m),"aria-label":m?c.common.hidePassword:c.common.showPassword,tabIndex:-1,children:m?(0,i.jsx)(t.f,{className:"h-4 w-4 text-muted-foreground"}):(0,i.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"})})]})}])}])})();
|