wrong-notebook 2026.11.10 → 2026.11.11-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 +2 -2
- package/.next/server/app/api/admin/dashboard/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/migrate-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/admin/users/[id]/detail/route.js +2 -2
- package/.next/server/app/api/admin/users/[id]/detail/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/models/route.js +2 -2
- package/.next/server/app/api/ai/models/route.js.nft.json +1 -1
- package/.next/server/app/api/ai/test/route.js +2 -2
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +2 -2
- package/.next/server/app/api/analytics/route.js.nft.json +1 -1
- package/.next/server/app/api/analyze/route.js +2 -2
- package/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/figure/route.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/.next/server/app/api/error-items/[id]/geogebra/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/reanswer/route.js +2 -2
- 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 +2 -2
- 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.nft.json +1 -1
- package/.next/server/app/api/error-items/[id]/svg-animation/narration/route.js +2 -2
- 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 +2 -2
- package/.next/server/app/api/error-items/[id]/svg-animation/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +2 -2
- package/.next/server/app/api/error-items/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/questions/[questionId]/regenerate/route.js +2 -2
- 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 +2 -2
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +2 -2
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +2 -2
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +2 -2
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +6 -6
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +2 -2
- package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/import/route.js +17 -17
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/[id]/confirm-all/route.js +18 -18
- 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 +2 -2
- 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 +19 -19
- 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 +18 -18
- 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 +19 -19
- 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 +19 -19
- package/.next/server/app/api/import-batches/[id]/start/route.js.nft.json +1 -1
- package/.next/server/app/api/import-batches/route.js +19 -19
- package/.next/server/app/api/import-batches/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/[id]/confirm/route.js +18 -18
- 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 +18 -18
- 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 +19 -19
- 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 +18 -18
- package/.next/server/app/api/import-tasks/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/import-tasks/route.js +19 -19
- package/.next/server/app/api/import-tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +2 -2
- 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 +2 -2
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +2 -2
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/grade/route.js +2 -2
- package/.next/server/app/api/practice/grade/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +2 -2
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +2 -2
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +2 -2
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/review/due/route.js +2 -2
- package/.next/server/app/api/review/due/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/repeated-mistakes/route.js +2 -2
- package/.next/server/app/api/stats/repeated-mistakes/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/weak-tags/route.js +2 -2
- package/.next/server/app/api/stats/weak-tags/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/tts/batch/route.js.nft.json +1 -1
- package/.next/server/app/api/user/route.js +2 -2
- 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]__007euzraef-1_._.js → [root-of-the-server]__003zs5cdrhp0h._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__046l8-2oecq5e._.js → [root-of-the-server]__0095ttqaxkura._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__00d4vtmsmiyd_._.js → [root-of-the-server]__00gh00nfppv7c._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__1ld7m10shogtt._.js → [root-of-the-server]__02cwazw3laf8n._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__12u2irl6e293j._.js → [root-of-the-server]__03mzwpgmelgxq._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__06t523lsa-xt5._.js → [root-of-the-server]__04k-j5q4c3fxh._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__06g_4_o5xkej2._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__074shufbnm6ni._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1vg4na3a-hvwi._.js → [root-of-the-server]__077mapcxmui1t._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__02m42nibzxxmr._.js → [root-of-the-server]__07dbynh_bs54x._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__06g0t8zt3udt7._.js → [root-of-the-server]__0afxho639gukq._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0aka1f_bdq2io._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__17tyjwy7wmx2z._.js → [root-of-the-server]__0as_tqxtximnv._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0r3grb-nk-tkn._.js → [root-of-the-server]__0bey3smu2frko._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__00lpxd_gni_y7._.js → [root-of-the-server]__0clg30mkk8i71._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0zj60abydj_ho._.js → [root-of-the-server]__0cyq3g7ztpx7w._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0dxid01zcz8sh._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0m1vmtwh8l5-k._.js → [root-of-the-server]__0emb7mvzuv_ox._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0d_63r679gzzq._.js → [root-of-the-server]__0gj0qch0bepug._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0gspnsyl2sr50._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1i70uvkdts-q1._.js → [root-of-the-server]__0h7v77lf4fj2l._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__0o5b_c35hufmg._.js → [root-of-the-server]__0hfzltniz674f._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__13cki3v6cufcx._.js → [root-of-the-server]__0iw2v5f6ccxl0._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__14_mjy9lqgp99._.js → [root-of-the-server]__0iz5qf7p--9io._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0lrgjyg38b9j1._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0nmxuavodh1jp._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0o64d13on6cmz._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1ln0042a-s6yz._.js → [root-of-the-server]__0oou2pf7_339_._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0pzhwzricdm-8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0q7tfn1jdwvpx._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0qcuz-9of1fv5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0r0zkh318us2a._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1gsm8s81ac08k._.js → [root-of-the-server]__0sn-q9iz13vpv._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1ege7h8tb5rk0._.js → [root-of-the-server]__0sthzz27i2a2z._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1gkabltrjg-t4._.js → [root-of-the-server]__0svsyv06lv5b6._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0ve9pg6dcdyog._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vf7un104o30d._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1ya8xaf2pmzqp._.js → [root-of-the-server]__0wb0hryzh-40d._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0xryaobvas7wn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0y88hdobvv_cu._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1jwj83lfyd4sd._.js → [root-of-the-server]__0ykbbyo6dhbr6._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1v3kta6bd_kv9._.js → [root-of-the-server]__0yqilo886f-ap._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__1i_tefn2lhztv._.js → [root-of-the-server]__11abvzxq0gnxd._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__11k2f-h9fwj0r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__132wdxrrngo1f._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1pdsfjtgtncsg._.js → [root-of-the-server]__1338_d0rrpmqi._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__13k69ibnw4thj._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__159kla6_fcldu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__167-list_13wk._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1m2fnptuk23jt._.js → [root-of-the-server]__16lnqkbxm2wvd._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__190kzk1zqnnnh._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0fxflgag7lsn4._.js → [root-of-the-server]__1_n49ooywukvu._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1chl_j6-66d0z._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1d_eia02z8s27._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1dg09yxfyy2d-._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1dhiact1r_leq._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1fp_biblbk1dj._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1h4469dzsx9y_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hg-nksvhu11h._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hq4b2pmltb_l._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1hr87f6mg8xi6._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1xpcaqsei77n2._.js → [root-of-the-server]__1i04dsau7foki._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1i8ob9ye9_osl._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1jcv8k2sx2ptr._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ktelnqkakjyk._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1nmtvzuc1uv-5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1oaxm5scx4anf._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1oc9d5av5hr08._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1opijjenrark5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1qbwy5a1mwohf._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1rfpsbaml9gvv._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1rzzqjvucnhdy._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1s9wsfyjfjfsw._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1jwd70xukhvz4._.js → [root-of-the-server]__1so_ne69bm6m7._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1svy-pnpe1pwu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1t6v0c67wrtj7._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0ztucyaloy2ub._.js → [root-of-the-server]__1tcmfyputqswh._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1ttyfy9dd2omo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1uk_9g9b1wxp5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1wt1lpxbrwtyt._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0q520ovb9262s._.js → [root-of-the-server]__1z61l-vv1munx._.js} +2 -2
- package/.next/server/chunks/{_02qwqg9i39x4_._.js → _0-4_eys63g0m9._.js} +6 -6
- package/.next/server/chunks/{_1csx8ckltgali._.js → _0fsupxpep5knb._.js} +6 -6
- package/.next/server/chunks/{_0oppr1mpoh25l._.js → _0j_08_iij6lec._.js} +1 -1
- package/.next/server/chunks/{_1gtuhmdu6udof._.js → _0sreqb-d5c0h6._.js} +6 -6
- package/.next/server/chunks/_12w5k19rc45j_._.js +1 -1
- package/.next/server/chunks/_18hm5aaxkr500._.js +1 -1
- package/.next/server/chunks/{_1yvd01woddaxt._.js → _1c-nysoxl9gha._.js} +6 -6
- package/.next/server/chunks/_1v6bg00q81vb-._.js +3 -0
- package/.next/server/chunks/_1yx16tn5391kx._.js +1 -1
- package/.next/server/chunks/src_lib_1_m3-y2t3e4xi._.js +28 -19
- package/.next/server/chunks/src_lib_import_import-batches_ts_0nq3mn0v5uj28._.js +1 -1
- package/.next/server/chunks/src_lib_import_import-tasks_ts_01f-g_upv7llt._.js +1 -1
- package/.next/server/chunks/src_lib_notebook-scope_ts_06eipvr6xztlf._.js +1 -1
- package/.next/server/chunks/src_lib_question_question-deduplication_ts_0gumctesi3szc._.js +1 -1
- package/.next/server/chunks/src_lib_tags_seed_1_ej3w-2450a0._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__032-uso7x2eqk._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__04nhi0374i4dp._.js → [root-of-the-server]__0d5zpswdqvn6x._.js} +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0l0hz47yn1ku_._.js +1 -1
- package/.next/server/chunks/ssr/_02_avk2sj3zf5._.js +1 -1
- package/.next/server/chunks/ssr/_0_64f2dtjo5uu._.js +3 -0
- package/.next/server/chunks/ssr/{_0r_8p9g00106y._.js → _0fh12wb12x9_h._.js} +1 -1
- package/.next/server/chunks/ssr/_0gyhgc3i525y2._.js +3 -0
- package/.next/server/chunks/ssr/{_0is6rtsx_9ka7._.js → _0ke2cz46akgx8._.js} +1 -1
- package/.next/server/chunks/ssr/_0mp06uu5odp8m._.js +1 -1
- package/.next/server/chunks/ssr/_0njaj1xszg_ke._.js +3 -0
- package/.next/server/chunks/ssr/_0p3bqrojxwfs0._.js +1 -1
- package/.next/server/chunks/ssr/_0rd-teluypcd2._.js +1 -1
- package/.next/server/chunks/ssr/_13qw8b5_bjw9p._.js +3 -0
- package/.next/server/chunks/ssr/_1ctycpq4tb8xw._.js +1 -1
- package/.next/server/chunks/ssr/{node_modules_1i644g-kqgnm_._.js → node_modules_0hgx3on3j2y9z._.js} +1 -1
- package/.next/server/chunks/ssr/node_modules_179_7-7dlei2i._.js +3 -0
- package/.next/server/chunks/ssr/{node_modules_heic-to_dist_csp_heic-to_0sz_snu3yd_63.js → node_modules_heic-to_dist_csp_heic-to_19pxm0n6g7iz7.js} +1 -1
- package/.next/server/chunks/ssr/src_0_qzoo_03n_v-._.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_app_notebooks_page_tsx_1p9src5gnz_40._.js +1 -1
- package/.next/server/chunks/ssr/src_app_page_tsx_1chiuahujsxm1._.js +1 -1
- package/.next/server/chunks/ssr/src_components_error-list_error-item-card_tsx_1zsiqsrj-jjd7._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv3nb6xs._.js +20 -20
- package/.next/server/chunks/ssr/src_contexts_LanguageContext_tsx_0r6xucmeu1k5z._.js +1 -1
- package/.next/server/chunks/ssr/src_lib_api-client_ts_04r2_ex-gua5i._.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/{3j92h-4k4_o_f.js → 01du700kl9vpy.js} +1 -1
- package/.next/static/chunks/{2s65brxj4r_r8.js → 0qp2dju3vke54.js} +1 -1
- package/.next/static/chunks/{13aykr4b9nzmt.js → 0thfktbl-6vyt.js} +1 -1
- package/.next/static/chunks/0wf-6-2_vym2v.js +1 -0
- package/.next/static/chunks/{0alfkmfoq-e76.js → 0xprzh3z351mm.js} +1 -1
- package/.next/static/chunks/{1rlw59dtd-wn9.js → 1pemee2pqgisl.js} +1 -1
- package/.next/static/chunks/1xs9nv25eh0l6.js +1 -0
- package/.next/static/chunks/{1-p-0kczwnip9.js → 2-_veplkr98_e.js} +1 -1
- package/.next/static/chunks/{1joajsaunlqm-.js → 24l1is212zewr.js} +1 -1
- package/.next/static/chunks/{3f9t8cne6yfyl.js → 2_-nvwtkahxig.js} +1 -1
- package/.next/static/chunks/{0_ysyni00uuve.js → 2_gq0y08mnjs4.js} +1 -1
- package/.next/static/chunks/2_u24xshn2urw.js +1 -0
- package/.next/static/chunks/2g5_4ztiui6_-.js +1 -0
- package/.next/static/chunks/2r7pb7ttypnhu.js +1 -0
- package/.next/static/chunks/{3ls9d-zeu8xdr.js → 2zdzu--krxfgk.js} +16 -16
- package/.next/static/chunks/{315-5a18eawtj.js → 32vepv3t_izfb.js} +1 -1
- package/.next/static/chunks/{3h3a7lg3-9cbn.js → 348vc_z8o0lz1.js} +1 -1
- package/.next/static/chunks/368ky533076l_.js +2 -0
- package/.next/static/chunks/3u3b6lr-n-qgz.js +2 -0
- package/.next/static/chunks/{3t9tbm4atwmw8.js → 3vdtiexr8nj05.js} +1 -1
- package/.next/static/chunks/3w2lij3a5t2kg.css +3 -0
- package/dist-scripts/src/lib/tags/data/university.js +1 -1
- package/package.json +1 -1
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__00ry5fb1607z0._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0_3i3iyk5i5fu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0d3nasp559369._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ddx0pk-g57hh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0evnxpsv44y-s._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0g2y0mex0x8zf._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gjk0_s945vrt._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gkhutsleo1es._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0gvfx4rsinijb._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0jutgg41pd-47._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0kc9gy1644-op._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0medeb4h2gk5t._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0prgnysrc2l5k._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0qwtk85kstlpq._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0rwbb97vk-mfk._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0smp3m3n89xs_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zsd45jad6b40._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zux7hsnes_j2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__10--fi__uy8y7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__14b8pj1sucy1-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__16t85d4p3aldo._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1_do4zybj0nvi._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1bz0s-wy2cxhl._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1d7_aw9ogigrd._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1gb1x1ubkdwig._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1hc1bcnovtwo2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ms_0h40h2rbg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1nw9nkdb5uv4i._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ogeha9-ljbre._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1p5s772lt24dg._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1pxyy29_t_ru1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1s_ky5a7nhgas._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1txu2n-l6c6yu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ulrsdu0e8fjb._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1w6vhjjteqg1c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1wi-k0dtwwxx3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1wvm4n7d69s3x._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1x-u1u9mrt630._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1xx_3auad-kml._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1y0omyblg9j35._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1z2d4j9-oei44._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1znqtfuuspj0w._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__205o-7lep9jth._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20c3hyqykubh2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20pn9h3od2anc._.js +0 -3
- package/.next/server/chunks/_0ta62b-tktnk8._.js +0 -3
- package/.next/server/chunks/_12xi_xqvtrn3k._.js +0 -3
- package/.next/server/chunks/_14l8uqb__fhx_._.js +0 -3
- package/.next/server/chunks/ssr/_07igsu8xjloky._.js +0 -3
- package/.next/server/chunks/ssr/_090e6vf_k0pe9._.js +0 -3
- package/.next/server/chunks/ssr/_0znwyf0_b8ia6._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_0nslyotwav52f._.js +0 -3
- package/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_icons_0mg8mlclupjv-._.js +0 -3
- package/.next/static/chunks/0gs3bacq7z36z.js +0 -1
- package/.next/static/chunks/1_4nz7m2jathb.js +0 -1
- package/.next/static/chunks/1ey5h3_143nwz.js +0 -2
- package/.next/static/chunks/23h8i_poncr7i.js +0 -1
- package/.next/static/chunks/26is31yphg3a0.css +0 -3
- package/.next/static/chunks/2e4y6sq3k0g-g.js +0 -1
- package/.next/static/chunks/2hl9d1rdb9hkq.js +0 -1
- package/.next/static/chunks/3keaieh9lgnr3.js +0 -2
- package/.next/static/chunks/431ssxm5rrwz9.js +0 -1
- /package/.next/static/{HqqfOtkWGYtFERkBGxueA → tMSv5DxfJmyaICQa1Cowk}/_buildManifest.js +0 -0
- /package/.next/static/{HqqfOtkWGYtFERkBGxueA → tMSv5DxfJmyaICQa1Cowk}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{HqqfOtkWGYtFERkBGxueA → tMSv5DxfJmyaICQa1Cowk}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,837817,232660,e=>{var t=e.i(456420);let n={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],837817);var i=e.i(271645),a={x:0,y:0,width:0,height:0,unit:"px"},o=(e,t,n)=>Math.min(Math.max(e,t),n),s=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function h(e,t,n){return"%"===e.unit?{...a,...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 l(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}:{...a,...e,unit:"px"}}function c(e,t,n,r,i,a=0,o=0,s=r,h=i){let l={...e},d=Math.min(a,r),u=Math.min(o,i),m=Math.min(s,r),g=Math.min(h,i);t&&(t>1?(u=(d=o?o*t:d)/t,m=s*t):(d=(u=a?a/t:u)*t,g=h/t)),l.y<0&&(l.height=Math.max(l.height+l.y,u),l.y=0),l.x<0&&(l.width=Math.max(l.width+l.x,d),l.x=0);let p=r-(l.x+l.width);p<0&&(l.x=Math.min(l.x,r-d),l.width+=p);let w=i-(l.y+l.height);if(w<0&&(l.y=Math.min(l.y,i-u),l.height+=w),l.width<d&&(("sw"===n||"nw"==n)&&(l.x-=d-l.width),l.width=d),l.height<u&&(("nw"===n||"ne"==n)&&(l.y-=u-l.height),l.height=u),l.width>m&&(("sw"===n||"nw"==n)&&(l.x-=m-l.width),l.width=m),l.height>g&&(("nw"===n||"ne"==n)&&(l.y-=g-l.height),l.height=g),t){let e=l.width/l.height;if(e<t){let e=Math.max(l.width/t,u);("nw"===n||"ne"==n)&&(l.y-=e-l.height),l.height=e}else if(e>t){let e=Math.max(l.height*t,d);("sw"===n||"nw"==n)&&(l.x-=e-l.width),l.width=e}}return l}var d={capture:!0,passive:!1},u=0,m=class e extends i.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,i.createRef)();mediaRef=(0,i.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${u++}`;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:r,height:i}=e.getBoundingClientRect();return{x:t,y:n,width:r,height:i}}componentDidUpdate(e){let{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){let{width:e,height:r}=this.getBox();e&&r&&n(l(t,e,r),h(t,e,r))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,d),this.document.addEventListener("pointerup",this.onDocPointerDone,d),this.document.addEventListener("pointercancel",this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,d),this.document.removeEventListener("pointerup",this.onDocPointerDone,d),this.document.removeEventListener("pointercancel",this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:n}=this.props,r=this.getBox();if(!t)return;let i=l(t,r.width,r.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=i.x,c=i.y;if(a){let t=e.clientX-r.x,n=e.clientY-r.y,l=0,d=0;"ne"===a||"e"==a?(l=t-(i.x+i.width),d=n-i.y,h=i.x,c=i.y+i.height):"se"===a||"s"===a?(l=t-(i.x+i.width),d=n-(i.y+i.height),h=i.x,c=i.y):"sw"===a||"w"==a?(l=t-i.x,d=n-(i.y+i.height),h=i.x+i.width,c=i.y):("nw"===a||"n"==a)&&(l=t-i.x,d=n-i.y,h=i.x+i.width,c=i.y+i.height),o=h+r.x+l,s=c+r.y+d}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:r,keepSelection:i,onChange:a}=this.props,o=this.getBox();if(n||r||i&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let s=e.clientX-o.x,c=e.clientY-o.y,d={unit:"px",x:s,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:s,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(l(d,o.width,o.height),h(d,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:n,disabled:r,onChange:i,onDragStart:a}=this.props,o=this.getBox();if(r||!n||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));let{evData:c}=this;c.clientX=e.clientX,c.clientY=e.clientY,s(n,t=c.isResize?this.resizeCrop():this.dragCrop())||i(l(t,o.width,o.height),h(t,o.width,o.height))};onComponentKeyDown=t=>{let{crop:n,disabled:r,onChange:i,onComplete:a}=this.props;if(r)return;let s=t.key,c=!1;if(!n)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"===s?(u.x-=m,c=!0):"ArrowRight"===s?(u.x+=m,c=!0):"ArrowUp"===s?(u.y-=m,c=!0):"ArrowDown"===s&&(u.y+=m,c=!0),c){t.cancelable&&t.preventDefault(),u.x=o(u.x,0,d.width-u.width),u.y=o(u.y,0,d.height-u.height);let e=l(u,d.width,d.height),n=h(u,d.width,d.height);i(e,n),a&&a(e,n)}};onHandlerKeyDown=(t,n)=>{var r,i;let a,{aspect:o=0,crop:d,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:w,onChange:f,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 v=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,b=c((r=l(d,y.width,y.height),i=t.key,a={...r},"ArrowLeft"===i?"nw"===n?(a.x-=v,a.y-=v,a.width+=v,a.height+=v):"w"===n?(a.x-=v,a.width+=v):"sw"===n?(a.x-=v,a.width+=v,a.height+=v):"ne"===n?(a.y+=v,a.width-=v,a.height-=v):"e"===n?a.width-=v:"se"===n&&(a.width-=v,a.height-=v):"ArrowRight"===i&&("nw"===n?(a.x+=v,a.y+=v,a.width-=v,a.height-=v):"w"===n?(a.x+=v,a.width-=v):"sw"===n?(a.x+=v,a.width-=v,a.height-=v):"ne"===n?(a.y-=v,a.width+=v,a.height+=v):"e"===n?a.width+=v:"se"===n&&(a.width+=v,a.height+=v)),"ArrowUp"===i?"nw"===n?(a.x-=v,a.y-=v,a.width+=v,a.height+=v):"n"===n?(a.y-=v,a.height+=v):"ne"===n?(a.y-=v,a.width+=v,a.height+=v):"sw"===n?(a.x+=v,a.width-=v,a.height-=v):"s"===n?a.height-=v:"se"===n&&(a.width-=v,a.height-=v):"ArrowDown"===i&&("nw"===n?(a.x+=v,a.y+=v,a.width-=v,a.height-=v):"n"===n?(a.y+=v,a.height-=v):"ne"===n?(a.y+=v,a.width-=v,a.height-=v):"sw"===n?(a.x-=v,a.width+=v,a.height+=v):"s"===n?a.height+=v:"se"===n&&(a.width+=v,a.height+=v)),a),o,n,y.width,y.height,m,g,p,w);if(!s(d,b)){let e=h(b,y.width,y.height);f(b,e),x&&x(b,e)}};onDocPointerDone=e=>{let{crop:t,disabled:n,onComplete:r,onDragEnd:i}=this.props,a=this.getBox();this.unbindDocMove(),!(n||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),r&&r(l(t,a.width,a.height),h(t,a.width,a.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,i=e.clientY-e.startClientY;return n.x=o(e.startCropX+r,0,t.width-n.width),n.y=o(e.startCropY+i,0,t.height-n.height),n}getPointRegion(e,t,n,r){let{evData:i}=this,a=i.clientX-e.x,o=i.clientY-e.y,s;return s=r&&t?"nw"===t||"n"===t||"ne"===t:o<i.startCropY,(n&&t?"nw"===t||"w"===t||"sw"===t:a<i.startCropX)?s?"nw":"sw":s?"ne":"se"}resolveMinDimensions(e,t,n=0,r=0){let i=Math.min(n,e.width),a=Math.min(r,e.height);return t&&(i||a)?t>1?i?[i,i/t]:[a*t,a]:a?[a*t,a]:[i,i/t]:[i,a]}resizeCrop(){let{evData:t}=this,{aspect:n=0,maxWidth:r,maxHeight:i}=this.props,a=this.getBox(),[s,h]=this.resolveMinDimensions(a,n,this.props.minWidth,this.props.minHeight),l=this.makePixelCrop(a),d=this.getPointRegion(a,t.ord,s,h),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)),(h&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-h));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===d?(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"===d?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,n?p.height=p.width/n:p.height=g):"sw"===d?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),n?p.height=p.width/n:p.height=g):"nw"===d&&(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 w=c(p,n,d,a.width,a.height,s,h,r,i);return n||e.xyOrds.indexOf(u)>-1?l=w:e.xOrds.indexOf(u)>-1?(l.x=w.x,l.width=w.width):e.yOrds.indexOf(u)>-1&&(l.y=w.y,l.height=w.height),l.x=o(l.x,0,a.width-l.width),l.y=o(l.y,0,a.height-l.height),l}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:n,locked:r,renderSelectionAddon:a,ruleOfThirds:o,crop:s}=this.props,h=this.getCropStyle();if(s)return i.default.createElement("div",{style:h,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!r&&i.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},i.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&i.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return l({...a,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:n,className:r,crop:a,disabled:o,locked:s,style:h,ruleOfThirds:l}=this.props,{cropIsActive:c,newCropIsBeingDrawn:d}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",r,c&&"ReactCrop--active",o&&"ReactCrop--disabled",s&&"ReactCrop--locked",d&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&n&&"ReactCrop--circular-crop",a&&l&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return i.default.createElement("div",{ref:this.componentRef,className:m,style:h},i.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?i.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},i.default.createElement("defs",null,i.default.createElement("mask",{id:`hole-${this.instanceId}`},i.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),n?i.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"}):i.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"}))),i.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};e.s(["f",0,m],232660)},12130,271945,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(456420);let i={name:"eraser",size:24,node:[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]};i.node;let a=(0,r.f)(i);var o=e.i(395925);let s={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};s.node;let h=(0,r.f)(s);var l=e.i(759659),c=e.i(837817),d=e.i(232660),u=e.i(519455),m=e.i(776639),g=e.i(263676),p=e.i(111110),w=e.i(895133);let f={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},x=(0,n.forwardRef)(function({imageSrc:e,regions:r,onChange:i,imageStyle:a=f,onImageLoad:o},s){let{t:h}=(0,p.b)(),l=(0,n.useRef)(null),c=(0,n.useRef)(null),[d,u]=(0,n.useState)(null),m=e=>{let t=l.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},x=()=>{d&&d.width>=.02&&d.height>=.02&&i([...r,d]),c.current=null,u(null)},y=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:s,src:e,alt:"",draggable:!1,style:a,onLoad:o,className:"block"}),(0,t.jsxs)("div",{ref:l,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(l.current?.setPointerCapture(e.pointerId),c.current=m(e),u(null))},onPointerMove:e=>{if(!c.current)return;let t=m(e);u((0,w.w)(c.current.x,c.current.y,t.x,t.y))},onPointerUp:x,onPointerCancel:x,children:[r.map((e,n)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:y(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":h.batchImport.removeRegion.replace("{index}",String(n+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>i(r.filter((e,t)=>t!==n)),children:(0,t.jsx)(g.X,{className:"h-3 w-3"})})]},n)),d&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:y(d)})]})]})}),y={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"}]]};y.node;let v=(0,r.f)(y),b={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"}]]};b.node;let C=(0,r.f)(b);function D({zoom:e,onZoomIn:n,onZoomOut:r,onReset:i}){let{t:a}=(0,p.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:r,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(C,{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:i,"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)(v,{className:"h-4 w-4"})})]})}var M=e.i(201276),k=e.i(804536);let E="image-cropper-mode",R=["single","auto","multi"];e.s(["U",0,R,"p",0,E,"S",0,["image","text","file","direct"],"c",0,"question-input-mode","k",0,["image","text"]],271945);let j={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}},N=[{key:"thin",pixels:3},{key:"medium",pixels:7},{key:"thick",pixels:14}];e.s(["f",0,function({imageSrc:e,open:r,onClose:i,onCropComplete:s,onMultiCropComplete:g,onRegionsSelected:f,allowMulti:y=!0,onAutoSplit:v,onAddPart:b,partCount:C=0,eraseEnabled:S=!0}){let{t:I}=(0,p.b)(),L=(0,w.f)(e),[P,H]=(0,n.useState)({src:e,rotation:0}),_=P.src===e?P.rotation:0,[$,A]=(0,n.useState)(null),Y=0===_?L:$&&$.src===L&&$.rotation===_?$.url:L;(0,n.useEffect)(()=>{if(!L||0===_)return;let e=!1,t=null,n=new Image;return n.decoding="async",n.src=L,n.decode().then(()=>{if(e)return;let r=(0,w.h)(n.naturalWidth,n.naturalHeight,{x:0,y:0,width:1,height:1,rotation:_}),i=(0,w.s)(n.naturalWidth,n.naturalHeight,_),a=document.createElement("canvas");a.width=i.width,a.height=i.height;let o=a.getContext("2d");o&&((0,w.D)(o,n,r,i.width,i.height),a.toBlob(n=>{n&&!e&&A({src:L,rotation:_,url:t=URL.createObjectURL(n)})},"image/jpeg",.9))}).catch(e=>{M.V.warn("[ImageCropper]","Rotate preview failed",{error:e})}),()=>{e=!0,t&&URL.revokeObjectURL(t)}},[L,_]);let[X,B]=(0,n.useState)(),O=(0,n.useRef)(null),[U,z]=(0,k.y)(E,R,"single"),K=["single",...v?["auto"]:[],...g||f&&y?["multi"]:[]],W=K.includes(U)?U:"single",[T,F]=(0,n.useState)(null),q=null===T?j[W]:{...j[W],maxHeight:`${Math.max(0,T-16)}px`},{containerRef:G,container:V,zoom:Q,imageStyle:Z,measureImage:J,zoomIn:ee,zoomOut:et,reset:en}=function(e){let[t,r]=(0,n.useState)(null),i=(0,n.useRef)(null),a=(0,n.useCallback)(e=>{i.current=e,r(e)},[]),[o,s]=(0,n.useState)(1),h=(0,n.useRef)(1),[l,c]=(0,n.useState)(null),d=(0,n.useRef)(null),u=(0,n.useRef)(!1),m=(0,n.useCallback)((e,t,n)=>{let r=i.current,a=h.current,o=Math.min(5,Math.max(1,e));if(!r||o===a)return;if(1===a){let e=r.querySelector("img");e&&c(e.clientWidth)}let l=r.getBoundingClientRect(),u=(t??l.left+l.width/2)-l.left,m=(n??l.top+l.height/2)-l.top;d.current={viewX:u,viewY:m,contentX:r.scrollLeft+u,contentY:r.scrollTop+m,ratio:o/a},h.current=o,s(o)},[]);(0,n.useLayoutEffect)(()=>{let e=i.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,n.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(h.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},n=null,r=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}},i=e=>{2===e.touches.length&&(n={distance:r(e.touches).distance,zoom:h.current},u.current=!0)},a=e=>{if(!n||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:i,centerY:a}=r(e.touches);n.distance>0&&m(n.zoom*(t/n.distance),i,a)},o=e=>{e.touches.length<2&&(n=null,u.current=!1)},s=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",s,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",i),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",s,{capture:!0})}},[t,m]);let g=(0,n.useCallback)(e=>{e&&1===h.current&&c(e.clientWidth)},[]),p=(0,n.useCallback)(()=>m(1.25*h.current),[m]),w=(0,n.useCallback)(()=>m(h.current/1.25),[m]),f=(0,n.useCallback)(()=>{h.current=1,d.current=null,s(1)},[]),x=1!==o&&l?{...e,width:l*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,container:t,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:w,reset:f}}(q);(0,n.useEffect)(()=>{en()},[e,en]),(0,n.useEffect)(()=>{if(!V)return;let e=new ResizeObserver(([e])=>F(e.contentRect.height));return e.observe(V),()=>e.disconnect()},[V]),(0,n.useEffect)(()=>{let e=V?.querySelector("img");J(e instanceof HTMLImageElement?e:null)},[V,q.maxHeight,Q,J]);let[er,ei]=(0,n.useState)({src:e,regions:[]}),ea=er.src===e?er.regions:[],eo=t=>ei({src:e,regions:t}),es=(0,n.useRef)(null),[eh,el]=(0,n.useState)({src:e,strokes:[]}),ec=(0,n.useMemo)(()=>eh.src===e?eh.strokes:[],[eh,e]),ed=t=>el(n=>({src:e,strokes:"function"==typeof t?t(n.strokes):t})),eu=t=>{H({src:e,rotation:((_+t)%360+360)%360}),B(void 0),eo([]),ed([]),en()},[em,eg]=(0,n.useState)(!1),[ep,ew]=(0,n.useState)("medium"),[ef,ex]=(0,n.useState)(0),ey=(0,n.useRef)(null),ev=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!S||"multi"===W)return;let e=ey.current,t=O.current;if(!e||!t||0===t.clientWidth)return;e.width=t.clientWidth,e.height=t.clientHeight;let n=e.getContext("2d");n&&(n.clearRect(0,0,e.width,e.height),(0,w.c)(n,ec,{width:e.width,height:e.height},{sx:0,sy:0,sw:e.width,sh:e.height},{width:e.width,height:e.height}))},[S,W,ec,ef,Q,e,q.maxHeight]),(0,n.useEffect)(()=>{eg(!1),ev.current=null},[e]);let eb=N.find(e=>e.key===ep)?.pixels??7,eC=e=>{let t=ey.current.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}},eD=()=>{ev.current=null},eM={single:I.batchImport.singleMode,auto:I.batchImport.autoMode,multi:I.batchImport.multiMode},ek={thin:I.common.cropper.brushThin,medium:I.common.cropper.brushMedium,thick:I.common.cropper.brushThick},eE=async()=>{if(0!==ea.length){if(f){f(ea.map(e=>({...e,rotation:_})),!0),eo([]);return}if(es.current&&g)try{g(await (0,w.Y)(es.current,ea.map(e=>({...e,rotation:0})))),eo([])}catch(e){M.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},eR=()=>({...X&&X.width>0&&X.height>0?{x:X.x/100,y:X.y/100,width:X.width/100,height:X.height/100}:{x:0,y:0,width:1,height:1},rotation:_,...ec.length?{erase:ec}:{}}),ej=async()=>{let e=eR();if("auto"===W&&v)return void v(e);if(f)return void f([e],!1);if(O.current&&s)try{let[t]=await (0,w.Y)(O.current,[{...e,rotation:0}]);s(t)}catch(e){M.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(m.N,{open:r,onOpenChange:e=>!e&&i(),children:(0,t.jsxs)(m.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(m.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(m.F,{children:I.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:G,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===W?(0,t.jsx)(x,{ref:es,imageSrc:Y,regions:ea,onChange:eo,imageStyle:Z,onImageLoad:e=>J(e.currentTarget)}):(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)(d.f,{crop:X,onChange:(e,t)=>B(t),disabled:em,children:(0,t.jsx)("img",{ref:O,alt:"Crop me",src:Y,onLoad:function(e){B({unit:"%",x:0,y:0,width:100,height:100}),J(e.currentTarget),ex(e=>e+1)},style:Z,className:"block"})}),S&&(0,t.jsx)("canvas",{ref:ey,"aria-hidden":!0,className:`absolute inset-0 ${em?"cursor-crosshair":"pointer-events-none"}`,style:{touchAction:"none"},onPointerDown:e=>{if(!em||0!==e.button)return;e.preventDefault(),ey.current?.setPointerCapture(e.pointerId);let t=ey.current;ev.current=ec.length,ed([...ec,{points:[eC(e)],radius:t?eb/t.clientWidth:.006}])},onPointerMove:e=>{let t=ev.current;if(null===t)return;let n=eC(e);ed(e=>e.map((e,r)=>{if(r!==t)return e;let i=e.points[e.points.length-1];return i&&5e-4>Math.abs(i.x-n.x)&&5e-4>Math.abs(i.y-n.y)?e:{...e,points:[...e.points,n]}}))},onPointerUp:eD,onPointerCancel:eD})]})})}),(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex gap-1 rounded-md bg-background/90 p-1 shadow-sm",children:[(0,t.jsx)(u.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>eu(-90),"aria-label":I.common.cropper.rotateLeft,title:I.common.cropper.rotateLeft,children:(0,t.jsx)(o.f,{className:"h-4 w-4"})}),(0,t.jsx)(u.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>eu(90),"aria-label":I.common.cropper.rotateRight,title:I.common.cropper.rotateRight,children:(0,t.jsx)(h,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(D,{zoom:Q,onZoomIn:ee,onZoomOut:et,onReset:en})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[K.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===K.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:K.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":W===e,onClick:()=>{en(),z(e),"multi"===e&&(eg(!1),ed([]))},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${W===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:eM[e]},e))}),S&&"multi"!==W&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(u.f,{variant:em?"secondary":"outline",size:"sm",onClick:()=>{eg(e=>!e),ev.current=null},className:"flex items-center gap-2",children:[(0,t.jsx)(a,{className:"h-4 w-4"}),em?I.common.cropper.eraseDone:I.common.cropper.erase]}),em&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-md bg-muted p-1",children:N.map(({key:e})=>(0,t.jsx)("button",{type:"button","aria-pressed":ep===e,onClick:()=>ew(e),className:`rounded px-2 py-1 text-xs font-medium ${ep===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:ek[e]},e))}),ec.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:()=>ed(ec.slice(0,-1)),className:"flex items-center gap-1.5",children:[(0,t.jsx)(c.f,{className:"h-4 w-4"}),I.common.cropper.undoErase]}),(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:()=>ed([]),className:"flex items-center gap-1.5",children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),I.common.cropper.clearErase]})]})]})]}),(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"===W?`${I.batchImport.hint} ${I.batchImport.regionCount.replace("{count}",String(ea.length))}`:em?I.common.cropper.eraseHint:"auto"===W?I.batchImport.autoHint:C>0?I.upload.parts.cropHint.replace("{n}",String(C+1)):I.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end",children:["multi"===W&&ea.length>0&&(0,t.jsx)(u.f,{variant:"ghost",onClick:()=>eo([]),children:I.batchImport.clear}),(0,t.jsx)(u.f,{variant:"outline",onClick:i,children:I.common.cancel||"Cancel"}),"multi"===W?(0,t.jsx)(u.f,{onClick:eE,disabled:0===ea.length,children:I.batchImport.start.replace("{count}",String(ea.length))}):(0,t.jsxs)(t.Fragment,{children:["single"===W&&b&&(0,t.jsx)(u.f,{variant:"secondary",onClick:()=>b(eR()),"data-testid":"crop-add-part",children:I.upload.parts.addNext}),(0,t.jsx)(u.f,{onClick:ej,children:"auto"===W?I.batchImport.autoStart:C>0?I.upload.parts.confirm.replace("{count}",String(C+1)):I.common.confirm||"Confirm"})]})]})]})]})]})})}],12130)},574041,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(263676),i=e.i(487486),a=e.i(793479),o=e.i(41931),s=e.i(201276);e.s(["f",0,function({value:e=[],onChange:h,placeholder:l="Enter tags...",className:c="",enterHint:d,subject:u,gradeStage:m}){let[g,p]=(0,n.useState)(""),[w,f]=(0,n.useState)([]),[x,y]=(0,n.useState)(!1),[v,b]=(0,n.useState)(0),C=(0,n.useRef)(null),D=(0,n.useRef)(null),M=(0,n.useCallback)(async t=>{try{let n=new URLSearchParams({q:t});u&&n.append("subject",u),m&&n.append("stage",m);let r=((await o.k.get(`/api/tags/suggestions?${n.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));f(r.slice(0,20)),y(r.length>0),b(0)}catch(e){s.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,n.useEffect)(()=>{g.trim()&&M(g)},[g,M]);let k=t=>{t.trim()&&!e.includes(t.trim())&&(h([...e,t.trim()]),p(""),f([]),y(!1),b(0))},E=t=>{h(e.filter(e=>e!==t))};return(0,n.useEffect)(()=>{let e=e=>{!D.current||D.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)(i.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)(r.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()||(f([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&w[v]?k(w[v]):g.trim()&&k(g)):"ArrowDown"===t.key?(t.preventDefault(),b(e=>Math.min(e+1,w.length-1))):"ArrowUp"===t.key?(t.preventDefault(),b(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),b(0)):"Backspace"===t.key&&!g&&e.length>0&&E(e[e.length-1])},onFocus:()=>{w.length>0&&y(!0)},placeholder:0===e.length?l:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&w.length>0&&(0,t.jsx)("div",{ref:D,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:w.map((e,n)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${n===v?"bg-accent":""}`,onClick:()=>k(e),onMouseEnter:()=>b(n),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}"`})]})}])},804536,e=>{var t=e.i(271645);let n=new Map,r=new Set;function i(e){return r.add(e),window.addEventListener("storage",e),()=>{r.delete(e),window.removeEventListener("storage",e)}}function a(e,a,o){let s=(0,t.useSyncExternalStore)(i,()=>(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(s),[a,s]),(0,t.useCallback)(t=>(function(e,t){try{window.localStorage.setItem(e,t),n.delete(e)}catch{n.set(e,t)}r.forEach(e=>e())})(e,o(t)),[e,o])]}let o=e=>e;e.s(["y",0,function(e,n,r){return a(e,(0,t.useCallback)(e=>n.includes(e??"")?e:r,[n,r]),o)},"x",0,a])},213761,895133,e=>{let t=[0,90,180,270];function n(e,t,r=0){let i=90===r||270===r;return{width:i?t:e,height:i?e:t}}function r(e,r,i){let a,o,s,h,l=t.includes(i.rotation??0)?i.rotation??0:0,c=n(e,r,l),d=e=>Math.min(1,Math.max(0,e)),u=Math.round(d(i.x)*c.width),m=Math.round(d(i.y)*c.height),g=Math.max(1,Math.min(c.width-u,Math.round(d(i.width)*c.width))),p=Math.max(1,Math.min(c.height-m,Math.round(d(i.height)*c.height)));switch(l){case 90:a=m,o=c.width-u-g,s=p,h=g;break;case 180:a=e-u-g,o=r-m-p,s=g,h=p;break;case 270:a=e-m-p,o=u,s=p,h=g;break;default:a=u,o=m,s=g,h=p}return{rotation:l,frameWidth:c.width,frameHeight:c.height,fx:u,fy:m,fw:g,fh:p,sx:a,sy:o,sw:s,sh:h,outputWidth:g,outputHeight:p}}function i(e,t,n,r,i){if(0===t.length)return;let a=i.width/r.sw,o=i.height/r.sh;for(let i of(e.save(),e.fillStyle="#ffffff",e.strokeStyle="#ffffff",e.lineCap="round",e.lineJoin="round",t)){if(0===i.points.length)continue;let t=i.points.map(e=>({x:(e.x*n.width-r.sx)*a,y:(e.y*n.height-r.sy)*o})),s=Math.max(.5,i.radius*n.width*a);if(1===t.length){e.beginPath(),e.arc(t[0].x,t[0].y,s,0,2*Math.PI),e.fill();continue}for(let n of(e.beginPath(),e.moveTo(t[0].x,t[0].y),t.slice(1)))e.lineTo(n.x,n.y);e.lineWidth=2*s,e.stroke()}e.restore()}function a(e,t,n,r,o,s=[]){switch(e.fillStyle="#ffffff",e.fillRect(0,0,r,o),e.imageSmoothingEnabled=!0,e.imageSmoothingQuality="high",e.save(),n.rotation){case 90:e.translate(r,0),e.rotate(Math.PI/2);break;case 180:e.translate(r,o),e.rotate(Math.PI);break;case 270:e.translate(0,o),e.rotate(-Math.PI/2)}let h=90===n.rotation||270===n.rotation;e.drawImage(t,n.sx,n.sy,n.sw,n.sh,0,0,h?o:r,h?r:o),e.restore(),i(e,s,{width:n.frameWidth,height:n.frameHeight},{sx:n.fx,sy:n.fy,sw:n.fw,sh:n.fh},{width:r,height:o})}async function o(e,t){let{naturalWidth:n,naturalHeight:i}=e;return Promise.all(t.map(t=>new Promise((o,s)=>{let h=r(n,i,t),l=document.createElement("canvas");l.width=h.outputWidth,l.height=h.outputHeight;let c=l.getContext("2d");c?(a(c,e,h,h.outputWidth,h.outputHeight,t.erase??[]),l.toBlob(e=>e?o(e):s(Error("Canvas is empty")),"image/jpeg",.95)):s(Error("Canvas is not supported"))})))}e.s(["c",0,function(e,t,n,r,a){i(e,t,n,r,a)},"B",0,function(e){let t=e.match(/^data:(image\/(?:png|jpe?g|webp|gif));base64,([\s\S]+)$/);if(!t)return null;try{let e=atob(t[2]),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return new Blob([n],{type:t[1]})}catch{return null}},"Y",0,o,"D",0,a,"w",0,function(e,t,n,r){let i=e=>Math.min(1,Math.max(0,e)),a=i(Math.min(e,n)),o=i(Math.min(t,r));return{x:a,y:o,width:i(Math.max(e,n))-a,height:i(Math.max(t,r))-o}},"h",0,r,"s",0,n,"f",0,function(e){return/^(blob:|data:image\/)/i.test(e)?e:void 0}],895133);let s={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class h 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 l=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),c=new Set(["mif1","msf1","mif2"]),d=new Set(["avif","avis"]);function u(e,t,n=s){let r=Math.min(1,n.maxLongEdge/Math.max(e,t),Math.sqrt(n.maxPixels/Math.max(1,e*t)));return{width:Math.max(1,Math.floor(e*r)),height:Math.max(1,Math.floor(t*r)),scale:r}}async function m(e){let t,n;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let r=await (t=URL.createObjectURL(e),(n=new Image).decoding="async",new Promise((e,r)=>{n.onload=()=>e(n),n.onerror=()=>r(Error("IMAGE_ELEMENT_DECODE_FAILED")),n.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!r.naturalWidth||!r.naturalHeight)throw Error("IMAGE_EMPTY");return r}async function g(t){let{heicTo:n}=await e.A(462684);return n({blob:t,type:"image/jpeg",quality:.95})}function p(e,t){return new Promise((n,r)=>{e.toBlob(e=>e?n(e):r(Error("CANVAS_EMPTY")),"image/jpeg",t)})}function w(e,t,n,r,i){let o,s=((o=document.createElement("canvas")).width=n,o.height=r,o),h=s.getContext("2d");if(!h)throw Error("CANVAS_UNSUPPORTED");return a(h,e,t,n,r,i),s}async function f(e,t){var n;let i,a=performance.now(),o=await e.arrayBuffer(),s=performance.now()-a,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),r=[t(8,12)];for(let e=16;e+4<=n;e+=4)r.push(t(e,e+4));if(r.some(e=>l.has(e)))return"heic";if(r.some(e=>d.has(e)))return"avif";if(r.some(e=>c.has(e)))return"heic"}return"unknown"}(new Uint8Array(o,0,Math.min(o.byteLength,64))),y=e.type||"",v=performance.now(),b="native",C=new Blob([o],{type:y||"application/octet-stream"});try{i=await m(C)}catch(e){if("heic"!==f)throw new h("unknown"===f?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",f,e);t?.();try{i=await m(await g(C)),b="heic"}catch(e){throw new h("HEIC_DECODE_FAILED",f,e)}}let{width:D,height:M}=(n=i)instanceof HTMLImageElement?{width:n.naturalWidth,height:n.naturalHeight}:{width:n.width,height:n.height};if(!D||!M)throw new h("IMAGE_DECODE_FAILED",f);let k=u(D,M,{maxLongEdge:1600,maxPixels:1/0}),E=r(D,M,x),R=await p(w(i,E,k.width,k.height),.85),j=URL.createObjectURL(R),N=performance.now()-v;return{source:i,width:D,height:M,format:f,decoder:b,previewUrl:j,sourceType:y,sourceBytes:e.size,timings:{read:Math.round(s),convert:Math.round(N)},dispose:()=>{URL.revokeObjectURL(j),i instanceof HTMLImageElement||i.close()}}}let x={x:0,y:0,width:1,height:1};async function y(e,t=x,n=s){var i;let a=performance.now(),o=r(e.width,e.height,t),h=u(o.outputWidth,o.outputHeight,n),l=w(e.source,o,h.width,h.height,t.erase),c=performance.now()-a,d=performance.now(),m=n.startQuality,g=await p(l,m);for(let r=0;g.size>n.maxBytes&&r<12;r++)m-.05>=n.minQuality-1e-9?m=Math.round((m-.05)*100)/100:(h={width:Math.max(1,Math.floor(.85*h.width)),height:Math.max(1,Math.floor(.85*h.height)),scale:.85*h.scale},l=w(e.source,o,h.width,h.height,t.erase)),g=await p(l,m);return{dataUrl:await (i=g,new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=()=>t(n.error??Error("READ_FAILED")),n.readAsDataURL(i)})),width:h.width,height:h.height,bytes:g.size,quality:m,timings:{crop:Math.round(c),compress:Math.round(performance.now()-d)}}}e.s(["K",0,s,"o",0,h,"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,f,"X",0,y],213761)}])})();
|
|
1
|
+
(()=>{"use strict";(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,837817,232660,e=>{var t=e.i(456420);let n={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};n.node;let r=(0,t.f)(n);e.s(["f",0,r],837817);var i=e.i(271645),a={x:0,y:0,width:0,height:0,unit:"px"},o=(e,t,n)=>Math.min(Math.max(e,t),n),s=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function h(e,t,n){return"%"===e.unit?{...a,...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 l(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}:{...a,...e,unit:"px"}}function c(e,t,n,r,i,a=0,o=0,s=r,h=i){let l={...e},d=Math.min(a,r),u=Math.min(o,i),m=Math.min(s,r),g=Math.min(h,i);t&&(t>1?(u=(d=o?o*t:d)/t,m=s*t):(d=(u=a?a/t:u)*t,g=h/t)),l.y<0&&(l.height=Math.max(l.height+l.y,u),l.y=0),l.x<0&&(l.width=Math.max(l.width+l.x,d),l.x=0);let p=r-(l.x+l.width);p<0&&(l.x=Math.min(l.x,r-d),l.width+=p);let w=i-(l.y+l.height);if(w<0&&(l.y=Math.min(l.y,i-u),l.height+=w),l.width<d&&(("sw"===n||"nw"==n)&&(l.x-=d-l.width),l.width=d),l.height<u&&(("nw"===n||"ne"==n)&&(l.y-=u-l.height),l.height=u),l.width>m&&(("sw"===n||"nw"==n)&&(l.x-=m-l.width),l.width=m),l.height>g&&(("nw"===n||"ne"==n)&&(l.y-=g-l.height),l.height=g),t){let e=l.width/l.height;if(e<t){let e=Math.max(l.width/t,u);("nw"===n||"ne"==n)&&(l.y-=e-l.height),l.height=e}else if(e>t){let e=Math.max(l.height*t,d);("sw"===n||"nw"==n)&&(l.x-=e-l.width),l.width=e}}return l}var d={capture:!0,passive:!1},u=0,m=class e extends i.PureComponent{static xOrds=["e","w"];static yOrds=["n","s"];static xyOrds=["nw","ne","se","sw"];static nudgeStep=1;static nudgeStepMedium=10;static nudgeStepLarge=100;static defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};get document(){return document}docMoveBound=!1;mouseDownOnCrop=!1;dragStarted=!1;evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0};componentRef=(0,i.createRef)();mediaRef=(0,i.createRef)();resizeObserver;initChangeCalled=!1;instanceId=`rc-${u++}`;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:r,height:i}=e.getBoundingClientRect();return{x:t,y:n,width:r,height:i}}componentDidUpdate(e){let{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){let{width:e,height:r}=this.getBox();e&&r&&n(l(t,e,r),h(t,e,r))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||=(this.document.addEventListener("pointermove",this.onDocPointerMove,d),this.document.addEventListener("pointerup",this.onDocPointerDone,d),this.document.addEventListener("pointercancel",this.onDocPointerDone,d),!0)}unbindDocMove(){this.docMoveBound&&=(this.document.removeEventListener("pointermove",this.onDocPointerMove,d),this.document.removeEventListener("pointerup",this.onDocPointerDone,d),this.document.removeEventListener("pointercancel",this.onDocPointerDone,d),!1)}onCropPointerDown=e=>{let{crop:t,disabled:n}=this.props,r=this.getBox();if(!t)return;let i=l(t,r.width,r.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=i.x,c=i.y;if(a){let t=e.clientX-r.x,n=e.clientY-r.y,l=0,d=0;"ne"===a||"e"==a?(l=t-(i.x+i.width),d=n-i.y,h=i.x,c=i.y+i.height):"se"===a||"s"===a?(l=t-(i.x+i.width),d=n-(i.y+i.height),h=i.x,c=i.y):"sw"===a||"w"==a?(l=t-i.x,d=n-(i.y+i.height),h=i.x+i.width,c=i.y):("nw"===a||"n"==a)&&(l=t-i.x,d=n-i.y,h=i.x+i.width,c=i.y+i.height),o=h+r.x+l,s=c+r.y+d}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:r,keepSelection:i,onChange:a}=this.props,o=this.getBox();if(n||r||i&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let s=e.clientX-o.x,c=e.clientY-o.y,d={unit:"px",x:s,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:s,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,a(l(d,o.width,o.height),h(d,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})};onDocPointerMove=e=>{let t,{crop:n,disabled:r,onChange:i,onDragStart:a}=this.props,o=this.getBox();if(r||!n||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,a&&a(e));let{evData:c}=this;c.clientX=e.clientX,c.clientY=e.clientY,s(n,t=c.isResize?this.resizeCrop():this.dragCrop())||i(l(t,o.width,o.height),h(t,o.width,o.height))};onComponentKeyDown=t=>{let{crop:n,disabled:r,onChange:i,onComplete:a}=this.props;if(r)return;let s=t.key,c=!1;if(!n)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"===s?(u.x-=m,c=!0):"ArrowRight"===s?(u.x+=m,c=!0):"ArrowUp"===s?(u.y-=m,c=!0):"ArrowDown"===s&&(u.y+=m,c=!0),c){t.cancelable&&t.preventDefault(),u.x=o(u.x,0,d.width-u.width),u.y=o(u.y,0,d.height-u.height);let e=l(u,d.width,d.height),n=h(u,d.width,d.height);i(e,n),a&&a(e,n)}};onHandlerKeyDown=(t,n)=>{var r,i;let a,{aspect:o=0,crop:d,disabled:u,minWidth:m=0,minHeight:g=0,maxWidth:p,maxHeight:w,onChange:f,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 v=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,b=c((r=l(d,y.width,y.height),i=t.key,a={...r},"ArrowLeft"===i?"nw"===n?(a.x-=v,a.y-=v,a.width+=v,a.height+=v):"w"===n?(a.x-=v,a.width+=v):"sw"===n?(a.x-=v,a.width+=v,a.height+=v):"ne"===n?(a.y+=v,a.width-=v,a.height-=v):"e"===n?a.width-=v:"se"===n&&(a.width-=v,a.height-=v):"ArrowRight"===i&&("nw"===n?(a.x+=v,a.y+=v,a.width-=v,a.height-=v):"w"===n?(a.x+=v,a.width-=v):"sw"===n?(a.x+=v,a.width-=v,a.height-=v):"ne"===n?(a.y-=v,a.width+=v,a.height+=v):"e"===n?a.width+=v:"se"===n&&(a.width+=v,a.height+=v)),"ArrowUp"===i?"nw"===n?(a.x-=v,a.y-=v,a.width+=v,a.height+=v):"n"===n?(a.y-=v,a.height+=v):"ne"===n?(a.y-=v,a.width+=v,a.height+=v):"sw"===n?(a.x+=v,a.width-=v,a.height-=v):"s"===n?a.height-=v:"se"===n&&(a.width-=v,a.height-=v):"ArrowDown"===i&&("nw"===n?(a.x+=v,a.y+=v,a.width-=v,a.height-=v):"n"===n?(a.y+=v,a.height-=v):"ne"===n?(a.y+=v,a.width-=v,a.height-=v):"sw"===n?(a.x-=v,a.width+=v,a.height+=v):"s"===n?a.height+=v:"se"===n&&(a.width+=v,a.height+=v)),a),o,n,y.width,y.height,m,g,p,w);if(!s(d,b)){let e=h(b,y.width,y.height);f(b,e),x&&x(b,e)}};onDocPointerDone=e=>{let{crop:t,disabled:n,onComplete:r,onDragEnd:i}=this.props,a=this.getBox();this.unbindDocMove(),!(n||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),r&&r(l(t,a.width,a.height),h(t,a.width,a.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,i=e.clientY-e.startClientY;return n.x=o(e.startCropX+r,0,t.width-n.width),n.y=o(e.startCropY+i,0,t.height-n.height),n}getPointRegion(e,t,n,r){let{evData:i}=this,a=i.clientX-e.x,o=i.clientY-e.y,s;return s=r&&t?"nw"===t||"n"===t||"ne"===t:o<i.startCropY,(n&&t?"nw"===t||"w"===t||"sw"===t:a<i.startCropX)?s?"nw":"sw":s?"ne":"se"}resolveMinDimensions(e,t,n=0,r=0){let i=Math.min(n,e.width),a=Math.min(r,e.height);return t&&(i||a)?t>1?i?[i,i/t]:[a*t,a]:a?[a*t,a]:[i,i/t]:[i,a]}resizeCrop(){let{evData:t}=this,{aspect:n=0,maxWidth:r,maxHeight:i}=this.props,a=this.getBox(),[s,h]=this.resolveMinDimensions(a,n,this.props.minWidth,this.props.minHeight),l=this.makePixelCrop(a),d=this.getPointRegion(a,t.ord,s,h),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)),(h&&"nw"===u||"n"===u||"ne"===u)&&(g=Math.min(g,-h));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===d?(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"===d?(p.x=t.startCropX,p.y=t.startCropY,p.width=m,n?p.height=p.width/n:p.height=g):"sw"===d?(p.x=t.startCropX+m,p.y=t.startCropY,p.width=Math.abs(m),n?p.height=p.width/n:p.height=g):"nw"===d&&(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 w=c(p,n,d,a.width,a.height,s,h,r,i);return n||e.xyOrds.indexOf(u)>-1?l=w:e.xOrds.indexOf(u)>-1?(l.x=w.x,l.width=w.width):e.yOrds.indexOf(u)>-1&&(l.y=w.y,l.height=w.height),l.x=o(l.x,0,a.width-l.width),l.y=o(l.y,0,a.height-l.height),l}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:n,locked:r,renderSelectionAddon:a,ruleOfThirds:o,crop:s}=this.props,h=this.getCropStyle();if(s)return i.default.createElement("div",{style:h,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!r&&i.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},i.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),i.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),i.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&i.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},a(this.state)),o&&i.default.createElement(i.default.Fragment,null,i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),i.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return l({...a,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:n,className:r,crop:a,disabled:o,locked:s,style:h,ruleOfThirds:l}=this.props,{cropIsActive:c,newCropIsBeingDrawn:d}=this.state,u=a?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",r,c&&"ReactCrop--active",o&&"ReactCrop--disabled",s&&"ReactCrop--locked",d&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&n&&"ReactCrop--circular-crop",a&&l&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return i.default.createElement("div",{ref:this.componentRef,className:m,style:h},i.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),a?i.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},i.default.createElement("defs",null,i.default.createElement("mask",{id:`hole-${this.instanceId}`},i.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),n?i.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"}):i.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"}))),i.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};e.s(["f",0,m],232660)},12130,271945,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(456420);let i={name:"eraser",size:24,node:[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]};i.node;let a=(0,r.f)(i);var o=e.i(395925);let s={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};s.node;let h=(0,r.f)(s);var l=e.i(759659),c=e.i(837817),d=e.i(232660),u=e.i(519455),m=e.i(776639),g=e.i(263676),p=e.i(111110),w=e.i(895133);let f={maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},x=(0,n.forwardRef)(function({imageSrc:e,regions:r,onChange:i,imageStyle:a=f,onImageLoad:o},s){let{t:h}=(0,p.b)(),l=(0,n.useRef)(null),c=(0,n.useRef)(null),[d,u]=(0,n.useState)(null),m=e=>{let t=l.current.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.height}},x=()=>{d&&d.width>=.02&&d.height>=.02&&i([...r,d]),c.current=null,u(null)},y=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:s,src:e,alt:"",draggable:!1,style:a,onLoad:o,className:"block"}),(0,t.jsxs)("div",{ref:l,className:"absolute inset-0 cursor-crosshair",style:{touchAction:"none"},onPointerDown:e=>{0===e.button&&(l.current?.setPointerCapture(e.pointerId),c.current=m(e),u(null))},onPointerMove:e=>{if(!c.current)return;let t=m(e);u((0,w.w)(c.current.x,c.current.y,t.x,t.y))},onPointerUp:x,onPointerCancel:x,children:[r.map((e,n)=>(0,t.jsxs)("div",{className:"absolute border-2 border-sky-400 bg-sky-400/15",style:y(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":h.batchImport.removeRegion.replace("{index}",String(n+1)),onPointerDown:e=>e.stopPropagation(),onClick:()=>i(r.filter((e,t)=>t!==n)),children:(0,t.jsx)(g.X,{className:"h-3 w-3"})})]},n)),d&&(0,t.jsx)("div",{className:"absolute border-2 border-dashed border-yellow-300 bg-yellow-300/10",style:y(d)})]})]})}),y={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"}]]};y.node;let v=(0,r.f)(y),b={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"}]]};b.node;let C=(0,r.f)(b);function D({zoom:e,onZoomIn:n,onZoomOut:r,onReset:i}){let{t:a}=(0,p.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:r,disabled:e<=1,"aria-label":a.common.cropper.zoomOut,title:a.common.cropper.zoomOut,children:(0,t.jsx)(C,{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:i,"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)(v,{className:"h-4 w-4"})})]})}var M=e.i(201276),k=e.i(804536);let E="image-cropper-mode",j=["single","auto","multi"];e.s(["U",0,j,"p",0,E,"S",0,["image","text","file","direct"],"c",0,"question-input-mode","k",0,["image","text"]],271945);let R={single:{maxHeight:"70vh",maxWidth:"100%",objectFit:"contain"},auto:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"},multi:{maxHeight:"65vh",maxWidth:"100%",objectFit:"contain"}},N=[{key:"thin",pixels:3},{key:"medium",pixels:7},{key:"thick",pixels:14}];e.s(["f",0,function({imageSrc:e,open:r,onClose:i,onCropComplete:s,onMultiCropComplete:g,onRegionsSelected:f,allowMulti:y=!0,onAutoSplit:v,onAddPart:b,partCount:C=0,eraseEnabled:S=!0}){let{t:I}=(0,p.b)(),L=(0,w.f)(e),[P,H]=(0,n.useState)({src:e,rotation:0}),_=P.src===e?P.rotation:0,[$,A]=(0,n.useState)(null),Y=0===_?L:$&&$.src===L&&$.rotation===_?$.url:L;(0,n.useEffect)(()=>{if(!L||0===_)return;let e=!1,t=null,n=new Image;return n.decoding="async",n.src=L,n.decode().then(()=>{if(e)return;let r=(0,w.h)(n.naturalWidth,n.naturalHeight,{x:0,y:0,width:1,height:1,rotation:_}),i=(0,w.s)(n.naturalWidth,n.naturalHeight,_),a=document.createElement("canvas");a.width=i.width,a.height=i.height;let o=a.getContext("2d");o&&((0,w.D)(o,n,r,i.width,i.height),a.toBlob(n=>{n&&!e&&A({src:L,rotation:_,url:t=URL.createObjectURL(n)})},"image/jpeg",.9))}).catch(e=>{M.V.warn("[ImageCropper]","Rotate preview failed",{error:e})}),()=>{e=!0,t&&URL.revokeObjectURL(t)}},[L,_]);let[X,B]=(0,n.useState)(),O=(0,n.useRef)(null),[U,z]=(0,k.y)(E,j,"single"),K=["single",...v?["auto"]:[],...g||f&&y?["multi"]:[]],W=K.includes(U)?U:"single",[T,F]=(0,n.useState)(null),q=null===T?R[W]:{...R[W],maxHeight:`${Math.max(0,T-16)}px`},{containerRef:G,container:V,zoom:Q,imageStyle:Z,measureImage:J,zoomIn:ee,zoomOut:et,reset:en}=function(e){let[t,r]=(0,n.useState)(null),i=(0,n.useRef)(null),a=(0,n.useCallback)(e=>{i.current=e,r(e)},[]),[o,s]=(0,n.useState)(1),h=(0,n.useRef)(1),[l,c]=(0,n.useState)(null),d=(0,n.useRef)(null),u=(0,n.useRef)(!1),m=(0,n.useCallback)((e,t,n)=>{let r=i.current,a=h.current,o=Math.min(5,Math.max(1,e));if(!r||o===a)return;if(1===a){let e=r.querySelector("img");e&&c(e.clientWidth)}let l=r.getBoundingClientRect(),u=(t??l.left+l.width/2)-l.left,m=(n??l.top+l.height/2)-l.top;d.current={viewX:u,viewY:m,contentX:r.scrollLeft+u,contentY:r.scrollTop+m,ratio:o/a},h.current=o,s(o)},[]);(0,n.useLayoutEffect)(()=>{let e=i.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,n.useEffect)(()=>{if(!t)return;let e=e=>{e.preventDefault(),m(h.current*Math.exp(-(.0015*e.deltaY)),e.clientX,e.clientY)},n=null,r=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}},i=e=>{2===e.touches.length&&(n={distance:r(e.touches).distance,zoom:h.current},u.current=!0)},a=e=>{if(!n||2!==e.touches.length)return;e.preventDefault();let{distance:t,centerX:i,centerY:a}=r(e.touches);n.distance>0&&m(n.zoom*(t/n.distance),i,a)},o=e=>{e.touches.length<2&&(n=null,u.current=!1)},s=e=>{u.current&&e.stopPropagation()};return t.addEventListener("wheel",e,{passive:!1}),t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchmove",a,{passive:!1}),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),t.addEventListener("pointermove",s,{capture:!0}),()=>{t.removeEventListener("wheel",e),t.removeEventListener("touchstart",i),t.removeEventListener("touchmove",a),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),t.removeEventListener("pointermove",s,{capture:!0})}},[t,m]);let g=(0,n.useCallback)(e=>{e&&1===h.current&&c(e.clientWidth)},[]),p=(0,n.useCallback)(()=>m(1.25*h.current),[m]),w=(0,n.useCallback)(()=>m(h.current/1.25),[m]),f=(0,n.useCallback)(()=>{h.current=1,d.current=null,s(1)},[]),x=1!==o&&l?{...e,width:l*o,height:"auto",maxWidth:"none",maxHeight:"none"}:e;return{containerRef:a,container:t,zoom:o,imageStyle:x,measureImage:g,zoomIn:p,zoomOut:w,reset:f}}(q);(0,n.useEffect)(()=>{en()},[e,en]),(0,n.useEffect)(()=>{if(!V)return;let e=new ResizeObserver(([e])=>F(e.contentRect.height));return e.observe(V),()=>e.disconnect()},[V]),(0,n.useEffect)(()=>{let e=V?.querySelector("img");J(e instanceof HTMLImageElement?e:null)},[V,q.maxHeight,Q,J]);let[er,ei]=(0,n.useState)({src:e,regions:[]}),ea=er.src===e?er.regions:[],eo=t=>ei({src:e,regions:t}),es=(0,n.useRef)(null),[eh,el]=(0,n.useState)({src:e,strokes:[]}),ec=(0,n.useMemo)(()=>eh.src===e?eh.strokes:[],[eh,e]),ed=t=>el(n=>({src:e,strokes:"function"==typeof t?t(n.strokes):t})),eu=t=>{H({src:e,rotation:((_+t)%360+360)%360}),B(void 0),eo([]),ed([]),en()},[em,eg]=(0,n.useState)(!1),[ep,ew]=(0,n.useState)("medium"),[ef,ex]=(0,n.useState)(0),ey=(0,n.useRef)(null),ev=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!S||"multi"===W)return;let e=ey.current,t=O.current;if(!e||!t||0===t.clientWidth)return;e.width=t.clientWidth,e.height=t.clientHeight;let n=e.getContext("2d");n&&(n.clearRect(0,0,e.width,e.height),(0,w.c)(n,ec,{width:e.width,height:e.height},{sx:0,sy:0,sw:e.width,sh:e.height},{width:e.width,height:e.height}))},[S,W,ec,ef,Q,e,q.maxHeight]),(0,n.useEffect)(()=>{eg(!1),ev.current=null},[e]);let eb=N.find(e=>e.key===ep)?.pixels??7,eC=e=>{let t=ey.current.getBoundingClientRect();return{x:Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),y:Math.min(1,Math.max(0,(e.clientY-t.top)/t.height))}},eD=()=>{ev.current=null},eM={single:I.batchImport.singleMode,auto:I.batchImport.autoMode,multi:I.batchImport.multiMode},ek={thin:I.common.cropper.brushThin,medium:I.common.cropper.brushMedium,thick:I.common.cropper.brushThick},eE=async()=>{if(0!==ea.length){if(f){f(ea.map(e=>({...e,rotation:_})),!0),eo([]);return}if(es.current&&g)try{g(await (0,w.Y)(es.current,ea.map(e=>({...e,rotation:0})))),eo([])}catch(e){M.V.error("[ImageCropper]","Multi-image crop failed",{error:e})}}},ej=()=>({...X&&X.width>0&&X.height>0?{x:X.x/100,y:X.y/100,width:X.width/100,height:X.height/100}:{x:0,y:0,width:1,height:1},rotation:_,...ec.length?{erase:ec}:{}}),eR=async()=>{let e=ej();if("auto"===W&&v)return void v(e);if(f)return void f([e],!1);if(O.current&&s)try{let[t]=await (0,w.Y)(O.current,[{...e,rotation:0}]);s(t)}catch(e){M.V.error("[ImageCropper]","Crop failed",{error:e})}};return(0,t.jsx)(m.N,{open:r,onOpenChange:e=>!e&&i(),children:(0,t.jsxs)(m.d,{className:"max-w-3xl h-[90vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)(m.s,{className:"p-4 border-b shrink-0",children:(0,t.jsx)(m.F,{children:I.common.cropper?.title||"Crop Image"})}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 bg-black",children:[(0,t.jsx)("div",{ref:G,className:"flex h-full w-full overflow-auto p-4",children:(0,t.jsx)("div",{className:"m-auto",children:"multi"===W?(0,t.jsx)(x,{ref:es,imageSrc:Y,regions:ea,onChange:eo,imageStyle:Z,onImageLoad:e=>J(e.currentTarget)}):(0,t.jsxs)("div",{className:"relative inline-block select-none",children:[(0,t.jsx)(d.f,{crop:X,onChange:(e,t)=>B(t),disabled:em,children:(0,t.jsx)("img",{ref:O,alt:"Crop me",src:Y,onLoad:function(e){B({unit:"%",x:0,y:0,width:100,height:100}),J(e.currentTarget),ex(e=>e+1)},style:Z,className:"block"})}),S&&(0,t.jsx)("canvas",{ref:ey,"aria-hidden":!0,className:`absolute inset-0 ${em?"cursor-crosshair":"pointer-events-none"}`,style:{touchAction:"none"},onPointerDown:e=>{if(!em||0!==e.button)return;e.preventDefault(),ey.current?.setPointerCapture(e.pointerId);let t=ey.current;ev.current=ec.length,ed([...ec,{points:[eC(e)],radius:t?eb/t.clientWidth:.006}])},onPointerMove:e=>{let t=ev.current;if(null===t)return;let n=eC(e);ed(e=>e.map((e,r)=>{if(r!==t)return e;let i=e.points[e.points.length-1];return i&&5e-4>Math.abs(i.x-n.x)&&5e-4>Math.abs(i.y-n.y)?e:{...e,points:[...e.points,n]}}))},onPointerUp:eD,onPointerCancel:eD})]})})}),(0,t.jsxs)("div",{className:"absolute left-3 top-3 flex gap-1 rounded-md bg-background/90 p-1 shadow-sm",children:[(0,t.jsx)(u.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>eu(-90),"aria-label":I.common.cropper.rotateLeft,title:I.common.cropper.rotateLeft,children:(0,t.jsx)(o.f,{className:"h-4 w-4"})}),(0,t.jsx)(u.f,{size:"icon",variant:"ghost",className:"h-8 w-8",onClick:()=>eu(90),"aria-label":I.common.cropper.rotateRight,title:I.common.cropper.rotateRight,children:(0,t.jsx)(h,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"absolute right-3 top-3",children:(0,t.jsx)(D,{zoom:Q,onZoomIn:ee,onZoomOut:et,onReset:en})})]}),(0,t.jsxs)("div",{className:"p-4 border-t bg-background shrink-0 space-y-3",children:[K.length>1&&(0,t.jsx)("div",{className:`grid gap-1 rounded-md bg-muted p-1 ${3===K.length?"grid-cols-3 sm:w-[28rem]":"grid-cols-2 sm:w-80"}`,children:K.map(e=>(0,t.jsx)("button",{type:"button","aria-pressed":W===e,onClick:()=>{en(),z(e),"multi"===e&&(eg(!1),ed([]))},className:`rounded px-2 py-1.5 text-sm font-medium transition-colors ${W===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:eM[e]},e))}),S&&"multi"!==W&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)(u.f,{variant:em?"secondary":"outline",size:"sm",onClick:()=>{eg(e=>!e),ev.current=null},className:"flex items-center gap-2",children:[(0,t.jsx)(a,{className:"h-4 w-4"}),em?I.common.cropper.eraseDone:I.common.cropper.erase]}),em&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex gap-1 rounded-md bg-muted p-1",children:N.map(({key:e})=>(0,t.jsx)("button",{type:"button","aria-pressed":ep===e,onClick:()=>ew(e),className:`rounded px-2 py-1 text-xs font-medium ${ep===e?"bg-background shadow-sm":"text-muted-foreground"}`,children:ek[e]},e))}),ec.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:()=>ed(ec.slice(0,-1)),className:"flex items-center gap-1.5",children:[(0,t.jsx)(c.f,{className:"h-4 w-4"}),I.common.cropper.undoErase]}),(0,t.jsxs)(u.f,{variant:"ghost",size:"sm",onClick:()=>ed([]),className:"flex items-center gap-1.5",children:[(0,t.jsx)(l.f,{className:"h-4 w-4"}),I.common.cropper.clearErase]})]})]})]}),(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"===W?`${I.batchImport.hint} ${I.batchImport.regionCount.replace("{count}",String(ea.length))}`:em?I.common.cropper.eraseHint:"auto"===W?I.batchImport.autoHint:C>0?I.upload.parts.cropHint.replace("{n}",String(C+1)):I.common.cropper?.hint||"💡 Drag to adjust crop area"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 justify-end",children:["multi"===W&&ea.length>0&&(0,t.jsx)(u.f,{variant:"ghost",onClick:()=>eo([]),children:I.batchImport.clear}),(0,t.jsx)(u.f,{variant:"outline",onClick:i,children:I.common.cancel||"Cancel"}),"multi"===W?(0,t.jsx)(u.f,{onClick:eE,disabled:0===ea.length,children:I.batchImport.start.replace("{count}",String(ea.length))}):(0,t.jsxs)(t.Fragment,{children:["single"===W&&b&&(0,t.jsx)(u.f,{variant:"secondary",onClick:()=>b(ej()),"data-testid":"crop-add-part",children:I.upload.parts.addNext}),(0,t.jsx)(u.f,{onClick:eR,children:"auto"===W?I.batchImport.autoStart:C>0?I.upload.parts.confirm.replace("{count}",String(C+1)):I.common.confirm||"Confirm"})]})]})]})]})]})})}],12130)},574041,e=>{var t=e.i(843476),n=e.i(271645),r=e.i(263676),i=e.i(487486),a=e.i(793479),o=e.i(41931),s=e.i(201276);e.s(["f",0,function({value:e=[],onChange:h,placeholder:l="Enter tags...",className:c="",enterHint:d,subject:u,gradeStage:m}){let[g,p]=(0,n.useState)(""),[w,f]=(0,n.useState)([]),[x,y]=(0,n.useState)(!1),[v,b]=(0,n.useState)(0),C=(0,n.useRef)(null),D=(0,n.useRef)(null),M=(0,n.useCallback)(async t=>{try{let n=new URLSearchParams({q:t});u&&n.append("subject",u),m&&n.append("stage",m);let r=((await o.k.get(`/api/tags/suggestions?${n.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));f(r.slice(0,20)),y(r.length>0),b(0)}catch(e){s.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[u,m,e]);(0,n.useEffect)(()=>{g.trim()&&M(g)},[g,M]);let k=t=>{t.trim()&&!e.includes(t.trim())&&(h([...e,t.trim()]),p(""),f([]),y(!1),b(0))},E=t=>{h(e.filter(e=>e!==t))};return(0,n.useEffect)(()=>{let e=e=>{!D.current||D.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)(i.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)(r.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()||(f([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),v>=0&&w[v]?k(w[v]):g.trim()&&k(g)):"ArrowDown"===t.key?(t.preventDefault(),b(e=>Math.min(e+1,w.length-1))):"ArrowUp"===t.key?(t.preventDefault(),b(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),b(0)):"Backspace"===t.key&&!g&&e.length>0&&E(e[e.length-1])},onFocus:()=>{w.length>0&&y(!0)},placeholder:0===e.length?l:"",className:"flex-1 min-w-[120px] border-none focus-visible:ring-0 focus-visible:ring-offset-0 h-8 px-0"})]}),x&&w.length>0&&(0,t.jsx)("div",{ref:D,className:"absolute z-50 w-full mt-1 bg-popover border rounded-md shadow-md max-h-48 overflow-y-auto",children:w.map((e,n)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${n===v?"bg-accent":""}`,onClick:()=>k(e),onMouseEnter:()=>b(n),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}"`})]})}])},804536,e=>{var t=e.i(271645);let n=new Map,r=new Set;function i(e){return r.add(e),window.addEventListener("storage",e),()=>{r.delete(e),window.removeEventListener("storage",e)}}function a(e,a,o){let s=(0,t.useSyncExternalStore)(i,()=>(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(s),[a,s]),(0,t.useCallback)(t=>(function(e,t){try{window.localStorage.setItem(e,t),n.delete(e)}catch{n.set(e,t)}r.forEach(e=>e())})(e,o(t)),[e,o])]}let o=e=>e;e.s(["y",0,function(e,n,r){return a(e,(0,t.useCallback)(e=>n.includes(e??"")?e:r,[n,r]),o)},"x",0,a])},213761,895133,e=>{let t=[0,90,180,270];function n(e,t,r=0){let i=90===r||270===r;return{width:i?t:e,height:i?e:t}}function r(e,r,i){let a,o,s,h,l=t.includes(i.rotation??0)?i.rotation??0:0,c=n(e,r,l),d=e=>Math.min(1,Math.max(0,e)),u=Math.round(d(i.x)*c.width),m=Math.round(d(i.y)*c.height),g=Math.max(1,Math.min(c.width-u,Math.round(d(i.width)*c.width))),p=Math.max(1,Math.min(c.height-m,Math.round(d(i.height)*c.height)));switch(l){case 90:a=m,o=c.width-u-g,s=p,h=g;break;case 180:a=e-u-g,o=r-m-p,s=g,h=p;break;case 270:a=e-m-p,o=u,s=p,h=g;break;default:a=u,o=m,s=g,h=p}return{rotation:l,frameWidth:c.width,frameHeight:c.height,fx:u,fy:m,fw:g,fh:p,sx:a,sy:o,sw:s,sh:h,outputWidth:g,outputHeight:p}}function i(e,t,n,r,i){if(0===t.length)return;let a=i.width/r.sw,o=i.height/r.sh;for(let i of(e.save(),e.fillStyle="#ffffff",e.strokeStyle="#ffffff",e.lineCap="round",e.lineJoin="round",t)){if(0===i.points.length)continue;let t=i.points.map(e=>({x:(e.x*n.width-r.sx)*a,y:(e.y*n.height-r.sy)*o})),s=Math.max(.5,i.radius*n.width*a);if(1===t.length){e.beginPath(),e.arc(t[0].x,t[0].y,s,0,2*Math.PI),e.fill();continue}for(let n of(e.beginPath(),e.moveTo(t[0].x,t[0].y),t.slice(1)))e.lineTo(n.x,n.y);e.lineWidth=2*s,e.stroke()}e.restore()}function a(e,t,n,r,o,s=[]){switch(e.fillStyle="#ffffff",e.fillRect(0,0,r,o),e.imageSmoothingEnabled=!0,e.imageSmoothingQuality="high",e.save(),n.rotation){case 90:e.translate(r,0),e.rotate(Math.PI/2);break;case 180:e.translate(r,o),e.rotate(Math.PI);break;case 270:e.translate(0,o),e.rotate(-Math.PI/2)}let h=90===n.rotation||270===n.rotation;e.drawImage(t,n.sx,n.sy,n.sw,n.sh,0,0,h?o:r,h?r:o),e.restore(),i(e,s,{width:n.frameWidth,height:n.frameHeight},{sx:n.fx,sy:n.fy,sw:n.fw,sh:n.fh},{width:r,height:o})}async function o(e,t){let{naturalWidth:n,naturalHeight:i}=e;return Promise.all(t.map(t=>new Promise((o,s)=>{let h=r(n,i,t),l=document.createElement("canvas");l.width=h.outputWidth,l.height=h.outputHeight;let c=l.getContext("2d");c?(a(c,e,h,h.outputWidth,h.outputHeight,t.erase??[]),l.toBlob(e=>e?o(e):s(Error("Canvas is empty")),"image/jpeg",.95)):s(Error("Canvas is not supported"))})))}e.s(["c",0,function(e,t,n,r,a){i(e,t,n,r,a)},"B",0,function(e){let t=e.match(/^data:(image\/(?:png|jpe?g|webp|gif));base64,([\s\S]+)$/);if(!t)return null;try{let e=atob(t[2]),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return new Blob([n],{type:t[1]})}catch{return null}},"Y",0,o,"D",0,a,"w",0,function(e,t,n,r){let i=e=>Math.min(1,Math.max(0,e)),a=i(Math.min(e,n)),o=i(Math.min(t,r));return{x:a,y:o,width:i(Math.max(e,n))-a,height:i(Math.max(t,r))-o}},"h",0,r,"s",0,n,"f",0,function(e){return/^(blob:|data:image\/)/i.test(e)?e:void 0}],895133);let s={maxLongEdge:4096,maxPixels:4915200,maxBytes:1572864,startQuality:.9,minQuality:.8};class h 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 l=new Set(["heic","heix","heim","heis","hevc","hevx","hevm","hevs"]),c=new Set(["mif1","msf1","mif2"]),d=new Set(["avif","avis"]);function u(e,t,n=s){let r=Math.min(1,n.maxLongEdge/Math.max(e,t),Math.sqrt(n.maxPixels/Math.max(1,e*t)));return{width:Math.max(1,Math.floor(e*r)),height:Math.max(1,Math.floor(t*r)),scale:r}}async function m(e){let t,n;if("function"==typeof createImageBitmap)try{return await createImageBitmap(e,{imageOrientation:"from-image"})}catch{}let r=await (t=URL.createObjectURL(e),(n=new Image).decoding="async",new Promise((e,r)=>{n.onload=()=>e(n),n.onerror=()=>r(Error("IMAGE_ELEMENT_DECODE_FAILED")),n.src=t}).finally(()=>URL.revokeObjectURL(t)));if(!r.naturalWidth||!r.naturalHeight)throw Error("IMAGE_EMPTY");return r}async function g(t){let{heicTo:n}=await e.A(462684);return n({blob:t,type:"image/jpeg",quality:.95})}function p(e,t,n="image/jpeg"){let{promise:r,resolve:i,reject:a}=Promise.withResolvers();return e.toBlob(e=>e?i(e):a(Error("CANVAS_EMPTY")),n,t),r}async function w(e,t){let n=await p(e,t,"image/webp");return"image/webp"===n.type||"image/jpeg"===n.type?n:p(e,t,"image/jpeg")}function f(e,t,n,r,i){let o,s=((o=document.createElement("canvas")).width=n,o.height=r,o),h=s.getContext("2d");if(!h)throw Error("CANVAS_UNSUPPORTED");return a(h,e,t,n,r,i),s}async function x(e,t){var n;let i,a=performance.now(),o=await e.arrayBuffer(),s=performance.now()-a,w=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),r=[t(8,12)];for(let e=16;e+4<=n;e+=4)r.push(t(e,e+4));if(r.some(e=>l.has(e)))return"heic";if(r.some(e=>d.has(e)))return"avif";if(r.some(e=>c.has(e)))return"heic"}return"unknown"}(new Uint8Array(o,0,Math.min(o.byteLength,64))),x=e.type||"",v=performance.now(),b="native",C=new Blob([o],{type:x||"application/octet-stream"});try{i=await m(C)}catch(e){if("heic"!==w)throw new h("unknown"===w?"UNSUPPORTED_IMAGE":"IMAGE_DECODE_FAILED",w,e);t?.();try{i=await m(await g(C)),b="heic"}catch(e){throw new h("HEIC_DECODE_FAILED",w,e)}}let{width:D,height:M}=(n=i)instanceof HTMLImageElement?{width:n.naturalWidth,height:n.naturalHeight}:{width:n.width,height:n.height};if(!D||!M)throw new h("IMAGE_DECODE_FAILED",w);let k=u(D,M,{maxLongEdge:1600,maxPixels:1/0}),E=r(D,M,y),j=await p(f(i,E,k.width,k.height),.85),R=URL.createObjectURL(j),N=performance.now()-v;return{source:i,width:D,height:M,format:w,decoder:b,previewUrl:R,sourceType:x,sourceBytes:e.size,timings:{read:Math.round(s),convert:Math.round(N)},dispose:()=>{URL.revokeObjectURL(R),i instanceof HTMLImageElement||i.close()}}}let y={x:0,y:0,width:1,height:1};async function v(e,t=y,n=s){var i;let a=performance.now(),o=r(e.width,e.height,t),h=u(o.outputWidth,o.outputHeight,n),l=f(e.source,o,h.width,h.height,t.erase),c=performance.now()-a,d=performance.now(),m=n.startQuality,g=await w(l,m);for(let r=0;g.size>n.maxBytes&&r<12;r++)m-.05>=n.minQuality-1e-9?m=Math.round((m-.05)*100)/100:(h={width:Math.max(1,Math.floor(.85*h.width)),height:Math.max(1,Math.floor(.85*h.height)),scale:.85*h.scale},l=f(e.source,o,h.width,h.height,t.erase)),g=await w(l,m);return{dataUrl:await (i=g,new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=()=>t(n.error??Error("READ_FAILED")),n.readAsDataURL(i)})),width:h.width,height:h.height,bytes:g.size,quality:m,timings:{crop:Math.round(c),compress:Math.round(performance.now()-d)}}}e.s(["K",0,s,"o",0,h,"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,x,"X",0,v],213761)}])})();
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
Defaulting to \`null\`.`}c(p,"defaultGetValueLabel"),c(v,"getProgressState"),c(y,"isNumber"),c(j,"isValidMaxNumber"),c(b,"isValidValueNumber"),c(w,"getInvalidMaxError"),c(k,"getInvalidValueError");var N=e.i(975157);let S=i.forwardRef(({className:e,value:t,...r},s)=>(0,a.jsx)(g,{ref:s,value:t,className:(0,N.f)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:(0,a.jsx)(x,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));S.displayName=g.displayName,e.s(["f",0,S],168148)},856522,e=>{var t=e.i(456420);let r={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"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],856522)},786563,e=>{var t=e.i(456420);let r={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"}]]};r.node;let s=(0,t.f)(r);e.s(["f",0,s],786563)},866531,497346,183444,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(632781),a=e.i(741120),i=e.i(856522),n=e.i(314381),l=e.i(3198),o=e.i(519455),c=e.i(111110),d=e.i(41931),u=e.i(294114),m=e.i(201276);function f({data:e,onChange:a}){let{t:i}=(0,c.b)(),[h,g]=(0,r.useState)(!1),[x,p]=(0,r.useState)(null),v=async()=>{if(!e.questionText.trim())return void u.c.warning(i.editor.enterQuestionFirst||"Please enter question text first");if(!e.answerText.trim())return void u.c.warning(i.geogebra.answerRequired);g(!0),p(null);try{let t=await d.k.post("/api/geogebra-analyze",{questionText:e.questionText,answerText:e.answerText,analysis:e.analysis},{timeout:18e4,recoverable:!0});t.suitable&&t.commands&&t.commands.length>0?a({geogebraCommands:JSON.stringify(t.commands)}):p(t.description||i.geogebra.notSuitable)}catch(e){m.V.error("[CorrectionEditor]","GeoGebra analysis failed",{error:e}),p(i.geogebra.analyzeFailed)}finally{g(!1)}};return e.geogebraCommands?(0,t.jsx)(l.f,{commands:e.geogebraCommands,height:350,onRegenerate:v,onDelete:async()=>a({geogebraCommands:void 0})}):e.questionText.trim()&&e.answerText.trim()?(0,t.jsxs)("div",{className:"rounded-lg border border-dashed p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(n.f,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:i.geogebra.title})]}),(0,t.jsx)(o.f,{variant:"outline",size:"sm",onClick:v,disabled:h,children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),i.geogebra.analyzing]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.f,{className:"mr-2 h-4 w-4"}),i.geogebra.generate]})})]}),x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:x}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:i.geogebra.hint})]}):null}var h=e.i(469937),g=e.i(28342),x=e.i(793479),p=e.i(438465),v=e.i(674166),y=e.i(110204),j=e.i(967489),b=e.i(401280);function w({data:e,paperLevel:r,onChange:s}){let{t:a}=(0,c.b)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:a.editor.selectNotebook||"Select Notebook"}),(0,t.jsx)(p.f,{value:e.subjectId,onChange:e=>s({subjectId:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{htmlFor:"correction-source",children:a.editor.source||"Source"}),(0,t.jsx)(x.f,{id:"correction-source",value:e.source??"",onChange:e=>s({source:e.target.value||null}),placeholder:a.editor.sourcePlaceholder||"e.g. Midterm exam"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:a.questionType.label||"Question Type"}),(0,t.jsxs)(j.d,{value:e.questionType||"",onValueChange:e=>s({questionType:e===b.O?null:e}),children:[(0,t.jsx)(j.P,{children:(0,t.jsx)(j.U,{placeholder:a.questionType.notSet||"Not set"})}),(0,t.jsxs)(j.r,{children:[(0,t.jsx)(j.T,{value:b.O,children:a.questionType.clear||"Clear"}),b.V.map(e=>(0,t.jsx)(j.T,{value:e,children:a.questionType.names?.[e]||e},e))]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{htmlFor:"correction-grade-semester",children:a.editor.gradeSemester||"Grade/Semester"}),(0,t.jsx)(g.f,{id:"correction-grade-semester",value:e.gradeSemester||"",onChange:e=>s({gradeSemester:e})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:a.editor.paperLevel||"Paper Level"}),(0,t.jsx)(v.f,{value:r,onChange:e=>s({paperLevel:e})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:a.difficulty.label}),(0,t.jsx)("div",{children:(0,t.jsx)(h.f,{size:"md",value:e.difficultyStars,onChange:e=>s({difficultyStars:e})})})]})]})}var k=e.i(141176),N=e.i(515288);function S({data:e,onChange:r}){let{t:s}=(0,c.b)();return(0,t.jsxs)(N.N,{children:[(0,t.jsx)(N.Y,{children:(0,t.jsx)(N.v,{children:s.editor.mistakeAnalysisTitle||"Mistake Analysis"})}),(0,t.jsxs)(N.O,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:s.editor.mistakeStatus||"Attempt Status"}),(0,t.jsxs)(j.d,{value:e.mistakeStatus||"unknown",onValueChange:e=>r({mistakeStatus:e}),children:[(0,t.jsx)(j.P,{children:(0,t.jsx)(j.U,{})}),(0,t.jsxs)(j.r,{children:[(0,t.jsx)(j.T,{value:"not_attempted",children:s.editor.mistakeStatuses?.notAttempted||"Not attempted"}),(0,t.jsx)(j.T,{value:"wrong_attempt",children:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt"}),(0,t.jsx)(j.T,{value:"unknown",children:s.editor.mistakeStatuses?.unknown||"Unknown"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(k.f,{value:e.wrongAnswerText||"",onChange:t=>r({wrongAnswerText:t,mistakeStatus:t.trim()?"wrong_attempt":e.mistakeStatus}),className:"min-h-[100px] font-mono text-sm",placeholder:s.editor.wrongAnswerPlaceholder||"Leave blank if no wrong answer is visible"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(k.f,{value:e.mistakeAnalysis||"",onChange:e=>r({mistakeAnalysis:e}),className:"min-h-[140px] font-mono text-sm",placeholder:s.editor.mistakeAnalysisPlaceholder||"Explain where and why the mistake happened"})]})]})]})}var _=e.i(511445),T=e.i(149704);function A({title:e,children:r,className:s}){return(0,t.jsxs)(N.N,{children:[(0,t.jsx)(N.Y,{children:(0,t.jsx)(N.v,{children:e})}),(0,t.jsx)(N.O,{className:s,children:r})]})}function E({data:e,children:r}){let{t:s}=(0,c.b)(),a={wrong_attempt:s.editor.mistakeStatuses?.wrongAttempt||"Wrong attempt",not_attempted:s.editor.mistakeStatuses?.notAttempted||"Not attempted",unknown:s.editor.mistakeStatuses?.unknown||"Unknown"};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)(A,{title:s.editor.preview?.question||"Question Preview",children:[(0,t.jsx)(_.f,{content:e.questionText}),(0,t.jsx)(T.f,{svg:e.figureSvg})]}),r,(0,t.jsx)(A,{title:s.editor.preview?.answer||"Answer Preview",children:(0,t.jsx)(_.f,{content:e.answerText})}),(0,t.jsx)(A,{title:s.editor.preview?.analysis||"Analysis Preview",children:(0,t.jsx)(_.f,{content:e.analysis})}),(0,t.jsxs)(A,{title:s.editor.preview?.mistakeAnalysis||"Mistake Analysis Preview",className:"space-y-3 text-sm",children:[(0,t.jsxs)("div",{className:"text-muted-foreground",children:[s.editor.mistakeStatus||"Attempt Status",s.common.colon,a[e.mistakeStatus]??a.unknown]}),e.wrongAnswerText&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.wrongAnswerText||"Wrong Answer / Work"}),(0,t.jsx)(_.f,{content:e.wrongAnswerText})]}),e.mistakeAnalysis&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-medium mb-1",children:s.editor.mistakeAnalysis||"Mistake Cause Analysis"}),(0,t.jsx)(_.f,{content:e.mistakeAnalysis})]})]})]})}var I=e.i(574041),C=e.i(215519),R=e.i(306831);e.i(676167);var z=e.i(597138),V=e.i(991722),O=e.i(470279),$=e.i(303163);e.s(["f",0,function({initialData:e,onSave:n,onCancel:l,imagePreview:h,initialSubjectId:g,aiTimeout:x}){let{timeZone:p}=(0,C.M)(),{t:v,language:j}=(0,c.b)(),b=e=>e.trim()?e:"",[_,T]=(0,r.useState)({...e,answerText:b(e.answerText),analysis:b(e.analysis),wrongAnswerText:e.wrongAnswerText||"",mistakeAnalysis:e.mistakeAnalysis||"",mistakeStatus:e.mistakeStatus||"unknown",subjectId:g,gradeSemester:e.gradeSemester||""}),A=(0,r.useRef)(!1),M=e=>{"gradeSemester"in e&&(A.current=!0),T(t=>({...t,...e}))},{groups:L}=(0,O.f)(),P=(()=>{if(_.paperLevel)return _.paperLevel;let e="number"==typeof _.difficultyStars&&_.difficultyStars>=4?"b":"a";return L.find(t=>t.key===e&&t.isActive)?.id||""})(),q=_.paperLevel??P,[G,F]=(0,r.useState)(!1),[U,D]=(0,r.useState)(!1),[H,Q]=(0,r.useState)(!1),[B,W]=(0,r.useState)(void 0),[Z,J]=(0,r.useState)([]);(0,r.useEffect)(()=>{d.k.get("/api/notebooks").then(J).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch notebooks",{error:e})),d.k.get("/api/user").then(e=>{if(Q(!!e?.enableGeogebra),e){let t=function(e,t=R.J){return"ai"===e.gradeRecognitionMode?null:e.fixedGradeSemester?e.fixedGradeSemester:e.educationStage&&e.enrollmentYear?function(e,t,r=new Date,s="en",a=R.J){let i=(0,R.c)(r,a),n=i.getFullYear(),l=i.getMonth()+1,o=n-t,c="2nd";l>=9?(o+=1,c="1st"):c=l<2?"1st":"2nd";let d="zh"===s,u=d?"1st"===c?"上期":"下期":"1st"===c?"1st Semester":"2nd Semester",m=(d?{primary:["一年级","二年级","三年级","四年级","五年级","六年级"],junior_high:["初一","初二","初三"],senior_high:["高一","高二","高三"],university:["大一","大二","大三","大四"]}:{primary:["Grade 1","Grade 2","Grade 3","Grade 4","Grade 5","Grade 6"],junior_high:["Junior High Grade 1","Junior High Grade 2","Junior High Grade 3"],senior_high:["Senior High Grade 1","Senior High Grade 2","Senior High Grade 3"],university:["Freshman","Sophomore","Junior","Senior"]})[e]||[],f=`${o}`;if(f=o>0&&o<=m.length?m[o-1]:o>m.length?d?"已毕业":"Graduated":d?"学前":"Pre-school",!d)return`${f}, ${u}`;{let e="1st"===c?"上":"下";return`${f}${e}`}}(e.educationStage,e.enrollmentYear,new Date,"zh",t):null}(e,p);T(e=>e.gradeSemester||A.current?e:{...e,gradeSemester:t||""}),W(e.educationStage||void 0)}}).catch(e=>m.V.error("[CorrectionEditor]","Failed to fetch user info for grade calculation",{error:e}))},[j,p]);let K=async()=>{if(!_.questionText.trim())return void u.c.warning(v.editor.enterQuestionFirst||"Please enter question text first");F(!0);try{let e=function({questionText:e,language:t,subject:r,imagePreview:s,gradeSemester:a,subjectId:i}){let n={questionText:e,language:t,subject:r};return s&&(n.imageBase64=s),a&&(n.gradeSemester=a),i&&(n.subjectId=i),n}({questionText:_.questionText,language:j,subject:_.subject,imagePreview:h,gradeSemester:_.gradeSemester??void 0,subjectId:_.subjectId});m.V.info("[Reanswer]",e.imageBase64?"Sending image + text (image available for mistake analysis)":"Sending text only (no image available)",{timeout:x});let t=await d.k.post("/api/reanswer",e,{timeout:x||18e4,recoverable:!0});T(e=>({...e,answerText:t.answerText,analysis:t.analysis,knowledgePoints:t.knowledgePoints,wrongAnswerText:t.wrongAnswerText||"",mistakeAnalysis:t.mistakeAnalysis||"",mistakeStatus:(0,V.x)(t.mistakeStatus,t.wrongAnswerText),difficultyStars:t.difficultyStars??e.difficultyStars,questionType:t.questionType??e.questionType})),u.c.success(v.editor.reanswerSuccess||"✅ Answer and analysis updated!")}catch(s){let e,t,r;m.V.error("[CorrectionEditor]","Reanswer failed",{error:s}),u.c.error((e=(0,$.d)(s)||"",r=(t=v.errors?.reanswer||{}).default||"Reanswer failed",e.includes("AI_AUTH_ERROR")?t.authError||v.errors?.AI_AUTH_ERROR||r:e.includes("AI_CONNECTION_FAILED")?t.connectionFailed||v.errors?.AI_CONNECTION_FAILED||r:e.includes("AI_RESPONSE_ERROR")&&(t.responseError||v.errors?.AI_RESPONSE_ERROR)||r))}finally{F(!1)}},Y=async()=>{if(!_.subjectId)return void u.c.warning(v.editor.messages?.selectNotebook||"Please select a notebook");if(!U){D(!0);try{await n({..._,paperLevel:q,mistakeStatus:(0,V.x)(_.mistakeStatus,_.wrongAnswerText)})}finally{D(!1)}}},X=v.editor.placeholder||"Supports Markdown and LaTeX...",ee=(0,z.f)(Z.find(e=>e.id===_.subjectId)?.name||null)||(0,z.f)(_.subject||null)||void 0;return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:v.editor.title}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(o.f,{variant:"outline",onClick:l,children:v.editor.cancel}),(0,t.jsxs)(o.f,{onClick:Y,disabled:U,children:[U?(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(i.f,{className:"mr-2 h-4 w-4"}),U?v.common?.pleaseWait||"Please wait...":v.editor.save]})]})]}),(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-6",children:[h&&(0,t.jsx)(N.N,{children:(0,t.jsx)(N.O,{className:"p-4",children:(0,t.jsx)("img",{src:h,alt:"Original",className:"w-full rounded-md"})})}),(0,t.jsx)(w,{data:_,paperLevel:q,onChange:M}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:v.editor.question}),(0,t.jsx)(k.f,{value:_.questionText,onChange:e=>M({questionText:e}),className:"min-h-[150px] font-mono text-sm",placeholder:X}),(0,t.jsx)(o.f,{variant:"default",size:"sm",onClick:K,disabled:G||!_.questionText.trim(),className:"w-full bg-gradient-to-r from-indigo-600 to-violet-500 hover:from-indigo-700 hover:to-violet-600 text-white font-medium",children:G?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.f,{className:"mr-2 h-4 w-4 animate-spin"}),v.editor.reanswering||"AI solving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.f,{className:"mr-2 h-4 w-4"}),v.editor.reanswer||"🔄 Reanswer (based on corrected question)"]})}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:v.editor.reanswerHint||"💡 If the question was misrecognized, correct it and click to regenerate answer"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:v.editor.tags}),(0,t.jsx)(I.f,{value:_.knowledgePoints,onChange:e=>M({knowledgePoints:e}),placeholder:v.editor.tagsPlaceholder||"Enter knowledge tags...",enterHint:v.editor.createTagHint,subject:ee,gradeStage:B}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:v.editor.tagsHint||"💡 Tag suggestions will appear as you type"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:v.editor.answer}),(0,t.jsx)(k.f,{value:_.answerText,onChange:e=>M({answerText:e}),className:"min-h-[100px] font-mono text-sm",placeholder:X})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.f,{children:v.editor.analysis}),(0,t.jsx)(k.f,{value:_.analysis,onChange:e=>M({analysis:e}),className:"min-h-[200px] font-mono text-sm",placeholder:X})]}),(0,t.jsx)(S,{data:_,onChange:M})]}),(0,t.jsx)(E,{data:_,children:H&&(0,t.jsx)(f,{data:_,onChange:M})})]})]})}],866531);var M=e.i(853138),L=e.i(263676);e.s(["f",0,function({message:e,onDismiss:r}){let{t:s}=(0,c.b)();return e?(0,t.jsxs)("div",{role:"alert",className:"flex items-start gap-3 rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:[(0,t.jsx)(M.f,{"aria-hidden":"true",className:"mt-0.5 h-4 w-4 shrink-0"}),(0,t.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:e}),(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":s.common.close,className:"shrink-0 rounded p-1 hover:bg-destructive/10",children:(0,t.jsx)(L.X,{"aria-hidden":"true",className:"h-4 w-4"})})]}):null}],497346);var P=e.i(618566),q=e.i(707212);function G(e){return"object"!=typeof e||null===e||Array.isArray(e)?void 0:e}function F(e,t){if("string"!=typeof e||!/^(QUESTION_SAVE_|AI_)[A-Z_]+$/.test(e))return;let r=t.errors[e];return"string"==typeof r?r:void 0}e.s(["f",0,function(e){let{t}=(0,c.b)(),s=(0,P.useRouter)(),[a,i]=(0,r.useState)(null),n=async(r,a,n=!0)=>{i(null);try{let e=await r();return u.c.success(e.duplicate?t.importFlow.duplicate:t.common.messages.saveSuccess),n&&(e.duplicate?s.push(`/error-items/${e.id}`):a&&s.push(`/notebooks/${a}`)),!0}catch(s){m.V.error(e,"Save failed",{errorMessage:(0,$.d)(s)??(0,$.Z)(s)});let r=function(e,t){let r=G(e),s=G(r?.data),a="number"==typeof r?.status?r.status:void 0,i=(0,$.d)(e),n=F(i,t)??F(s?.code,t),l={400:t.errors.QUESTION_SAVE_INVALID_INPUT,401:t.errors.QUESTION_SAVE_UNAUTHORIZED,403:t.errors.QUESTION_SAVE_FORBIDDEN,408:t.errors.QUESTION_SAVE_TIMEOUT,409:t.errors.QUESTION_SAVE_CONFLICT,413:t.errors.QUESTION_SAVE_TOO_LARGE,429:t.errors.QUESTION_SAVE_RATE_LIMITED,502:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,503:t.errors.QUESTION_SAVE_SERVER_UNAVAILABLE,504:t.errors.QUESTION_SAVE_TIMEOUT},o=n??(a?l[a]:void 0)??t.errors.QUESTION_SAVE_FAILED;!a&&(e instanceof TypeError||/fetch|network|load failed/i.test((0,$.Z)(e)))&&(o=t.errors.QUESTION_SAVE_NETWORK_ERROR);let c=G(s?.details);if("QUESTION_SAVE_GRADE_FAILED"===i){let e=F(c?.reason,t);e&&(o+=`
|
|
7
7
|
${e}`)}return 400===a&&(o+=(function(e,t){if(!Array.isArray(e))return[];let r={questionText:t.editor.question,answerText:t.editor.answer,analysis:t.editor.analysis,wrongAnswerText:t.editor.wrongAnswerText,mistakeAnalysis:t.editor.mistakeAnalysis,knowledgePoints:t.editor.tags,subjectId:t.editor.selectNotebook,gradeSemester:t.editor.gradeSemester,paperLevel:t.editor.paperLevel};return e.slice(0,3).flatMap(e=>{let s=G(e),a=s?.path,i=Array.isArray(a)&&"string"==typeof a[0]?r[a[0]]:void 0;if(!i)return[];let n=s?.maximum,l=t.questionSave.invalidField;return s?.code==="too_big"&&"number"==typeof n&&Number.isSafeInteger(n)&&n>=0&&(l="array"===s.origin?t.questionSave.tooMany:t.questionSave.tooLong),[l.replace("{field}",i).replace("{maximum}",String(n))]})})(s?.details,t).map(e=>`
|
|
8
8
|
${e}`).join("")),"string"==typeof c?.databaseCode&&/^P\d{4}$/.test(c.databaseCode)&&(o+=`
|
|
9
|
-
${t.questionSave.databaseCode.replace("{code}",c.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(s,t);return i(r),(0,q.t)((0,$.d)(s))||u.c.error(r),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},469937,e=>{var t=e.i(843476),r=e.i(786563),s=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:c=!0,className:d}){let{t:u}=(0,s.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",h=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",d),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${h}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(r.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&c&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",d),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${h}`,title:h,children:i.map(e=>(0,t.jsx)(r.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):c?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",d),children:u.difficulty.unrated}):null}])},731335,532377,339501,e=>{var t=e.i(843476),r=e.i(399847),s=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),c=e.i(487486),d=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),h=e.i(306831);let g=["read","convert","crop","compress","upload"],x=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let r=Math.round(t);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var v=e.i(975157);let y={analyzing:50,saving:90},j={analyzing:l.f,saving:l.f,review:o.f,saved:s.f,failed:r.f};e.s(["f",0,function({task:e,now:r,onReview:s,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:b}=(0,f.M)(),w=j[e.status],k="analyzing"===e.status||"saving"===e.status,N=o.errors,S=e.error?"string"==typeof N[e.error]?N[e.error]:e.error:null,_=function(e){let t=[];for(let r of g){let s=e?.client?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}for(let r of x){let s=e?.server?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}return t}(e.timings),T=k&&r?r-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(w,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",k&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(c.f,{children:o.importTasks.unread})]}),k&&(0,t.jsx)(u.f,{value:y[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(y[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,h.r)(e.createdAt,"MM-dd HH:mm",b))]}),null!==T&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(T))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),_.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:_.map(({stage:e,ms:r})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(r)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(d.f,{size:"sm",onClick:s,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(d.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(d.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(d.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var b=e.i(618566),w=e.i(767077),k=e.i(294114),N=e.i(201276),S=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),r=(0,b.useRouter)(),s=e=>{e.unread&&(0,S.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),r.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),r.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async r=>{try{await (0,S.R)(r.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,w.f)(e,t))}e?.()},discard:async r=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,S.x)(r.id),k.c.success(t.importTasks.discarded),s=!0}catch(e){k.c.error((0,w.f)(e,t))}return e?.(),s}}}],532377);var _=e.i(271645);e.s(["f",0,function(e,t=1e3){let[r,s]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{if(!e)return;let r=setInterval(()=>s(Date.now()),t);return()=>clearInterval(r)},[e,t]),r}],339501)},141176,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(456420);let a={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"]};a.node;let i=(0,s.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),c=e.i(111110),d=e.i(975157);e.s(["f",0,function({value:e,onChange:s,className:a,...u}){let{t:m}=(0,c.b)(),[f,h]=(0,r.useState)("source"),g=(0,r.useId)(),x=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:x.map(({mode:e,label:r,icon:s})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":g,onClick:()=>h(e),className:(0,d.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:g,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>s(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>h("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:c}){let[d,u]=(0,r.useState)([]),{t:m}=(0,l.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(s.d,{value:e,onValueChange:o,children:[(0,t.jsx)(s.P,{className:c,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(s.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(s.r,{children:0===d.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):d.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}])},674166,e=>{var t=e.i(843476),r=e.i(967489),s=e.i(470279);e.s(["f",0,function({value:e,onChange:a,disabled:i}){let{groups:n,loading:l}=(0,s.f)(),o=n.filter(e=>e.isActive);return(0,t.jsxs)(r.d,{value:e,onValueChange:a,disabled:i||l,children:[(0,t.jsx)(r.P,{children:(0,t.jsx)(r.U,{placeholder:"选择卷别"})}),(0,t.jsx)(r.r,{children:o.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),r=e.i(111110),s=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:c}){let{t:d}=(0,r.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,s.d)(e),alt:d.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(263676),a=e.i(487486),i=e.i(793479),n=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:o,placeholder:c="Enter tags...",className:d="",enterHint:u,subject:m,gradeStage:f}){let[h,g]=(0,r.useState)(""),[x,p]=(0,r.useState)([]),[v,y]=(0,r.useState)(!1),[j,b]=(0,r.useState)(0),w=(0,r.useRef)(null),k=(0,r.useRef)(null),N=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});m&&r.append("subject",m),f&&r.append("stage",f);let s=((await n.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));p(s.slice(0,20)),y(s.length>0),b(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,f,e]);(0,r.useEffect)(()=>{h.trim()&&N(h)},[h,N]);let S=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),p([]),y(!1),b(0))},_=t=>{o(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||w.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${d}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>_(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(i.f,{ref:w,type:"text",value:h,onChange:e=>{g(e.target.value),e.target.value.trim()||(p([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),j>=0&&x[j]?S(x[j]):h.trim()&&S(h)):"ArrowDown"===t.key?(t.preventDefault(),b(e=>Math.min(e+1,x.length-1))):"ArrowUp"===t.key?(t.preventDefault(),b(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),b(0)):"Backspace"===t.key&&!h&&e.length>0&&_(e[e.length-1])},onFocus:()=>{x.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"})]}),v&&x.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:x.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===j?"bg-accent":""}`,onClick:()=>S(e),onMouseEnter:()=>b(r),children:e},e))}),h&&!v&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${h}"`:`Press Enter to create "${h}"`})]})}])},184110,e=>{let t=["left","center","right"],r="center";function s(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,r,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,s,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:r},"V",0,function(e){return s(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,r){let s=r.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=r.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return r.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${s} (${t})`}return s}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,r="zh"){return("en"===r?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,r){return(r||"").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 r=e.trim().toLowerCase();return r?t[r]??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}])}])})();
|
|
9
|
+
${t.questionSave.databaseCode.replace("{code}",c.databaseCode)}`),a&&(o+=` (HTTP ${a})`),o}(s,t);return i(r),(0,q.t)((0,$.d)(s))||u.c.error(r),!1}};return{saveError:a,setSaveError:i,dismissSaveError:()=>i(null),run:n}}],183444)},469937,e=>{var t=e.i(843476),r=e.i(786563),s=e.i(111110),a=e.i(975157);let i=[1,2,3,4,5];e.s(["f",0,function({value:e,onChange:n,disabled:l,size:o="sm",showUnrated:c=!0,className:d}){let{t:u}=(0,s.b)(),m=e??0,f="sm"===o?"h-3.5 w-3.5":"h-5 w-5",h=m?u.difficulty.starsLabel.replace("{n}",String(m)):u.difficulty.unrated;return n?(0,t.jsxs)("span",{className:(0,a.f)("inline-flex items-center gap-0.5",d),role:"group","aria-label":`${u.difficulty.label}${u.common.colon}${h}`,title:u.difficulty.clearHint,children:[i.map(e=>(0,t.jsx)("button",{type:"button",disabled:l,onClick:()=>n(e===m?null:e),"aria-label":u.difficulty.setStars.replace("{n}",String(e)),"aria-pressed":e<=m,className:"rounded p-0.5 hover:bg-muted disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsx)(r.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/40")})},e)),!m&&c&&(0,t.jsx)("span",{className:"ml-1 text-xs text-muted-foreground",children:u.difficulty.unrated})]}):m?(0,t.jsx)("span",{className:(0,a.f)("inline-flex items-center",d),role:"img","aria-label":`${u.difficulty.label}${u.common.colon}${h}`,title:h,children:i.map(e=>(0,t.jsx)(r.f,{className:(0,a.f)(f,e<=m?"fill-amber-400 text-amber-400":"text-muted-foreground/30"),"aria-hidden":!0},e))}):c?(0,t.jsx)("span",{className:(0,a.f)("text-xs text-muted-foreground",d),children:u.difficulty.unrated}):null}])},731335,532377,339501,e=>{var t=e.i(843476),r=e.i(399847),s=e.i(551757),a=e.i(456420);let i={name:"clock-3",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]};i.node;let n=(0,a.f)(i);var l=e.i(632781),o=e.i(615568),c=e.i(487486),d=e.i(519455),u=e.i(168148),m=e.i(111110),f=e.i(215519),h=e.i(306831);let g=["read","convert","crop","compress","upload"],x=["receive","analyze","save"];function p(e){if(!Number.isFinite(e)||e<0)return"-";if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(+(t<10))}s`;let r=Math.round(t);return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}var v=e.i(975157);let y={analyzing:50,saving:90},j={analyzing:l.f,saving:l.f,review:o.f,saved:s.f,failed:r.f};e.s(["f",0,function({task:e,now:r,onReview:s,onViewItem:a,onRetry:i,onDiscard:l}){let{t:o}=(0,m.b)(),{timeZone:b}=(0,f.M)(),w=j[e.status],k="analyzing"===e.status||"saving"===e.status,N=o.errors,S=e.error?"string"==typeof N[e.error]?N[e.error]:e.error:null,_=function(e){let t=[];for(let r of g){let s=e?.client?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}for(let r of x){let s=e?.server?.[r];"number"==typeof s&&t.push({stage:r,ms:s})}return t}(e.timings),T=k&&r?r-Date.parse(e.createdAt):null;return(0,t.jsxs)("div",{className:(0,v.f)("space-y-2 rounded-lg border p-3 text-sm",e.unread&&"border-primary/50 bg-primary/5"),"data-testid":"import-task-card","data-status":e.status,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsx)(w,{className:(0,v.f)("mt-0.5 h-4 w-4 shrink-0",k&&"animate-spin text-primary","saved"===e.status&&"text-green-600","failed"===e.status&&"text-destructive","review"===e.status&&"text-primary")}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:o.importTasks.status[e.status]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o.importTasks.mode[e.mode]}),e.unread&&(0,t.jsx)(c.f,{children:o.importTasks.unread})]}),k&&(0,t.jsx)(u.f,{value:y[e.status],"aria-label":o.importTasks.stageEstimate,"aria-valuetext":o.common.progress.estimated.replace("{percent}",String(y[e.status])),className:"h-1.5"}),e.excerpt&&(0,t.jsx)("p",{className:"break-words text-muted-foreground",children:e.excerpt}),"saved"===e.status&&!e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:o.importTasks.itemDeleted}),"saved"===e.status&&e.errorItemId&&(0,t.jsx)("p",{className:"text-xs text-green-700 dark:text-green-300",children:e.duplicate?o.importTasks.duplicateSaved:o.importTasks.savedTo.replace("{notebook}",e.notebookName||"-").replace("{id}",e.errorItemShortId||"-")}),S&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:S}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(n,{className:"h-3 w-3"}),o.importTasks.createdAt.replace("{time}",(0,h.r)(e.createdAt,"MM-dd HH:mm",b))]}),null!==T&&(0,t.jsx)("span",{children:o.importTasks.elapsed.replace("{time}",p(T))}),e.attempts>1&&(0,t.jsx)("span",{children:o.importTasks.attempts.replace("{count}",String(e.attempts))})]}),_.length>0&&(0,t.jsx)("ul",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground tabular-nums","aria-label":"timings",children:_.map(({stage:e,ms:r})=>(0,t.jsxs)("li",{children:[o.importTasks.timings[e]," ",p(r)]},e))})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:["review"===e.status&&s&&(0,t.jsx)(d.f,{size:"sm",onClick:s,children:o.importTasks.continueReview}),"saved"===e.status&&e.errorItemId&&a&&(0,t.jsx)(d.f,{size:"sm",variant:"outline",onClick:a,children:o.importTasks.viewItem}),"failed"===e.status&&i&&(0,t.jsx)(d.f,{size:"sm",onClick:i,children:o.importTasks.retry}),"saving"!==e.status&&"saved"!==e.status&&l&&(0,t.jsx)(d.f,{size:"sm",variant:"ghost",onClick:l,children:o.importTasks.discard})]})]})}],731335);var b=e.i(618566),w=e.i(767077),k=e.i(294114),N=e.i(201276),S=e.i(127175);e.s(["f",0,function(e){let{t}=(0,m.b)(),r=(0,b.useRouter)(),s=e=>{e.unread&&(0,S.N)(e.id).catch(e=>N.V.warn("[ImportTasks]","Mark read failed",{error:e}))};return{openReview:e=>{s(e),r.push(`/import-tasks/${e.id}`)},viewItem:e=>{e.errorItemId&&(s(e),r.push(`/error-items/${e.errorItemId}`))},markRead:s,retry:async r=>{try{await (0,S.R)(r.id),k.c.info(t.importTasks.retried)}catch(e){k.c.error((0,w.f)(e,t))}e?.()},discard:async r=>{if(!await (0,k.u)(t.importTasks.discardConfirm))return!1;let s=!1;try{await (0,S.x)(r.id),k.c.success(t.importTasks.discarded),s=!0}catch(e){k.c.error((0,w.f)(e,t))}return e?.(),s}}}],532377);var _=e.i(271645);e.s(["f",0,function(e,t=1e3){let[r,s]=(0,_.useState)(()=>Date.now());return(0,_.useEffect)(()=>{if(!e)return;let r=setInterval(()=>s(Date.now()),t);return()=>clearInterval(r)},[e,t]),r}],339501)},141176,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(456420);let a={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"]};a.node;let i=(0,s.f)(a);var n=e.i(772382),l=e.i(511445),o=e.i(624687),c=e.i(111110),d=e.i(975157);e.s(["f",0,function({value:e,onChange:s,className:a,...u}){let{t:m}=(0,c.b)(),[f,h]=(0,r.useState)("source"),g=(0,r.useId)(),x=[{mode:"source",label:m.markdownEditor.source,icon:i},{mode:"preview",label:m.markdownEditor.preview,icon:n.f}];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{role:"tablist","aria-label":m.markdownEditor.modeLabel,className:"flex justify-end",children:(0,t.jsx)("div",{className:"inline-flex rounded-md border bg-muted/40 p-0.5",children:x.map(({mode:e,label:r,icon:s})=>(0,t.jsxs)("button",{type:"button",role:"tab","aria-selected":f===e,"aria-controls":g,onClick:()=>h(e),className:(0,d.f)("flex items-center gap-1 rounded px-2.5 py-1 text-xs transition-colors",f===e?"bg-background font-medium shadow-sm":"text-muted-foreground hover:text-foreground"),children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),r]},e))})}),(0,t.jsx)("div",{id:g,role:"tabpanel",children:"source"===f?(0,t.jsx)(o.f,{value:e,onChange:e=>s(e.target.value),className:a,...u}):(0,t.jsx)("div",{className:"min-h-24 cursor-text rounded-md border bg-muted/20 px-3 py-2",onDoubleClick:()=>h("source"),title:m.markdownEditor.doubleClickToEdit,children:e.trim()?(0,t.jsx)(l.f,{content:e}):(0,t.jsx)("p",{className:"text-sm italic text-muted-foreground",children:m.markdownEditor.empty})})})]})}],141176)},438465,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(967489),a=e.i(856423),i=e.i(41931),n=e.i(201276),l=e.i(111110);e.s(["f",0,function({value:e,onChange:o,className:c}){let[d,u]=(0,r.useState)([]),{t:m}=(0,l.b)();return(0,r.useEffect)(()=>{(async()=>{try{let e=await i.k.get("/api/notebooks");u(e)}catch(e){n.V.error("[NotebookSelector]","Failed to fetch notebooks",{error:e})}})()},[]),(0,t.jsxs)(s.d,{value:e,onValueChange:o,children:[(0,t.jsx)(s.P,{className:c,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.f,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(s.U,{placeholder:m.notebooks?.selector?.placeholder||"Select Notebook"})]})}),(0,t.jsx)(s.r,{children:0===d.length?(0,t.jsx)("div",{className:"p-2 text-sm text-muted-foreground text-center",children:m.notebooks?.selector?.empty||"No notebooks available"}):d.map(e=>(0,t.jsx)(s.T,{value:e.id,children:e.name},e.id))})]})}])},674166,e=>{var t=e.i(843476),r=e.i(967489),s=e.i(470279);e.s(["f",0,function({value:e,onChange:a,disabled:i}){let{groups:n,loading:l}=(0,s.f)(),o=n.filter(e=>e.isActive);return(0,t.jsxs)(r.d,{value:e,onValueChange:a,disabled:i||l,children:[(0,t.jsx)(r.P,{children:(0,t.jsx)(r.U,{placeholder:"选择卷别"})}),(0,t.jsx)(r.r,{children:o.map(e=>(0,t.jsx)(r.T,{value:e.id,children:e.name},e.id))})]})}])},149704,e=>{var t=e.i(843476),r=e.i(111110),s=e.i(398019),a=e.i(184110),i=e.i(975157);let n={left:"mr-auto",center:"mx-auto",right:"ml-auto"};e.s(["f",0,function({svg:e,scale:l,align:o,className:c}){let{t:d}=(0,r.b)();if(!e)return null;let u=(0,a.V)(l),m=(0,a.o)(o);return(0,t.jsx)("figure",{className:(0,i.f)("question-figure my-3",c),children:(0,t.jsx)("img",{src:(0,s.d)(e),alt:d.figure.alt,className:(0,i.f)(n[m],"block h-auto max-w-full rounded border bg-white p-2"),style:{..."left"===m?{marginLeft:0,marginRight:"auto"}:"right"===m?{marginLeft:"auto",marginRight:0}:{},maxHeight:360,zoom:u/100,maxWidth:`${Math.min(u,100)}%`}})})}])},574041,e=>{var t=e.i(843476),r=e.i(271645),s=e.i(263676),a=e.i(487486),i=e.i(793479),n=e.i(41931),l=e.i(201276);e.s(["f",0,function({value:e=[],onChange:o,placeholder:c="Enter tags...",className:d="",enterHint:u,subject:m,gradeStage:f}){let[h,g]=(0,r.useState)(""),[x,p]=(0,r.useState)([]),[v,y]=(0,r.useState)(!1),[j,b]=(0,r.useState)(0),w=(0,r.useRef)(null),k=(0,r.useRef)(null),N=(0,r.useCallback)(async t=>{try{let r=new URLSearchParams({q:t});m&&r.append("subject",m),f&&r.append("stage",f);let s=((await n.k.get(`/api/tags/suggestions?${r.toString()}`)).suggestions||[]).filter(t=>!e.includes(t));p(s.slice(0,20)),y(s.length>0),b(0)}catch(e){l.V.error("[TagInput]","Failed to fetch suggestions",{error:e})}},[m,f,e]);(0,r.useEffect)(()=>{h.trim()&&N(h)},[h,N]);let S=t=>{t.trim()&&!e.includes(t.trim())&&(o([...e,t.trim()]),g(""),p([]),y(!1),b(0))},_=t=>{o(e.filter(e=>e!==t))};return(0,r.useEffect)(()=>{let e=e=>{!k.current||k.current.contains(e.target)||w.current?.contains(e.target)||y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:`relative ${d}`,children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 p-2 border rounded-lg bg-background min-h-[42px]",children:[e.map(e=>(0,t.jsxs)(a.f,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>_(e),className:"hover:text-destructive ml-1",children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]},e)),(0,t.jsx)(i.f,{ref:w,type:"text",value:h,onChange:e=>{g(e.target.value),e.target.value.trim()||(p([]),y(!1))},onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),j>=0&&x[j]?S(x[j]):h.trim()&&S(h)):"ArrowDown"===t.key?(t.preventDefault(),b(e=>Math.min(e+1,x.length-1))):"ArrowUp"===t.key?(t.preventDefault(),b(e=>Math.max(e-1,0))):"Escape"===t.key?(y(!1),b(0)):"Backspace"===t.key&&!h&&e.length>0&&_(e[e.length-1])},onFocus:()=>{x.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"})]}),v&&x.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:x.map((e,r)=>(0,t.jsx)("div",{className:`px-3 py-2 cursor-pointer hover:bg-accent ${r===j?"bg-accent":""}`,onClick:()=>S(e),onMouseEnter:()=>b(r),children:e},e))}),h&&!v&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:u?`${u} "${h}"`:`Press Enter to create "${h}"`})]})}])},184110,e=>{let t=["left","center","right"],r="center";function s(e){return"number"==typeof e&&Number.isInteger(e)&&e>=10&&e<=200}e.s(["E",0,r,"n",0,100,"j",0,t,"a",0,200,"_",0,10,"x",0,s,"o",0,function(e){return"string"==typeof e&&t.includes(e)?e:r},"V",0,function(e){return s(e)?e:100}])},398019,e=>{e.s(["K",0,1e5,"d",0,function(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}])},767077,e=>{var t=e.i(303163);e.s(["f",0,function(e,r){let s=r.common?.messages?.analysisFailed||"Analysis failed, please try again",a=(0,t.d)(e);if(a){let e=r.errors??{};if(!(a in e))return a;let t=e[a];return"string"==typeof t?t:s}let i=(0,t.Z)(e);if(i.includes("fetch")||i.includes("network"))return r.errors?.AI_CONNECTION_FAILED||"网络连接失败";if("object"==typeof e&&null!==e&&"data"in e&&"string"==typeof e.data){let t="status"in e&&"number"==typeof e.status?e.status:"Error";return`${s} (${t})`}return s}])},991722,e=>{function t(e){return"not_attempted"===e||"wrong_attempt"===e||"unknown"===e?e:"unknown"}e.s(["i",0,function(e,r="zh"){return("en"===r?{not_attempted:"Not attempted",wrong_attempt:"Wrong attempt",unknown:"Unknown"}:{not_attempted:"不会做",wrong_attempt:"做错了",unknown:"未判断"})[t(e)]},"h",0,t,"x",0,function(e,r){return(r||"").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 r=e.trim().toLowerCase();return r?t[r]??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("science")||t.includes("科学")?"science":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}])}])})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,181571,e=>{e.v(e=>Promise.resolve().then(()=>e(974881)))},810068,e=>{e.v(o=>Promise.all(["static/chunks/0xbohpfp7x9jn.js"].map(o=>e.l(o))).then(()=>o(97292)))}]);
|