wrong-notebook 2026.10.21 → 2026.10.22-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/dashboard/route.js +1 -1
- package/.next/server/app/api/admin/dashboard/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 +3 -3
- package/.next/server/app/api/ai/test/route.js.nft.json +1 -1
- package/.next/server/app/api/analytics/route.js +1 -1
- 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 +4 -3
- 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 +5 -4
- 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 +6 -6
- package/.next/server/app/api/error-items/[id]/retag/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/list/route.js +1 -1
- package/.next/server/app/api/error-items/list/route.js.nft.json +1 -1
- package/.next/server/app/api/error-items/route.js +6 -6
- 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 +5 -5
- 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 +6 -6
- package/.next/server/app/api/exams/[id]/results/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/retry/route.js +5 -5
- package/.next/server/app/api/exams/[id]/retry/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/[id]/route.js +3 -3
- package/.next/server/app/api/exams/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/exams/route.js +4 -4
- package/.next/server/app/api/exams/route.js.nft.json +1 -1
- package/.next/server/app/api/export/route.js +1 -1
- package/.next/server/app/api/export/route.js.nft.json +1 -1
- package/.next/server/app/api/geogebra-analyze/route.js +4 -4
- package/.next/server/app/api/geogebra-analyze/route.js.nft.json +1 -1
- package/.next/server/app/api/import/route.js +6 -6
- package/.next/server/app/api/import/route.js.nft.json +1 -1
- package/.next/server/app/api/notebooks/[id]/retag/route.js +3 -3
- package/.next/server/app/api/notebooks/[id]/retag/route.js.nft.json +1 -1
- package/.next/server/app/api/openclaw/batch-upload/route.js +5 -5
- package/.next/server/app/api/openclaw/batch-upload/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/generate/route.js +4 -4
- package/.next/server/app/api/practice/generate/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/[id]/route.js +4 -4
- package/.next/server/app/api/practice/record/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/practice/record/route.js +4 -3
- package/.next/server/app/api/practice/record/route.js.nft.json +1 -1
- package/.next/server/app/api/reanswer/route.js +4 -4
- package/.next/server/app/api/reanswer/route.js.nft.json +1 -1
- package/.next/server/app/api/register/route.js +1 -1
- package/.next/server/app/api/register/route.js.nft.json +1 -1
- package/.next/server/app/api/register/status/route.js +1 -1
- package/.next/server/app/api/register/status/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/route.js +5 -4
- package/.next/server/app/api/settings/route.js.nft.json +1 -1
- package/.next/server/app/api/stats/practice/route.js +1 -1
- package/.next/server/app/api/stats/practice/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/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/latex-test/page.js.nft.json +1 -1
- package/.next/server/app/latex-test/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/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]__0-8hf14._.js → [root-of-the-server]__02j1w81._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__08gak8r._.js → [root-of-the-server]__03nfvnm._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0gpohuv._.js → [root-of-the-server]__06_nln5._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__07jl92a._.js +1 -1
- package/.next/server/chunks/{[root-of-the-server]__08zi-xg._.js → [root-of-the-server]__0be5c5r._.js} +1 -1
- package/.next/server/chunks/{[root-of-the-server]__0994h9l._.js → [root-of-the-server]__0bqawi0._.js} +1 -1
- package/.next/server/chunks/[root-of-the-server]__0bsw5c9._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0cmxmwt._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1utxo11._.js → [root-of-the-server]__0d5dpu4._.js} +2 -2
- package/.next/server/chunks/{[root-of-the-server]__05no8nw._.js → [root-of-the-server]__0d9ijed._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0fnyu4s._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0j5231l._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0m_f8ct._.js → [root-of-the-server]__0k-nf6a._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0k-p1pj._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0lrdm1u._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0lro5a7._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0mfjf2y._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0yds0ae._.js → [root-of-the-server]__0mqorxb._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0no6umu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0o9gtvd._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__0ynfeq-._.js → [root-of-the-server]__0obb4y-._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__0p3u6_q._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0rmrkd_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0tdibjz._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vhjihq._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0vz88er._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0wf9znr._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0zv7jom._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__11_-ncy._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__11_1z7m._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__11n87go._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__11p4ahb._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__122xu-0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__131taws._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__14dnbrn._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__14jqm9_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__152lbaw._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__04mu6-m._.js → [root-of-the-server]__16begv4._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__17duis5._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__17q3k-v._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__184u6de._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__18atlj8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__18c7l6u._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__18zrkky._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1aaux7e._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1cceu4b._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1h09r50._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1j6mx-v._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1jdi-1f._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ju8z29._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1kpo44g._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1lct0vi._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1loecue._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1mkpya8._.js +3 -0
- package/.next/server/chunks/{[root-of-the-server]__1a4i9sz._.js → [root-of-the-server]__1nwf3ua._.js} +2 -2
- package/.next/server/chunks/[root-of-the-server]__1p8hw44._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1rsn804._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1u-1vx4._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1v6nwhq._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1vw740y._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__20465pr._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__207mxv8._.js +3 -0
- package/.next/server/chunks/_0-eguqv._.js +3 -0
- package/.next/server/chunks/_0389uce._.js +3 -0
- package/.next/server/chunks/_0_o8yhv._.js +3 -0
- package/.next/server/chunks/_0gwg6ba._.js +3 -0
- package/.next/server/chunks/_0rdo0a4._.js +3 -0
- package/.next/server/chunks/_13ffmxv._.js +1 -1
- package/.next/server/chunks/_167vv93._.js +3 -0
- package/.next/server/chunks/_16jdov0._.js +1 -1
- package/.next/server/chunks/{_1ve0z0w._.js → _1e1h1f1._.js} +1 -1
- package/.next/server/chunks/_1flar98._.js +3 -0
- package/.next/server/chunks/_1pvqo-q._.js +3 -0
- package/.next/server/chunks/src_lib_ai_prompts_ts_0z36zms._.js +15 -8
- package/.next/server/chunks/ssr/src_1gayunq._.js +1 -1
- package/.next/server/chunks/ssr/src_1o363ao._.js +1 -1
- package/.next/server/chunks/ssr/src_app_error-items_[id]_page_tsx_04xwwdm._.js +1 -1
- package/.next/server/chunks/ssr/src_app_notebooks_[id]_page_tsx_08njm-5._.js +1 -1
- package/.next/server/chunks/ssr/src_components_providers_tsx_09kw-mv._.js +10 -10
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/130ch9mnvb6mp.css +3 -0
- package/.next/static/chunks/17wdtw8hml2n6.js +191 -0
- package/.next/static/chunks/2a0kgntckcbvf.js +1 -0
- package/.next/static/chunks/{05q4yafxnvtzs.js → 2wnnnmbh85mq_.js} +1 -1
- package/.next/static/chunks/3hz1l3qoxv84t.js +1 -0
- package/launcher.js +16 -0
- package/package.json +1 -1
- package/prisma/seed.db +0 -0
- package/.next/server/chunks/[root-of-the-server]__00m7v48._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__01m28mx._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__07nvz1d._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0b3nww4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0bs5unr._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0dfbwm3._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0els3c1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0grkic-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0hj9oe2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0j-gv3-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0je3zje._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0na-z2m._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ns_tws._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0p3hkz7._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0pli74s._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0qaih8c._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ra48rd._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0sh6-yu._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ssagl1._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ws6c0v._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0ydrrdj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0z-sjqh._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__0zp1e41._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__108ydjw._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__10yghm_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11-sf2-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__11wobg2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__13_c7nc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__14pcopd._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__150ei9u._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__15g7yjy._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__19nm3y_._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1e3crdc._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1g-xe1f._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1g3usdn._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1hmv25w._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1hq73__._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1ouzjax._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1pcgq22._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1q5nt5y._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1qt6_3b._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1v1dgs2._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1v9b8go._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1vzxn91._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1wgn76g._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1wkh9sj._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1xcmja4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1y6fx9-._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1zos_p4._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__1zp0oig._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__203q6el._.js +0 -3
- package/.next/server/chunks/[root-of-the-server]__20bun16._.js +0 -3
- package/.next/server/chunks/_0ae3z2e._.js +0 -3
- package/.next/server/chunks/_0o1p57f._.js +0 -3
- package/.next/server/chunks/_0t6g4yt._.js +0 -3
- package/.next/server/chunks/_19fidvw._.js +0 -3
- package/.next/server/chunks/_1oqpwh8._.js +0 -3
- package/.next/server/chunks/_1q5w9fc._.js +0 -3
- package/.next/static/chunks/1ad3ir88_e_v6.css +0 -3
- package/.next/static/chunks/29erttsjondpe.js +0 -1
- package/.next/static/chunks/31rxdwy0u_t29.js +0 -1
- package/.next/static/chunks/37g3bsrs22xg7.js +0 -191
- /package/.next/static/{OpwRvHtdhPgxve2rKkWkK → PipzREVX2s4mdvp2gs1DS}/_buildManifest.js +0 -0
- /package/.next/static/{OpwRvHtdhPgxve2rKkWkK → PipzREVX2s4mdvp2gs1DS}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{OpwRvHtdhPgxve2rKkWkK → PipzREVX2s4mdvp2gs1DS}/_ssgManifest.js +0 -0
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,1661,e=>{"use strict";var s=e.i(18050),t=e.i(11110),a=e.i(17255),r=e.i(15519),i=e.i(57688),n=e.i(22016),l=e.i(18566),o=e.i(17923),c=e.i(10980),d=e.i(78583),m=e.i(75254);let u=(0,m.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]),p=(0,m.default)("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),x=(0,m.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),h=(0,m.default)("tags",[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]]);var g=e.i(71645),f=e.i(19455),j=e.i(76639),v=e.i(93479),y=e.i(10204),b=e.i(67489),N=e.i(77572);let w=(0,m.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var k=e.i(27612),S=e.i(31278);let C=(0,m.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var T=e.i(86536),I=e.i(77705),L=e.i(63639),E=e.i(84614);let z=(0,m.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var A=e.i(16715),D=e.i(7233);let R=(0,m.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),M=(0,m.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var _=e.i(73884),P=e.i(40160);let B=(0,m.default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);var F=e.i(30691),K=e.i(87486),U=e.i(81140),O=e.i(20783),$=e.i(30030),q=e.i(69340),V=e.i(99682),H=e.i(35804);e.i(74080);var W=Symbol("radix.slottable");function X(e){return g.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===W}var Y=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var a,r;let i,n,l,o=(r=a=`Primitive.${t}`,(i=g.forwardRef((e,s)=>{let{children:t,...a}=e;if(g.isValidElement(t)){var r;let e,i,n=(r=t,(i=(e=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?r.ref:(i=(e=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?r.props.ref:r.props.ref||r.ref),l=function(e,s){let t={...s};for(let a in s){let r=e[a],i=s[a];/^on[A-Z]/.test(a)?r&&i?t[a]=(...e)=>{let s=i(...e);return r(...e),s}:r&&(t[a]=r):"style"===a?t[a]={...r,...i}:"className"===a&&(t[a]=[r,i].filter(Boolean).join(" "))}return{...e,...t}}(a,t.props);return t.type!==g.Fragment&&(l.ref=s?(0,O.composeRefs)(s,n):n),g.cloneElement(t,l)}return g.Children.count(t)>1?g.Children.only(null):null})).displayName=`${r}.SlotClone`,n=i,(l=g.forwardRef((e,t)=>{let{children:a,...r}=e,i=g.Children.toArray(a),l=i.find(X);if(l){let e=l.props.children,a=i.map(s=>s!==l?s:g.Children.count(e)>1?g.Children.only(null):g.isValidElement(e)?e.props.children:null);return(0,s.jsx)(n,{...r,ref:t,children:g.isValidElement(e)?g.cloneElement(e,void 0,a):null})}return(0,s.jsx)(n,{...r,ref:t,children:a})})).displayName=`${a}.Slot`,l),c=g.forwardRef((e,a)=>{let{asChild:r,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,s.jsx)(r?o:t,{...i,ref:a})});return c.displayName=`Primitive.${t}`,{...e,[t]:c}},{}),Z="Switch",[G,J]=(0,$.createContextScope)(Z),[Q,ee]=G(Z),es=g.forwardRef((e,t)=>{let{__scopeSwitch:a,name:r,checked:i,defaultChecked:n,required:l,disabled:o,value:c="on",onCheckedChange:d,form:m,...u}=e,[p,x]=g.useState(null),h=(0,O.useComposedRefs)(t,e=>x(e)),f=g.useRef(!1),j=!p||m||!!p.closest("form"),[v,y]=(0,q.useControllableState)({prop:i,defaultProp:n??!1,onChange:d,caller:Z});return(0,s.jsxs)(Q,{scope:a,checked:v,disabled:o,children:[(0,s.jsx)(Y.button,{type:"button",role:"switch","aria-checked":v,"aria-required":l,"data-state":ei(v),"data-disabled":o?"":void 0,disabled:o,value:c,...u,ref:h,onClick:(0,U.composeEventHandlers)(e.onClick,e=>{y(e=>!e),j&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})}),j&&(0,s.jsx)(er,{control:p,bubbles:!f.current,name:r,value:c,checked:v,required:l,disabled:o,form:m,style:{transform:"translateX(-100%)"}})]})});es.displayName=Z;var et="SwitchThumb",ea=g.forwardRef((e,t)=>{let{__scopeSwitch:a,...r}=e,i=ee(et,a);return(0,s.jsx)(Y.span,{"data-state":ei(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});ea.displayName=et;var er=g.forwardRef(({__scopeSwitch:e,control:t,checked:a,bubbles:r=!0,...i},n)=>{let l=g.useRef(null),o=(0,O.useComposedRefs)(l,n),c=(0,V.usePrevious)(a),d=(0,H.useSize)(t);return g.useEffect(()=>{let e=l.current;if(!e)return;let s=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(c!==a&&s){let t=new Event("click",{bubbles:r});s.call(e,a),e.dispatchEvent(t)}},[c,a,r]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:o,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function ei(e){return e?"checked":"unchecked"}er.displayName="SwitchBubbleInput";var en=e.i(75157);let el=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)(es,{className:(0,en.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,s.jsx)(ea,{className:(0,en.cn)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));el.displayName=es.displayName;let eo=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:a,className:(0,en.cn)("w-full caption-bottom text-sm",e),...t})}));eo.displayName="Table";let ec=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("thead",{ref:a,className:(0,en.cn)("[&_tr]:border-b",e),...t}));ec.displayName="TableHeader";let ed=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("tbody",{ref:a,className:(0,en.cn)("[&_tr:last-child]:border-0",e),...t}));ed.displayName="TableBody",g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("tfoot",{ref:a,className:(0,en.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t})).displayName="TableFooter";let em=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("tr",{ref:a,className:(0,en.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));em.displayName="TableRow";let eu=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("th",{ref:a,className:(0,en.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));eu.displayName="TableHead";let ep=g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("td",{ref:a,className:(0,en.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ep.displayName="TableCell",g.forwardRef(({className:e,...t},a)=>(0,s.jsx)("caption",{ref:a,className:(0,en.cn)("mt-4 text-sm text-muted-foreground",e),...t})).displayName="TableCaption";let ex=(0,m.default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var eh=e.i(69638),eg=e.i(41931),ef=e.i(94114);function ej(){let{timeZone:e}=(0,r.useTimeZone)(),{data:i}=(0,a.useSession)(),{t:n,language:l}=(0,t.useLanguage)(),[o,c]=(0,g.useState)([]),[d,m]=(0,g.useState)(!0),[u,p]=(0,g.useState)(!0),[x,h]=(0,g.useState)(!1);(0,g.useEffect)(()=>{b(),j()},[]);let j=async()=>{try{let e=await eg.apiClient.get("/api/settings");p(!1!==e.allowRegistration)}catch(e){console.error("Failed to fetch config",e)}},v=async e=>{h(!0);try{await eg.apiClient.post("/api/settings",{allowRegistration:e}),p(e)}catch(e){console.error("Failed to update registration setting",e),ef.toast.error(n.common.error)}finally{h(!1)}},b=async()=>{m(!0);try{let e=await eg.apiClient.get("/api/admin/users");c(e)}catch(e){console.error("Failed to fetch users",e)}finally{m(!1)}},N=async e=>{let s=e.isActive?n.admin.confirmDisable:n.admin.confirmEnable;if(await (0,ef.confirmDialog)(s))try{await eg.apiClient.patch(`/api/admin/users/${e.id}`,{isActive:!e.isActive}),b()}catch(e){console.error("Failed to update user status",e),ef.toast.error(n.common.error)}},w=async e=>{if(await (0,ef.confirmDialog)(n.admin.confirmDelete,{destructive:!0}))try{await eg.apiClient.delete(`/api/admin/users/${e.id}`),b()}catch(s){console.error("Failed to delete user",s);let e=s.data?.message||n.common.error;ef.toast.error(e)}};return d?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(S.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(y.Label,{className:"text-base",children:n.admin?.allowRegistration||"Allow New Registrations"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:n.admin?.allowRegistrationDesc||"When disabled, new users cannot register"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[x&&(0,s.jsx)(S.Loader2,{className:"h-4 w-4 animate-spin"}),(0,s.jsx)(el,{checked:u,onCheckedChange:v,disabled:x})]})]}),(0,s.jsx)("div",{className:"sm:hidden space-y-3",children:o.map(t=>(0,s.jsxs)("div",{className:"border rounded-lg p-4 bg-card space-y-3",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium",children:t.name||"N/A"}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:t.email})]}),(0,s.jsx)(K.Badge,{variant:"admin"===t.role?"default":"secondary",children:"admin"===t.role?n.admin.admin:n.admin.user})]}),(0,s.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,s.jsxs)("div",{className:"text-muted-foreground",children:[n.admin.errors,": ",t._count.errorItems," | ",n.admin.practiceCount,": ",t._count.practiceRecords]}),(0,s.jsx)(K.Badge,{variant:t.isActive?"default":"destructive",className:"text-xs",children:t.isActive?n.admin.active:n.admin.disabled})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center pt-2 border-t",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,F.formatDateTime)(t.createdAt,"yyyy-MM-dd",e)}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(f.Button,{variant:"ghost",size:"sm",onClick:()=>N(t),disabled:t.id===(i?.user).id,children:t.isActive?(0,s.jsx)(ex,{className:"h-4 w-4 text-orange-500"}):(0,s.jsx)(eh.CheckCircle,{className:"h-4 w-4 text-green-500"})}),(0,s.jsx)(f.Button,{variant:"ghost",size:"sm",onClick:()=>w(t),disabled:t.id===(i?.user).id,children:(0,s.jsx)(k.Trash2,{className:"h-4 w-4 text-destructive"})})]})]})]},t.id))}),(0,s.jsx)("div",{className:"hidden sm:block border rounded-lg overflow-hidden",children:(0,s.jsxs)(eo,{children:[(0,s.jsx)(ec,{children:(0,s.jsxs)(em,{children:[(0,s.jsx)(eu,{children:n.admin.nameEmail}),(0,s.jsx)(eu,{children:n.admin.role}),(0,s.jsx)(eu,{children:n.admin.stats}),(0,s.jsx)(eu,{children:n.admin.createdAt}),(0,s.jsx)(eu,{children:n.admin.status}),(0,s.jsx)(eu,{className:"text-right",children:n.admin.actions})]})}),(0,s.jsx)(ed,{children:o.map(t=>(0,s.jsxs)(em,{children:[(0,s.jsxs)(ep,{children:[(0,s.jsx)("div",{className:"font-medium",children:t.name||"N/A"}),(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:t.email})]}),(0,s.jsx)(ep,{children:(0,s.jsx)(K.Badge,{variant:"admin"===t.role?"default":"secondary",children:"admin"===t.role?n.admin.admin:n.admin.user})}),(0,s.jsxs)(ep,{children:[(0,s.jsxs)("div",{className:"text-sm",children:[n.admin.errors,": ",t._count.errorItems]}),(0,s.jsxs)("div",{className:"text-sm",children:[n.admin.practiceCount,": ",t._count.practiceRecords]})]}),(0,s.jsx)(ep,{children:(0,F.formatDateTime)(t.createdAt,"yyyy-MM-dd",e)}),(0,s.jsx)(ep,{children:(0,s.jsx)(K.Badge,{variant:t.isActive?"default":"destructive",children:t.isActive?n.admin.active:n.admin.disabled})}),(0,s.jsxs)(ep,{className:"text-right space-x-2",children:[(0,s.jsx)(f.Button,{variant:"ghost",size:"sm",onClick:()=>N(t),disabled:t.id===(i?.user).id,title:t.isActive?n.admin.disable:n.admin.enable,children:t.isActive?(0,s.jsx)(ex,{className:"h-4 w-4 text-orange-500"}):(0,s.jsx)(eh.CheckCircle,{className:"h-4 w-4 text-green-500"})}),(0,s.jsx)(f.Button,{variant:"ghost",size:"sm",onClick:()=>w(t),disabled:t.id===(i?.user).id,title:n.admin.delete,children:(0,s.jsx)(k.Trash2,{className:"h-4 w-4 text-destructive"})})]})]},t.id))})]})})]})}var ev=e.i(1276);function ey({provider:e,apiKey:a,baseUrl:r,currentModel:i,onModelChange:n}){let{t:l}=(0,t.useLanguage)(),[o,c]=(0,g.useState)([]),[d,m]=(0,g.useState)(!1),[u,p]=(0,g.useState)(null),[x,h]=(0,g.useState)(i||""),[j,N]=(0,g.useState)(!1);(0,g.useEffect)(()=>{h(i||"")},[i]);let w=async()=>{if(!a)return void p(l.modelSelector?.enterApiKeyFirst||"Please enter API Key first");m(!0),p(null);try{let s=await eg.apiClient.post("/api/ai/models",{provider:e,apiKey:a,...r&&{baseUrl:r}});if("error"in s&&"string"==typeof s.error){p(s.error),N(!0),c([]);return}c(s.models),0===s.models.length&&(p(l.modelSelector?.noVisionModel||"No vision model found, please enter manually"),N(!0))}catch(e){console.error("Failed to fetch models:",e),p((e?.message||l.modelSelector?.fetchFailed||"Failed to fetch models")+(l.modelSelector?.enterManually||", please enter manually")),N(!0)}finally{m(!1)}};return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(y.Label,{className:"flex-1",children:l.modelSelector?.modelName||"Model Name"}),(0,s.jsx)(f.Button,{type:"button",variant:"outline",size:"sm",onClick:w,disabled:d||!a,children:d?(0,s.jsx)(S.Loader2,{className:"h-3 w-3 animate-spin"}):(0,s.jsx)(A.RefreshCw,{className:"h-3 w-3"})})]}),u&&(0,s.jsx)("p",{className:"text-xs text-yellow-600",children:u}),j||0===o.length?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(v.Input,{value:x,onChange:e=>{var s;h(s=e.target.value),n(s)},placeholder:"openai"===e?"gpt-4o":"gemini-1.5-flash"}),o.length>0&&(0,s.jsx)(f.Button,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>N(!1),children:l.modelSelector?.selectFromList||"Select from List"})]}):(0,s.jsx)("div",{className:"space-y-2",children:(0,s.jsxs)(b.Select,{value:i,onValueChange:e=>{"_custom"===e?N(!0):(N(!1),h(e),n(e))},children:[(0,s.jsx)(b.SelectTrigger,{children:(0,s.jsx)(b.SelectValue,{placeholder:l.modelSelector?.selectModel||"Select Model"})}),(0,s.jsxs)(b.SelectContent,{children:[o.map(e=>(0,s.jsxs)(b.SelectItem,{value:e.id,children:[e.name,e.owned_by&&` (${e.owned_by})`]},e.id)),(0,s.jsx)(b.SelectItem,{value:"_custom",children:l.modelSelector?.customInput||"Custom Input..."})]})]})})]})}var eb=e.i(24687);let eN=`请参考《高思学校竞赛数学导引》(每讲分兴趣篇、拓展篇、超越篇,题目左侧标 1~5 颗星)的星级标准,结合题目所在年级评定难度:
|
|
2
|
-
- 1 星:课本基础题,直接套用概念、公式或简单计算即可(相当于兴趣篇前几题)。
|
|
3
|
-
- 2 星:校内拔高题,需要两三步推理或简单综合(相当于兴趣篇后几题)。
|
|
4
|
-
- 3 星:常规奥数题,小升初、杯赛常见难度,需要掌握该专题的典型方法(相当于拓展篇)。
|
|
5
|
-
- 4 星:较难奥数题,需要构造、分类讨论、转化或多种方法综合(相当于拓展篇末题、超越篇前几题)。
|
|
6
|
-
- 5 星:竞赛压轴题,集训队水平,思路巧妙、步骤长(相当于超越篇难题)。
|
|
7
|
-
非数学学科按同样的 1~5 级划分:1 星为基础识记,3 星为综合应用,5 星为竞赛或压轴难度。`,ew=`- 输出一个完整的 <svg> 元素,包含 xmlns="http://www.w3.org/2000/svg" 和 viewBox(建议宽 400~600),不要用 Markdown 代码块包裹。
|
|
8
|
-
- 白色背景、黑色线条(stroke="#000",线宽 1.5~2),需要区分的区域可用浅灰填充;不要使用彩色装饰。
|
|
9
|
-
- 按原图比例和相对位置绘制,保留所有标注:顶点字母、数字、长度、角度、单位、箭头和虚线等,文字用 <text>(font-size 14~18)。
|
|
10
|
-
- 只使用基本图形元素:line、polyline、polygon、rect、circle、ellipse、path、text、g、defs、marker。
|
|
11
|
-
- 严禁使用 <image>、<script>、<foreignObject>、外部链接、外部字体或事件属性。`,ek=String.raw`- 行内公式用 $...$,独立公式用 $$...$$;不要用 \(...\) 或 \[...\],每个 $ 必须成对出现。
|
|
12
|
-
- 所有 LaTeX 命令(如 \frac、\sqrt、\times、\angle)都必须写在 $...$ 内,公式外不能出现反斜杠命令。
|
|
13
|
-
- 只使用 KaTeX 支持的命令和环境:方程组用 \begin{cases}...\end{cases},多行推导用 \begin{aligned}...\end{aligned}(放在 $$...$$ 中),不要用 align、eqnarray、\newcommand、\usepackage、\label、\tag 等。
|
|
14
|
-
- 大括号 {} 必须成对,\left 与 \right 必须成对,\begin{...} 与 \end{...} 必须对应。
|
|
15
|
-
- 公式中的中文写在 \text{...} 里,或放到公式外;百分号写成 \%,美元符号写成 \$。
|
|
16
|
-
- 反斜杠只写一个(\frac),不要写成 \\frac;换行符 \\ 只能用在 cases、aligned 等环境里。`,eS=`【角色与核心任务 (ROLE AND CORE TASK)】
|
|
17
|
-
你是一位世界顶尖的、经验丰富的、专业的跨学科考试分析专家(Interdisciplinary Exam Analysis Expert)。你的核心任务是极致准确地分析用户提供的考试题目图片,全面理解所有文本、图表和隐含约束,并提供一个完整、高度结构化且专业的解决方案。
|
|
18
|
-
|
|
19
|
-
{{language_instruction}}
|
|
20
|
-
|
|
21
|
-
【核心输出要求 (OUTPUT REQUIREMENTS)】
|
|
22
|
-
你的响应输出**必须严格遵循以下自定义标签格式**。**严禁**使用 JSON 或 Markdown 代码块。**严禁**对 LaTeX 公式中的反斜杠进行二次转义(如 "\\frac" 是错误的,必须是 "\frac")。
|
|
23
|
-
|
|
24
|
-
请严格按照以下结构输出内容:
|
|
25
|
-
|
|
26
|
-
<subject>
|
|
27
|
-
在此处填写学科,必须是以下之一:"数学", "物理", "化学", "生物", "英语", "语文", "历史", "地理", "政治", "其他"。
|
|
28
|
-
</subject>
|
|
29
|
-
|
|
30
|
-
<knowledge_points>
|
|
31
|
-
在此处填写知识点,使用逗号分隔,例如:知识点1, 知识点2, 知识点3
|
|
32
|
-
</knowledge_points>
|
|
33
|
-
|
|
34
|
-
<requires_image>
|
|
35
|
-
判断这道题是否需要依赖图片才能正确解答。如果题目包含几何图形、函数图像、实验装置图、电路图等必须看图才能理解的内容,填写 true;如果只需要文字描述即可理解(如英语题、纯文字数学题),填写 false。
|
|
36
|
-
</requires_image>
|
|
37
|
-
|
|
38
|
-
<has_figure>
|
|
39
|
-
判断题目本身是否带有配图(几何图形、函数图像、示意图、统计图、实验装置图、电路图等;不含学生的作答痕迹和纯文字表格)。有配图填 true,否则填 false。
|
|
40
|
-
</has_figure>
|
|
41
|
-
|
|
42
|
-
<figure_svg>
|
|
43
|
-
如果 has_figure 为 true,用 SVG 重新绘制题目配图:
|
|
44
|
-
${ew}
|
|
45
|
-
如果 has_figure 为 false,请留空。
|
|
46
|
-
</figure_svg>
|
|
47
|
-
|
|
48
|
-
<wrong_answer_text>
|
|
49
|
-
如果图片中包含学生已经写出的错误解答、错误步骤、草稿或错误答案,请尽量按原样摘录;如果没有看到学生错误解答,请留空。
|
|
50
|
-
</wrong_answer_text>
|
|
51
|
-
|
|
52
|
-
<mistake_status>
|
|
53
|
-
填写以下值之一:wrong_attempt(图片中有错误解答或错误步骤)、not_attempted(没有错误解答,像是完全不会做或未作答)、unknown(无法判断)。
|
|
54
|
-
</mistake_status>
|
|
55
|
-
|
|
56
|
-
<difficulty_stars>
|
|
57
|
-
只填写 1 到 5 之间的一个整数,表示题目难度星级。
|
|
58
|
-
${eN}
|
|
59
|
-
</difficulty_stars>
|
|
60
|
-
|
|
61
|
-
<mistake_analysis>
|
|
62
|
-
如果图片中包含错误解答,请分析错误可能发生在哪一步、为什么错、导致了什么后果;如果没有错误解答,请留空。
|
|
63
|
-
</mistake_analysis>
|
|
64
|
-
|
|
65
|
-
<question_text>
|
|
66
|
-
在此处填写题目的完整文本。使用 Markdown 格式。所有数学公式使用 LaTeX 符号(行内 $...$,块级 $$...$$)。
|
|
67
|
-
|
|
68
|
-
【题干转录规则】
|
|
69
|
-
1. **逐字照录**:按图片原文转录题干(含题号、分值和标点),不要改写、概括、增删字词或调整语序;看不清的字用 [?] 标注。
|
|
70
|
-
2. **填空统一**:所有填空处统一写作 ____(4 个下划线),不论原图横线长短。
|
|
71
|
-
3. **图形描述**:如果题目依赖图形,在题干原文之后空一行,单独写**一段**以「图示:」开头的图形描述;只能使用「图示:」这一种写法(不要写「图示信息」「图示说明」等),描述中不要重复题干已有的文字。题目不依赖图形时不要写图示段落。
|
|
72
|
-
|
|
73
|
-
【表格处理规则】
|
|
74
|
-
如果图片中包含表格,必须完整转录表格内容,遵循以下原则:
|
|
75
|
-
|
|
76
|
-
1. **标准表格**:使用 Markdown 表格语法
|
|
77
|
-
| 列标题1 | 列标题2 | 列标题3 |
|
|
78
|
-
|---------|---------|---------|
|
|
79
|
-
| 数据1 | 数据2 | 数据3 |
|
|
80
|
-
|
|
81
|
-
2. **复杂表格**(合并单元格/多级表头/不规则布局):
|
|
82
|
-
- 优先尝试用 Markdown 表格近似表示
|
|
83
|
-
- 如果 Markdown 无法准确表达,在表格前用文字说明结构,然后用简化的 Markdown 表格 + 注释
|
|
84
|
-
- 示例:
|
|
85
|
-
> 注:第1行为主标题,横跨3列;第2-3行为数据行
|
|
86
|
-
|
|
87
|
-
| 项目 | 数值A | 数值B |
|
|
88
|
-
|------|-------|-------|
|
|
89
|
-
| 测试1 | 10 | 20 |
|
|
90
|
-
| 测试2 | 15 | 25 |
|
|
91
|
-
|
|
92
|
-
3. **表格完整性要求**:
|
|
93
|
-
- 必须转录所有单元格内容(包括空单元格用 - 或空格表示)
|
|
94
|
-
- 保留表格标题、单位、注释
|
|
95
|
-
- 保留数据的对齐关系和分组信息
|
|
96
|
-
- 表格中的数学公式使用 LaTeX 语法
|
|
97
|
-
|
|
98
|
-
4. **表格上下文**:
|
|
99
|
-
- 如果表格有标题或编号(如"表1"),保留在表格前
|
|
100
|
-
- 如果表格后有注释或说明,保留在表格后
|
|
101
|
-
- 保持表格在题目中的位置关系
|
|
102
|
-
|
|
103
|
-
5. **特殊情况处理**:
|
|
104
|
-
- 图表混合:如果表格旁边有图形,用文字说明位置关系
|
|
105
|
-
- 手写表格:尽力识别手写内容,不确定的用 [?] 标注
|
|
106
|
-
- 模糊表格:如果表格不清晰,在表格前注明"(表格内容可能不完整)"
|
|
107
|
-
</question_text>
|
|
108
|
-
|
|
109
|
-
<answer_text>
|
|
110
|
-
在此处填写正确答案。使用 Markdown 和 LaTeX 符号。如果答案包含表格,遵循上述【表格处理规则】。
|
|
111
|
-
</answer_text>
|
|
112
|
-
|
|
113
|
-
<analysis>
|
|
114
|
-
在此处填写详细的步骤解析。
|
|
115
|
-
* 必须使用简体中文。
|
|
116
|
-
* **直接使用标准的 LaTeX 符号**(如 $\frac{1}{2}$),**不要**进行 JSON 转义(不要写成 \\frac)。
|
|
117
|
-
* 如果解析过程需要表格(如列表对比、分步计算表),遵循上述【表格处理规则】。
|
|
118
|
-
</analysis>
|
|
119
|
-
|
|
120
|
-
【知识点标签列表(KNOWLEDGE POINT LIST)】
|
|
121
|
-
{{knowledge_points_list}}
|
|
122
|
-
|
|
123
|
-
【标签使用规则 (TAG RULES)】
|
|
124
|
-
- 标签必须与题目实际考查的知识点精准匹配。
|
|
125
|
-
- 每题最多 5 个标签。
|
|
126
|
-
|
|
127
|
-
【!!! 关键格式与内容约束 (CRITICAL RULES) !!!】
|
|
128
|
-
1. **格式严格**:必须严格包含上述 12 个 XML 标签,除此之外不要输出任何其他“开场白”或“结束语”。
|
|
129
|
-
2. **纯文本**:内容作为纯文本处理,**不要转义反斜杠**。
|
|
130
|
-
3. **内容完整**:如果包含子问题,请在 question_text 中完整列出。
|
|
131
|
-
4. **禁止图片**:严禁包含任何图片链接或 markdown 图片语法。
|
|
132
|
-
5. **LaTeX 规范**:
|
|
133
|
-
${ek}
|
|
134
|
-
|
|
135
|
-
{{grade_instruction}}
|
|
136
|
-
{{provider_hints}}`,eC=`你是一位资深的K12教育题目生成专家,具备跨学科的题目创作能力。你的核心任务是**根据以下原题和知识点,举一反三生成高质量教学题目**,帮助学生巩固知识并拓展解题思路。
|
|
137
|
-
### 角色定义
|
|
138
|
-
1. **学科全能专家**
|
|
139
|
-
- 精通K12阶段所有学科(数学/语文/英语/物理/化学/生物/历史/地理/政治)
|
|
140
|
-
- 熟悉各年级课程标准与知识点分布
|
|
141
|
-
- 能准确识别题目考察的核心能力点(计算/推理/分析/应用/创新)
|
|
142
|
-
2. **题目变异大师**
|
|
143
|
-
- 掌握12种变式技法:条件替换/情境迁移/问题转化/数据重构/图形变形/角色反转/跨学科融合/难度阶梯/开放拓展/陷阱设计/逆向思维/生活应用
|
|
144
|
-
- 确保变式题目保持原题核心考点,改变题目表现形式
|
|
145
|
-
3. **学情分析师**
|
|
146
|
-
- 预判学生易错点(认知盲区/概念混淆/计算失误/审题偏差)
|
|
147
|
-
- 在变式题目中针对性强化易错点训练
|
|
148
|
-
### 执行流程
|
|
149
|
-
1. **接收任务**
|
|
150
|
-
原题: "{{original_question}}"
|
|
151
|
-
{{language_instruction}}
|
|
152
|
-
DIFFICULTY LEVEL: {{difficulty_level}}
|
|
153
|
-
{{difficulty_instruction}}
|
|
154
|
-
Knowledge Points: {{knowledge_points}}
|
|
155
|
-
2. **解构分析**
|
|
156
|
-
- 提取核心考点与能力要求
|
|
157
|
-
- 分析题目陷阱与解题路径
|
|
158
|
-
3. **质量管控**
|
|
159
|
-
- 确保每道题:
|
|
160
|
-
✓ 覆盖相同核心知识点
|
|
161
|
-
✓ 保持解题逻辑一致性
|
|
162
|
-
✓ 答案唯一且可验证
|
|
163
|
-
✓ 无知识性错误
|
|
164
|
-
### 输出规范
|
|
165
|
-
你的响应输出**必须严格遵循以下自定义标签格式**。**严禁**使用 JSON 或 Markdown 代码块。**严禁**返回 \`\`\`json ... \`\`\`。
|
|
166
|
-
|
|
167
|
-
请严格按照以下结构输出内容(不要包含任何其他文字):
|
|
168
|
-
|
|
169
|
-
<question_text>
|
|
170
|
-
在此处填写新生成的填空题或解答题。不要包含题号、分值或选择题选项。
|
|
171
|
-
</question_text>
|
|
172
|
-
|
|
173
|
-
<answer_text>
|
|
174
|
-
在此处填写新题目的正确答案。
|
|
175
|
-
</answer_text>
|
|
176
|
-
|
|
177
|
-
<analysis>
|
|
178
|
-
在此处填写新题目的详细解析。
|
|
179
|
-
* 必须使用简体中文。
|
|
180
|
-
* **直接使用标准的 LaTeX 符号**(如 $\frac{1}{2}$),**不要**进行 JSON 转义。
|
|
181
|
-
</analysis>
|
|
182
|
-
|
|
183
|
-
{{figure_instruction}}
|
|
184
|
-
|
|
185
|
-
###关键格式与内容约束 (CRITICAL RULES) !!!
|
|
186
|
-
1. **纯文本**:内容作为纯文本处理,**不要转义反斜杠**。
|
|
187
|
-
2. **LaTeX 规范**:
|
|
188
|
-
${ek}
|
|
189
|
-
|
|
190
|
-
{{grade_instruction}}
|
|
191
|
-
{{provider_hints}}`;var eT=e.i(67240);let eI=(0,m.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);function eL({name:e,description:t}){return(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-2 text-xs py-1",children:[(0,s.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-primary shrink-0 w-fit",children:`{{${e}}}`}),(0,s.jsx)("span",{className:"text-muted-foreground",children:t})]})}function eE({config:e,onUpdate:a}){let{language:r,t:i}=(0,t.useLanguage)(),[n,l]=(0,g.useState)(""),[o,c]=(0,g.useState)("");(0,g.useEffect)(()=>{l(e.prompts?.analyze||eS),c(e.prompts?.similar||eC)},[e.prompts]);let d=async e=>{if(!await (0,ef.confirmDialog)(i.settings?.prompts?.resetConfirm||"Are you sure you want to reset to default?",{destructive:!0}))return;let s="analyze"===e?eS:eC;"analyze"===e?(l(s),a("analyze",s)):(c(s),a("similar",s))},m=(e,s)=>{"analyze"===e?(l(s),a("analyze",s)):(c(s),a("similar",s))},u=()=>(0,s.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-md p-3 flex items-start gap-3 text-amber-900 text-sm mb-4",children:[(0,s.jsx)(C,{className:"h-5 w-5 shrink-0 text-amber-600"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"font-medium",children:i.settings?.prompts?.caution||"Modify with Caution"}),(0,s.jsx)("p",{className:"text-amber-800/90 text-xs",children:i.settings?.prompts?.warning||"Variables in {{brackets}} are used to inject dynamic content. Please preserve these variables, otherwise the AI providing may fail to get question context or return invalid formats."})]})]});return(0,s.jsx)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:(0,s.jsxs)(N.Tabs,{defaultValue:"analyze",className:"w-full",children:[(0,s.jsxs)(N.TabsList,{className:"grid w-full grid-cols-2",children:[(0,s.jsx)(N.TabsTrigger,{value:"analyze",children:i.settings?.prompts?.analysisTab||"Analysis Prompt"}),(0,s.jsx)(N.TabsTrigger,{value:"similar",children:i.settings?.prompts?.similarTab||"Similar Question Prompt"})]}),(0,s.jsx)(N.TabsContent,{value:"analyze",className:"space-y-4 py-4",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(y.Label,{className:"text-base font-semibold",children:i.settings?.prompts?.customAnalysis||"Custom Analysis Template"}),(0,s.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:()=>d("analyze"),children:[(0,s.jsx)(eT.RotateCcw,{className:"w-4 h-4 mr-2"}),i.settings?.prompts?.reset||"Reset Default"]})]}),(0,s.jsx)(u,{}),(0,s.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,s.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,s.jsx)(eI,{className:"h-3.5 w-3.5"}),i.settings?.prompts?.variables||"Available Variables"]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(eL,{name:"language_instruction",description:i.settings?.prompts?.vars?.languageInstruction||"Injects instructions based on target language (e.g., keep English questions in English but analysis in Chinese)."}),(0,s.jsx)(eL,{name:"knowledge_points_list",description:i.settings?.prompts?.vars?.knowledgePointsList||"Injects the standard list of knowledge point tags for the specific subject."}),(0,s.jsx)(eL,{name:"provider_hints",description:i.settings?.prompts?.vars?.providerHints||"System-injected hints (e.g., enforcing JSON format)."})]})]}),(0,s.jsx)(eb.Textarea,{value:n,onChange:e=>m("analyze",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:eS})]})}),(0,s.jsx)(N.TabsContent,{value:"similar",className:"space-y-4 py-4",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(y.Label,{className:"text-base font-semibold",children:i.settings?.prompts?.customSimilar||"Custom Similar Question Template"}),(0,s.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:()=>d("similar"),children:[(0,s.jsx)(eT.RotateCcw,{className:"w-4 h-4 mr-2"}),i.settings?.prompts?.reset||"Reset Default"]})]}),(0,s.jsx)(u,{}),(0,s.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,s.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,s.jsx)(eI,{className:"h-3.5 w-3.5"}),i.settings?.prompts?.variables||"Available Variables"]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(eL,{name:"difficulty_level",description:i.settings?.prompts?.vars?.difficultyLevel||"Target difficulty level."}),(0,s.jsx)(eL,{name:"difficulty_instruction",description:i.settings?.prompts?.vars?.difficultyInstruction||"Specific writing instructions for the target difficulty."}),(0,s.jsx)(eL,{name:"original_question",description:i.settings?.prompts?.vars?.originalQuestion||"The full text of the original question."}),(0,s.jsx)(eL,{name:"knowledge_points",description:i.settings?.prompts?.vars?.knowledgePoints||"List of knowledge points to test."}),(0,s.jsx)(eL,{name:"language_instruction",description:i.settings?.prompts?.vars?.languageInstructionShort||"Language formatting instructions."})]})]}),(0,s.jsx)(eb.Textarea,{value:o,onChange:e=>m("similar",e.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:eC})]})})]})})}function ez({field:e,label:a,description:r}){let{t:i}=(0,t.useLanguage)(),[n,l]=(0,g.useState)(!1),[o,c]=(0,g.useState)(!1),[d,m]=(0,g.useState)(!1),[u,p]=(0,g.useState)(null),x=`preference-${e}`;(0,g.useEffect)(()=>{eg.apiClient.get("/api/user").then(s=>l(!!s[e])).catch(()=>void 0).finally(()=>c(!0))},[e]);let h=async s=>{l(s),m(!0);try{await eg.apiClient.patch("/api/user",{[e]:s}),p(i.importFlow.preferenceSaved)}catch(t){l(!s),p(i.importFlow.preferenceSaveFailed),ev.frontendLogger.error("[Settings]","Failed to save user preference",{field:e,error:t instanceof Error?t.message:String(t)})}finally{m(!1)}};return(0,s.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)(y.Label,{htmlFor:x,children:a}),(0,s.jsx)(el,{id:x,checked:n,onCheckedChange:h,disabled:!o||d})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r}),u&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:u})]})}function eA(){let{t:e}=(0,t.useLanguage)();return(0,s.jsx)(ez,{field:"confirmBeforeImport",label:e.importFlow.confirmBeforeImport,description:e.importFlow.confirmBeforeImportDesc})}function eD(){let{t:e}=(0,t.useLanguage)();return(0,s.jsx)(ez,{field:"enableGeogebra",label:e.importFlow.enableGeogebra,description:e.importFlow.enableGeogebraDesc})}function eR(){let{t:e}=(0,t.useLanguage)();return(0,s.jsx)(ez,{field:"enableSvgAnimation",label:e.importFlow.enableSvgAnimation,description:e.importFlow.enableSvgAnimationDesc})}function eM({value:e,onChange:a}){let{t:r}=(0,t.useLanguage)(),[i,n]=(0,g.useState)(!1),l=(s,t)=>a({...e,[s]:t});return(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:"API Key"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(v.Input,{type:i?"text":"password",value:e?.apiKey||"",onChange:e=>l("apiKey",e.target.value),placeholder:"sk-ant-...",className:"pr-10"}),(0,s.jsx)(f.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>n(!i),"aria-label":i?"Hide API Key":"Show API Key",children:i?(0,s.jsx)(I.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(T.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:"Base URL (Optional)"}),(0,s.jsx)(v.Input,{value:e?.baseUrl||"",onChange:e=>l("baseUrl",e.target.value),placeholder:"https://api.anthropic.com"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:r.settings?.ai?.anthropicBaseUrlHint})]}),(0,s.jsx)(ey,{provider:"anthropic",apiKey:e?.apiKey,baseUrl:e?.baseUrl,currentModel:e?.model,onModelChange:e=>l("model",e)})]})}var e_=e.i(7364);function eP({value:e,onChange:a,disabled:r}){let{t:i}=(0,t.useLanguage)();return(0,s.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,s.jsx)(y.Label,{htmlFor:"app-time-zone",children:i.settings.general.timeZoneLabel}),(0,s.jsx)(v.Input,{id:"app-time-zone",value:e,onChange:e=>a(e.target.value),disabled:r,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,s.jsx)("datalist",{id:"app-time-zones",children:["Asia/Shanghai","Asia/Hong_Kong","Asia/Tokyo","Asia/Singapore","Europe/London","America/New_York","America/Los_Angeles","UTC"].map(e=>(0,s.jsx)("option",{value:e},e))}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:i.settings.general.timeZoneDesc})]})}let eB=(0,m.default)("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]),eF=(0,m.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),eK=(0,m.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),eU=(0,m.default)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);function eO(){let{timeZone:e,setTimeZone:i}=(0,r.useTimeZone)(),{data:n}=(0,a.useSession)(),c=n?.user?.role==="admin",{t:d,language:m,setLanguage:u}=(0,t.useLanguage)(),[p,h]=(0,g.useState)(!1),K=(0,g.useRef)(null),[U,O]=(0,g.useState)(!1),[$,q]=(0,g.useState)(!1),[V,H]=(0,g.useState)(!1),[W,X]=(0,g.useState)(!1),[Y,Z]=(0,g.useState)(!1),[G,J]=(0,g.useState)(!1),[Q,ee]=(0,g.useState)(""),[es,et]=(0,g.useState)(!1),[ea,er]=(0,g.useState)({aiProvider:"gemini"}),[ei,en]=(0,g.useState)(void 0),[el,eo]=(0,g.useState)(!1),[ec,ed]=(0,g.useState)(null),[em,eu]=(0,g.useState)({name:"",email:"",educationStage:"",enrollmentYear:"",password:""}),[ep,ex]=(0,g.useState)(""),[eh,eb]=(0,g.useState)(!1),[eN,ew]=(0,g.useState)(!1),[ek,eS]=(0,g.useState)(!1),[eC,eT]=(0,g.useState)(!1),[eL,ez]=(0,g.useState)(!1),[eO,e$]=(0,g.useState)(!1),[eq,eV]=(0,g.useState)(null),[eH,eW]=(0,g.useState)(""),eX=(0,l.useRouter)();(0,g.useEffect)(()=>{p&&(eY(),eZ()),fetch("/api/version").then(e=>e.json()).then(e=>ee(e.version)).catch(()=>{})},[p]);let eY=async()=>{J(!0);try{let e=await eg.apiClient.get("/api/settings");er(e)}catch(e){ev.frontendLogger.error("[SettingsDialog]","Failed to fetch settings",{error:e instanceof Error?e.message:String(e)})}finally{J(!1)}},eZ=async()=>{eb(!0);try{let e=await eg.apiClient.get("/api/user");eu({name:e.name||"",email:e.email||"",educationStage:e.educationStage||"",enrollmentYear:e.enrollmentYear||"",password:""})}catch(e){ev.frontendLogger.error("[SettingsDialog]","Failed to fetch profile",{error:e instanceof Error?e.message:String(e)})}finally{eb(!1)}},eG=async()=>{if(!(0,F.isValidTimeZone)(ea.timeZone??F.DEFAULT_TIME_ZONE))return void ef.toast.error(d.settings.general.invalidTimeZone);let e=(()=>{if("openai"!==ea.aiProvider)return null;for(let e of ea.openai?.instances||[]){if(!e.name?.trim())return d.settings?.ai?.validationNameRequired||"实例名称不能为空";if(!e.apiKey?.trim())return d.settings?.ai?.validationApiKeyRequired||"API Key 不能为空";if(!e.baseUrl?.trim())return d.settings?.ai?.validationBaseUrlRequired||"Base URL 不能为空";if(!e.model?.trim())return d.settings?.ai?.validationModelRequired||"模型名称不能为空"}return null})();if(e)return void ef.toast.error(e);let s="azure"!==ea.aiProvider?null:ea.azure?.endpoint?.trim()?ea.azure?.deploymentName?.trim()?ea.azure?.apiKey?.trim()?null:d.settings?.ai?.validationApiKeyRequired||"API Key is required":d.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required":d.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(s)return void ef.toast.error(s);Z(!0);try{let e=await eg.apiClient.post("/api/settings",ea);er(e),i(e.timeZone||F.DEFAULT_TIME_ZONE),ef.toast.success(d.settings?.messages?.saved||"Settings saved"),K.current?.scrollTo({top:0,behavior:"smooth"})}catch(e){ev.frontendLogger.error("[SettingsDialog]","Failed to save settings",{error:e instanceof Error?e.message:String(e)}),ef.toast.error(d.settings?.messages?.saveFailed||"Failed to save")}finally{Z(!1)}},eJ=async()=>{ew(!0);try{if(em.password&&em.password!==ep){ef.toast.error(d.settings?.messages?.passwordMismatch||"Passwords do not match"),ew(!1);return}let e={name:em.name,email:em.email,educationStage:em.educationStage};em.enrollmentYear&&(e.enrollmentYear=parseInt(em.enrollmentYear.toString())),em.password&&(e.password=em.password),await eg.apiClient.patch("/api/user",e),ef.toast.success(d.settings?.messages?.profileUpdated||"Profile updated"),eu(e=>({...e,password:""})),ex(""),eS(!1),eT(!1),window.location.reload()}catch(s){ev.frontendLogger.error("[SettingsDialog]","Failed to update profile",{error:s?.data?.message||s?.message||String(s)});let e=s.data?.message||d.settings?.messages?.updateFailed||"Update failed";ef.toast.error(e)}finally{ew(!1)}},eQ=async()=>{if(await (0,ef.confirmDialog)(d.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})){O(!0);try{await eg.apiClient.delete("/api/stats/practice/clear"),ef.toast.success(d.settings?.clearSuccess||"Success"),h(!1),window.location.reload()}catch(e){ev.frontendLogger.error("[SettingsDialog]","Failed to clear practice data",{error:e instanceof Error?e.message:String(e)}),ef.toast.error(d.settings?.clearError||"Failed")}finally{O(!1)}}},e0=async()=>{if(await (0,ef.confirmDialog)(d.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})){q(!0);try{await eg.apiClient.delete("/api/error-items/clear"),ef.toast.success(d.settings?.clearSuccess||"Success"),h(!1),window.location.reload()}catch(e){ev.frontendLogger.error("[SettingsDialog]","Failed to clear error data",{error:e instanceof Error?e.message:String(e)}),ef.toast.error(d.settings?.clearError||"Failed")}finally{q(!1)}}},e1=async()=>{if(!await (0,ef.confirmDialog)(d.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let e=prompt(d.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==e){null!==e&&ef.toast.error(d.common?.error||"Confirmation failed");return}H(!0);try{await eg.apiClient.post("/api/admin/system-reset",{}),ef.toast.success(d.settings?.clearSuccess||"Success - System Reset Complete"),h(!1),window.location.reload()}catch(e){ev.frontendLogger.error("[SettingsDialog]","System reset failed",{error:e instanceof Error?e.message:String(e)}),ef.toast.error(d.settings?.clearError||"Failed to reset system")}finally{H(!1)}},e2=async()=>{ez(!0);try{let e=await fetch("/api/export");if(!e.ok)throw Error("Export failed");let s=await e.blob(),t=window.URL.createObjectURL(s),a=document.createElement("a");a.href=t;let r=e.headers.get("Content-Disposition"),i=r?.match(/filename="(.+)"/);a.download=i?i[1]:"wrong-notebook-export.json",document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(t),ef.toast.success(d.settings?.exportSuccess||"Export successful")}catch(e){ev.frontendLogger.error("[SettingsDialog]","Export failed",{error:e instanceof Error?e.message:String(e)}),ef.toast.error(d.settings?.exportFailed||"Export failed")}finally{ez(!1)}},e4=async()=>{if(await (0,ef.confirmDialog)(d.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){ez(!0);try{let e=await fetch("/api/export?all=true");if(!e.ok){let s=await e.json();throw Error(s.message||"Export failed")}let s=await e.blob(),t=window.URL.createObjectURL(s),a=document.createElement("a");a.href=t;let r=e.headers.get("Content-Disposition"),i=r?.match(/filename="(.+)"/);a.download=i?i[1]:"wrong-notebook-export-all.json",document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(t),ef.toast.success(d.settings?.exportSuccess||"Export successful")}catch(e){ev.frontendLogger.error("[SettingsDialog]","Export all failed",{error:e instanceof Error?e.message:String(e)}),ef.toast.error(d.settings?.exportFailed||"Export failed")}finally{ez(!1)}}},e3=async()=>{if(eq&&await (0,ef.confirmDialog)(d.settings?.importConfirm||"Are you sure you want to import?")){e$(!0);try{let e=await eq.text(),s=JSON.parse(e),t=(await eg.apiClient.post("/api/import",s)).stats;ef.toast.success((d.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records.").replace("{subjects}",String(t.subjectsCreated)).replace("{tags}",String(t.tagsCreated)).replace("{items}",String(t.errorItemsCreated)).replace("{schedules}",String(t.reviewSchedulesCreated)).replace("{records}",String(t.practiceRecordsCreated)).replace("{duplicates}",String(t.duplicateErrorItems??0))),eV(null),eW(""),window.location.reload()}catch(e){ev.frontendLogger.error("[SettingsDialog]","Import failed",{error:e instanceof Error?e.message:String(e)}),ef.toast.error(d.settings?.importFailed||"Import failed")}finally{e$(!1)}}},e5=async()=>{if(eq&&await (0,ef.confirmDialog)(d.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.")){e$(!0);try{let e=await eq.text(),s=JSON.parse(e),t=await fetch("/api/import?all=true",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),a=await t.json();if(a.success){let e=a.stats;ef.toast.success((d.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records.").replace("{subjects}",String(e.subjectsCreated)).replace("{tags}",String(e.tagsCreated)).replace("{items}",String(e.errorItemsCreated)).replace("{schedules}",String(e.reviewSchedulesCreated)).replace("{records}",String(e.practiceRecordsCreated)).replace("{duplicates}",String(e.duplicateErrorItems??0))),eV(null),eW(""),window.location.reload()}else throw Error(a.message||"Import failed")}catch(e){ev.frontendLogger.error("[SettingsDialog]","Import all failed",{error:e instanceof Error?e.message:String(e)}),ef.toast.error(d.settings?.importFailed||"Import failed")}finally{e$(!1)}}},e6=async()=>{if(await (0,ef.confirmDialog)(d.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})){X(!0);try{let e=await eg.apiClient.post("/api/admin/migrate-tags",{});ef.toast.success(`${d.settings?.clearSuccess||"Success"}: ${e.count||0} tags migrated.`)}catch(e){ev.frontendLogger.error("[SettingsDialog]","Tag migration failed",{error:e instanceof Error?e.message:String(e)}),ef.toast.error(d.settings?.clearError||"Failed to migrate tags")}finally{X(!1)}}},e8=(e,s,t)=>{"gemini"===e&&er(e=>({...e,gemini:{...e.gemini,[s]:t}}))},e7=()=>{let e=ea.openai?.instances||[],s=ei||ea.openai?.activeInstanceId;return e.find(e=>e.id===s)},e9=(e,s)=>{let t=ea.openai?.instances||[],a=ei||ea.openai?.activeInstanceId,r=t.map(t=>t.id===a?{...t,[e]:s}:t);er(e=>({...e,openai:{...e.openai,instances:r}}))};(0,g.useEffect)(()=>{ea.openai?.activeInstanceId&&!ei&&en(ea.openai.activeInstanceId)},[ea.openai?.activeInstanceId,ei]);let se=async()=>{eo(!0),ed(null);try{let e;if("openai"===ea.aiProvider){let s=e7();if(!s?.apiKey){ed({success:!1,textSupport:!1,visionSupport:!1,textError:d.settings?.ai?.validationApiKeyRequired||"API Key is required"}),eo(!1);return}e={provider:"openai",apiKey:s.apiKey,baseUrl:s.baseUrl,model:s.model,language:m}}else if("gemini"===ea.aiProvider){if(!ea.gemini?.apiKey){ed({success:!1,textSupport:!1,visionSupport:!1,textError:d.settings?.ai?.validationApiKeyRequired||"API Key is required"}),eo(!1);return}e={provider:"gemini",apiKey:ea.gemini.apiKey,baseUrl:ea.gemini.baseUrl,model:ea.gemini.model,language:m}}else if("anthropic"===ea.aiProvider){if(!ea.anthropic?.apiKey){ed({success:!1,textSupport:!1,visionSupport:!1,textError:d.settings?.ai?.validationApiKeyRequired||"API Key is required"}),eo(!1);return}e={provider:"anthropic",apiKey:ea.anthropic.apiKey,baseUrl:ea.anthropic.baseUrl,model:ea.anthropic.model,language:m}}else{if("azure"!==ea.aiProvider)return void eo(!1);if(!ea.azure?.apiKey||!ea.azure?.endpoint||!ea.azure?.deploymentName){ed({success:!1,textSupport:!1,visionSupport:!1,textError:d.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete"}),eo(!1);return}e={provider:"azure",apiKey:ea.azure.apiKey,endpoint:ea.azure.endpoint,deploymentName:ea.azure.deploymentName,apiVersion:ea.azure.apiVersion,model:ea.azure.model,language:m}}let s=await eg.apiClient.post("/api/ai/test",e);ed(s)}catch(e){ev.frontendLogger.error("[SettingsDialog]","AI connection test failed",{error:e instanceof Error?e.message:String(e)}),ed({success:!1,textSupport:!1,visionSupport:!1,textError:e instanceof Error?e.message:String(e)})}finally{eo(!1)}};return(0,s.jsxs)(j.Dialog,{open:p,onOpenChange:h,children:[(0,s.jsx)(j.DialogTrigger,{asChild:!0,children:(0,s.jsxs)(f.Button,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,s.jsx)(w,{className:"h-5 w-5"}),(0,s.jsx)("span",{className:"sr-only",children:d.settings?.title||"Settings"})]})}),(0,s.jsxs)(j.DialogContent,{ref:K,className:"w-[calc(100vw-2rem)] sm:max-w-[900px] max-h-[85vh] overflow-y-auto",children:[(0,s.jsxs)(j.DialogHeader,{children:[(0,s.jsx)(j.DialogTitle,{children:d.settings?.title||"Settings"}),(0,s.jsx)(j.DialogDescription,{children:d.settings?.desc||"Manage your preferences and data."})]}),(0,s.jsxs)(N.Tabs,{defaultValue:"general",className:"w-full",children:[(0,s.jsxs)(N.TabsList,{className:`grid w-full grid-cols-4 ${n?.user?.role==="admin"?"sm:grid-cols-7":"sm:grid-cols-4"} gap-1 h-auto`,children:[(0,s.jsxs)(N.TabsTrigger,{value:"general",className:"px-2 sm:px-3",children:[(0,s.jsx)(L.Languages,{className:"h-4 w-4 sm:mr-2"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:d.settings?.tabs?.general||"General"})]}),(0,s.jsxs)(N.TabsTrigger,{value:"account",className:"px-2 sm:px-3",children:[(0,s.jsx)(E.User,{className:"h-4 w-4 sm:mr-2"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:d.settings?.tabs?.account||"Account"})]}),n?.user?.role==="admin"&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(N.TabsTrigger,{value:"ai",className:"px-2 sm:px-3",children:[(0,s.jsx)(z,{className:"h-4 w-4 sm:mr-2"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:d.settings?.tabs?.ai||"AI Provider"})]}),(0,s.jsxs)(N.TabsTrigger,{value:"prompts",className:"px-2 sm:px-3",children:[(0,s.jsx)(eB,{className:"h-4 w-4 sm:mr-2"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:d.settings?.tabs?.prompts||"Prompts"})]}),(0,s.jsxs)(N.TabsTrigger,{value:"admin",className:"px-2 sm:px-3",children:[(0,s.jsx)(x,{className:"h-4 w-4 sm:mr-2"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:d.settings?.tabs?.admin||"User Management"})]})]}),(0,s.jsxs)(N.TabsTrigger,{value:"danger",className:"px-2 sm:px-3",children:[(0,s.jsx)(C,{className:"h-4 w-4 sm:mr-2"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:d.settings?.tabs?.danger||"Danger"})]}),(0,s.jsxs)(N.TabsTrigger,{value:"about",className:"px-2 sm:px-3",children:[(0,s.jsx)(eI,{className:"h-4 w-4 sm:mr-2"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:d.settings?.tabs?.about||"About"})]})]}),(0,s.jsxs)(N.TabsContent,{value:"general",className:"space-y-4 py-4",children:[(0,s.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:d.settings?.language||"Language"}),(0,s.jsxs)(b.Select,{value:m,onValueChange:e=>u(e),children:[(0,s.jsx)(b.SelectTrigger,{children:(0,s.jsx)(b.SelectValue,{})}),(0,s.jsxs)(b.SelectContent,{children:[(0,s.jsx)(b.SelectItem,{value:"zh",children:"中文 (Chinese)"}),(0,s.jsx)(b.SelectItem,{value:"en",children:"English"})]})]})]}),(0,s.jsx)(eP,{value:ea.timeZone??e,onChange:e=>er(s=>({...s,timeZone:e})),disabled:!c||G||Y}),c&&(0,s.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,s.jsx)(y.Label,{children:d.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,s.jsx)(v.Input,{type:"number",value:ea.timeouts?.analyze?ea.timeouts.analyze/1e3:"",onChange:e=>{let s=""===e.target.value?0:parseInt(e.target.value);er(e=>({...e,timeouts:{...e.timeouts,analyze:isNaN(s)?0:1e3*s}}))},onBlur:()=>{let e=(ea.timeouts?.analyze||0)/1e3,s=e;s<120&&(s=120),s>600&&(s=600),s!==e&&er(e=>({...e,timeouts:{...e.timeouts,analyze:1e3*s}}))},min:120,max:600}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,s.jsx)(eA,{}),(0,s.jsx)(eR,{}),(0,s.jsx)(eD,{}),(0,s.jsx)(e_.DuplicateThresholdSetting,{})]}),c&&(0,s.jsxs)(f.Button,{onClick:eG,disabled:Y,className:"w-full",children:[Y&&(0,s.jsx)(S.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),d.settings?.save||"Save Settings"]})]}),(0,s.jsx)(N.TabsContent,{value:"account",className:"space-y-4 py-4",children:eh?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)(S.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,s.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:d.auth?.name||"Name"}),(0,s.jsx)(v.Input,{value:em.name||"",onChange:e=>eu({...em,name:e.target.value})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:d.auth?.email||"Email"}),(0,s.jsx)(v.Input,{value:em.email||"",onChange:e=>eu({...em,email:e.target.value}),type:"email"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:d.auth?.educationStage||"Education Stage"}),(0,s.jsxs)(b.Select,{value:em.educationStage||"",onValueChange:e=>eu({...em,educationStage:e}),children:[(0,s.jsx)(b.SelectTrigger,{children:(0,s.jsx)(b.SelectValue,{placeholder:d.auth?.selectStage||"Select Stage"})}),(0,s.jsxs)(b.SelectContent,{children:[(0,s.jsx)(b.SelectItem,{value:"primary",children:d.auth?.primary||"Primary School"}),(0,s.jsx)(b.SelectItem,{value:"junior_high",children:d.auth?.juniorHigh||"Junior High"}),(0,s.jsx)(b.SelectItem,{value:"senior_high",children:d.auth?.seniorHigh||"Senior High"}),(0,s.jsx)(b.SelectItem,{value:"university",children:d.auth?.university||"University"})]})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:d.auth?.enrollmentYear||"Enrollment Year"}),(0,s.jsx)(v.Input,{type:"number",value:em.enrollmentYear||"",onChange:e=>eu({...em,enrollmentYear:e.target.value}),placeholder:"YYYY"})]})]}),(0,s.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:d.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(v.Input,{type:ek?"text":"password",value:em.password,onChange:e=>eu({...em,password:e.target.value}),placeholder:"******",minLength:6,className:"pr-10"}),(0,s.jsx)(f.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>eS(!ek),tabIndex:-1,children:ek?(0,s.jsx)(I.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(T.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),em.password&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:d.auth?.confirmPassword||"Confirm Password"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(v.Input,{type:eC?"text":"password",value:ep,onChange:e=>ex(e.target.value),placeholder:"******",minLength:6,className:"pr-10"}),(0,s.jsx)(f.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>eT(!eC),tabIndex:-1,children:eC?(0,s.jsx)(I.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(T.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]})]}),(0,s.jsxs)(f.Button,{onClick:eJ,disabled:eN,className:"w-full",children:[eN&&(0,s.jsx)(S.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),d.settings?.account?.update||"Update Profile"]})]})}),(0,s.jsx)(N.TabsContent,{value:"ai",className:"space-y-4 py-4",children:G?(0,s.jsx)("div",{className:"flex justify-center py-4",children:(0,s.jsx)(S.Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,s.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:d.settings?.tabs?.ai||"AI Provider"}),(0,s.jsxs)(b.Select,{value:ea.aiProvider,onValueChange:e=>er(s=>({...s,aiProvider:e})),children:[(0,s.jsx)(b.SelectTrigger,{children:(0,s.jsx)(b.SelectValue,{})}),(0,s.jsxs)(b.SelectContent,{children:[(0,s.jsx)(b.SelectItem,{value:"gemini",children:"Google Gemini"}),(0,s.jsx)(b.SelectItem,{value:"openai",children:"OpenAI / Compatible"}),(0,s.jsx)(b.SelectItem,{value:"azure",children:"Azure OpenAI"}),(0,s.jsx)(b.SelectItem,{value:"anthropic",children:"Anthropic / Compatible"})]})]})]}),"openai"===ea.aiProvider&&(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(y.Label,{children:d.settings?.ai?.instances||"Instance"}),(0,s.jsxs)(f.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>{let e=ea.openai?.instances||[];if(e.length>=10)return;let s={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let s=16*Math.random()|0;return("x"===e?s:3&s|8).toString(16)}),name:`Instance ${e.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-4o"};er(e=>({...e,openai:{instances:[...e.openai?.instances||[],s],activeInstanceId:s.id}})),en(s.id)},disabled:(ea.openai?.instances?.length||0)>=10,className:"h-7 px-2 text-xs",children:[(0,s.jsx)(D.Plus,{className:"h-3 w-3 mr-1"}),d.settings?.ai?.addInstance||"Add"]})]}),(ea.openai?.instances?.length||0)>0?(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(b.Select,{value:ei||ea.openai?.activeInstanceId||"",onValueChange:e=>{en(e),er(s=>({...s,openai:{...s.openai,activeInstanceId:e}}))},children:[(0,s.jsx)(b.SelectTrigger,{className:"flex-1",children:(0,s.jsx)(b.SelectValue,{placeholder:d.settings?.ai?.selectInstance||"Select Instance"})}),(0,s.jsx)(b.SelectContent,{children:(ea.openai?.instances||[]).map(e=>(0,s.jsx)(b.SelectItem,{value:e.id,children:e.name},e.id))})]}),(ea.openai?.instances?.length||0)>1&&(0,s.jsx)(f.Button,{type:"button",variant:"outline",size:"icon",onClick:async()=>{let e,s,t=ei||ea.openai?.activeInstanceId;t&&await (0,ef.confirmDialog)(d.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0})&&(s=(e=(ea.openai?.instances||[]).filter(e=>e.id!==t)).length>0?e[0].id:void 0,er(t=>({...t,openai:{instances:e,activeInstanceId:s}})),en(s))},className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,s.jsx)(k.Trash2,{className:"h-4 w-4"})})]}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:d.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),(ea.openai?.instances?.length||0)>=10&&(0,s.jsx)("p",{className:"text-xs text-amber-600",children:d.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),e7()&&(0,s.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(y.Label,{children:[d.settings?.ai?.instanceName||"Instance Name"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(v.Input,{value:e7()?.name||"",onChange:e=>e9("name",e.target.value),placeholder:"e.g. 智谱 GLM-4V",className:e7()?.name?.trim()?"":"border-destructive"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(y.Label,{children:["API Key ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(v.Input,{type:es?"text":"password",value:e7()?.apiKey||"",onChange:e=>e9("apiKey",e.target.value),placeholder:"sk-...",className:`pr-10 ${!e7()?.apiKey?.trim()?"border-destructive":""}`}),(0,s.jsx)(f.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>et(!es),children:es?(0,s.jsx)(I.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(T.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,s.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,s.jsxs)(y.Label,{children:["Base URL ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(v.Input,{value:e7()?.baseUrl||"",onChange:e=>e9("baseUrl",e.target.value),placeholder:"https://api.openai.com/v1",className:e7()?.baseUrl?.trim()?"":"border-destructive"})]}),(0,s.jsx)(ey,{provider:"openai",apiKey:e7()?.apiKey,baseUrl:e7()?.baseUrl,currentModel:e7()?.model,onModelChange:e=>e9("model",e)})]})]}),"gemini"===ea.aiProvider&&(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:"API Key"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(v.Input,{type:es?"text":"password",value:ea.gemini?.apiKey||"",onChange:e=>e8("gemini","apiKey",e.target.value),placeholder:"AIza...",className:"pr-10"}),(0,s.jsx)(f.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>et(!es),children:es?(0,s.jsx)(I.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(T.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:"Base URL (Optional)"}),(0,s.jsx)(v.Input,{value:ea.gemini?.baseUrl||"",onChange:e=>e8("gemini","baseUrl",e.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,s.jsx)(ey,{provider:"gemini",apiKey:ea.gemini?.apiKey,baseUrl:ea.gemini?.baseUrl,currentModel:ea.gemini?.model,onModelChange:e=>e8("gemini","model",e)})]}),"anthropic"===ea.aiProvider&&(0,s.jsx)(eM,{value:ea.anthropic,onChange:e=>er(s=>({...s,anthropic:e}))}),"azure"===ea.aiProvider&&(0,s.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(y.Label,{children:[d.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(v.Input,{value:ea.azure?.endpoint||"",onChange:e=>er(s=>({...s,azure:{...s.azure,endpoint:e.target.value}})),placeholder:d.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:ea.azure?.endpoint?.trim()?"":"border-destructive"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(y.Label,{children:[d.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsx)(v.Input,{value:ea.azure?.deploymentName||"",onChange:e=>er(s=>({...s,azure:{...s.azure,deploymentName:e.target.value}})),placeholder:d.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:ea.azure?.deploymentName?.trim()?"":"border-destructive"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(y.Label,{children:["API Key ",(0,s.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(v.Input,{type:es?"text":"password",value:ea.azure?.apiKey||"",onChange:e=>er(s=>({...s,azure:{...s.azure,apiKey:e.target.value}})),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:`pr-10 ${!ea.azure?.apiKey?.trim()?"border-destructive":""}`}),(0,s.jsx)(f.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>et(!es),children:es?(0,s.jsx)(I.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(T.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:d.settings?.ai?.azureApiVersion||"API Version"}),(0,s.jsx)(v.Input,{value:ea.azure?.apiVersion||"",onChange:e=>er(s=>({...s,azure:{...s.azure,apiVersion:e.target.value}})),placeholder:d.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(y.Label,{children:d.settings?.ai?.azureModel||"Model Display Name"}),(0,s.jsx)(v.Input,{value:ea.azure?.model||"",onChange:e=>er(s=>({...s,azure:{...s.azure,model:e.target.value}})),placeholder:"gpt-4o"})]})]}),(0,s.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(f.Button,{type:"button",variant:"outline",onClick:se,disabled:el||Y,className:"flex-1",children:[el?(0,s.jsx)(S.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(R,{className:"mr-2 h-4 w-4"}),el?d.settings?.ai?.testing||"测试中...":d.settings?.ai?.testConnection||"测试连接"]}),(0,s.jsxs)(f.Button,{onClick:eG,disabled:Y||el,className:"flex-1",children:[Y&&(0,s.jsx)(S.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),d.settings?.ai?.save||"Save AI Settings"]})]}),ec&&(0,s.jsxs)("div",{className:`p-3 rounded-md text-sm ${ec.success?"bg-green-50 border border-green-200":"bg-red-50 border border-red-200"}`,children:[(0,s.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:ec.success?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(M,{className:"h-4 w-4 text-green-600"}),(0,s.jsx)("span",{className:"text-green-700",children:d.settings?.ai?.testSuccess||"连接成功"}),ec.modelInfo&&(0,s.jsxs)("span",{className:"text-green-600 text-xs",children:["(",ec.modelInfo,")"]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_.XCircle,{className:"h-4 w-4 text-red-600"}),(0,s.jsx)("span",{className:"text-red-700",children:d.settings?.ai?.testFailed||"连接失败"})]})}),ec.success&&(0,s.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:[d.settings?.ai?.textSupport||"文本生成",":"]}),(0,s.jsxs)("span",{className:"text-green-600",children:["✓ ",d.settings?.ai?.supported||"支持"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-muted-foreground",children:[d.settings?.ai?.visionSupport||"图像识别/多模态",":"]}),ec.visionSupport?(0,s.jsxs)("span",{className:"text-green-600",children:["✓ ",d.settings?.ai?.supported||"支持"]}):(0,s.jsxs)("span",{className:"text-amber-600",children:["✗ ",ec.visionError?d.settings?.ai?.errors?.[ec.visionError]||ec.visionError.replace("UNKNOWN:",""):d.settings?.ai?.notSupported||"不支持"]})]}),(0,s.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:"* 由于网络问题,可能测试结果不准确"})]}),!ec.success&&ec.textError&&(0,s.jsx)("p",{className:"text-red-600 text-xs mt-1",children:d.settings?.ai?.errors?.[ec.textError]||ec.textError.replace("UNKNOWN:","")})]})]})]})}),(0,s.jsxs)(N.TabsContent,{value:"prompts",className:"space-y-4 py-4",children:[(0,s.jsx)(eE,{config:ea,onUpdate:(e,s)=>{er(t=>({...t,prompts:{...t.prompts,[e]:s}}))}}),(0,s.jsxs)(f.Button,{onClick:eG,disabled:Y,className:"w-full",children:[Y&&(0,s.jsx)(S.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),d.settings?.prompts?.save||"Save Prompt Settings"]})]}),n?.user?.role==="admin"&&(0,s.jsxs)(N.TabsContent,{value:"admin",className:"space-y-4 py-4",children:[(0,s.jsxs)(f.Button,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{h(!1),eX.push("/admin")},children:[(0,s.jsx)(o.BarChart3,{className:"h-4 w-4"}),d.admin?.dashboard?.title||"Admin Dashboard"]}),(0,s.jsx)("div",{className:"border-t pt-4",children:(0,s.jsx)(ej,{})})]}),(0,s.jsx)(N.TabsContent,{value:"danger",className:"space-y-4 py-4",children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,s.jsx)("h4",{className:"text-sm font-bold text-blue-900 mb-3",children:d.settings?.dataManagement||"Data Management"}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:d.settings?.exportData||"Export Data"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:e2,disabled:eL,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[eL?(0,s.jsx)(S.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(P.Download,{className:"mr-2 h-4 w-4"}),d.settings?.exportData||"Export"]}),n?.user?.role==="admin"&&(0,s.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:e4,disabled:eL,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[eL?(0,s.jsx)(S.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(P.Download,{className:"mr-2 h-4 w-4"}),d.settings?.exportAllData||"Export All"]})]})]}),(0,s.jsx)("p",{className:"text-xs text-blue-700",children:d.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:d.settings?.importData||"Import Data"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"file",accept:".json",onChange:e=>{let s=e.target.files?.[0];s&&(eV(s),eW(s.name))},className:"hidden",id:"import-file-input",disabled:eO}),(0,s.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:eO,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[eO?(0,s.jsx)(S.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(B,{className:"mr-2 h-4 w-4"}),eH||d.settings?.selectFile||"Select File"]}),eq&&(0,s.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:e3,disabled:eO,className:"bg-green-100 hover:bg-green-200 text-green-900 border-green-300",children:[eO?(0,s.jsx)(S.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(M,{className:"mr-2 h-4 w-4"}),d.settings?.importData||"Import"]}),eq&&n?.user?.role==="admin"&&(0,s.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:e5,disabled:eO,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[eO?(0,s.jsx)(S.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(M,{className:"mr-2 h-4 w-4"}),d.settings?.importAllData||"Import All"]})]})]}),(0,s.jsx)("p",{className:"text-xs text-blue-700",children:d.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]}),n?.user?.role==="admin"&&(0,s.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsxs)("span",{className:"text-sm text-blue-900 font-bold flex items-center gap-2",children:[(0,s.jsx)(A.RefreshCw,{className:"h-4 w-4"}),d.settings?.migrateTags||"Migrate Tags"]})}),(0,s.jsx)(f.Button,{variant:"outline",size:"sm",onClick:e6,disabled:W,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:W?(0,s.jsx)(S.Loader2,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(A.RefreshCw,{className:"h-4 w-4"})})]}),(0,s.jsx)("p",{className:"text-xs text-blue-800 mt-2 font-medium",children:d.settings?.migrateTagsDesc||"Re-populates standard tags from file"})]}),(0,s.jsxs)("div",{className:"p-4 border border-red-200 rounded-lg bg-red-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-red-700 font-medium",children:d.settings?.clearData||"Clear Practice Data"}),(0,s.jsx)(f.Button,{variant:"destructive",size:"sm",onClick:eQ,disabled:U,children:U?(0,s.jsx)(S.Loader2,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(k.Trash2,{className:"h-4 w-4"})})]}),(0,s.jsx)("p",{className:"text-xs text-red-600 mt-2",children:d.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible."})]}),(0,s.jsxs)("div",{className:"p-4 border border-red-200 rounded-lg bg-red-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-red-700 font-medium",children:d.settings?.clearErrorData||"Clear Error Data"}),(0,s.jsx)(f.Button,{variant:"destructive",size:"sm",onClick:e0,disabled:$,children:$?(0,s.jsx)(S.Loader2,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(k.Trash2,{className:"h-4 w-4"})})]}),(0,s.jsx)("p",{className:"text-xs text-red-600 mt-2",children:d.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible."})]}),n?.user?.role==="admin"&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"p-4 border border-red-600/50 rounded-lg bg-red-100/50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsxs)("span",{className:"text-sm text-red-900 font-bold flex items-center gap-2",children:[(0,s.jsx)(C,{className:"h-4 w-4"}),d.settings?.systemReset||"System Initialization"]})}),(0,s.jsx)(f.Button,{variant:"destructive",size:"sm",onClick:e1,disabled:V,className:"bg-red-700 hover:bg-red-800",children:V?(0,s.jsx)(S.Loader2,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(k.Trash2,{className:"h-4 w-4"})})]}),(0,s.jsx)("p",{className:"text-xs text-red-800 mt-2 font-medium",children:d.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data."})]})})]})}),(0,s.jsx)(N.TabsContent,{value:"about",className:"space-y-4 py-4",children:(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-6 py-8 text-center bg-muted/30 rounded-lg border",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-2xl font-bold",children:d.app?.title||"Smart Error Notebook"}),(0,s.jsx)("p",{className:"text-muted-foreground",children:d.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2 text-sm text-muted-foreground border px-4 py-2 rounded-full bg-background",children:[(0,s.jsx)(eI,{className:"h-4 w-4"}),(0,s.jsxs)("span",{children:[d.settings?.about?.version||"Version",": v",Q||"unknown"]})]}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row flex-wrap justify-center gap-4 w-full sm:w-auto px-4 sm:px-0",children:[(0,s.jsx)(f.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,s.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(eK,{className:"h-4 w-4"}),d.settings?.about?.github||"GitHub Repository",(0,s.jsx)(eF,{className:"h-3 w-3 ml-1 opacity-50"})]})}),(0,s.jsx)(f.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,s.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook/releases",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(eU,{className:"h-4 w-4"}),d.settings?.about?.releaseNotes||"Release Notes",(0,s.jsx)(eF,{className:"h-3 w-3 ml-1 opacity-50"})]})}),(0,s.jsx)(f.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,s.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook/issues",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(eB,{className:"h-4 w-4"}),d.settings?.about?.feedback||"Feedback",(0,s.jsx)(eF,{className:"h-3 w-3 ml-1 opacity-50"})]})})]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:d.settings?.about?.copyright||"© 2025 Wttwins. All rights reserved."})]})})]})]})]})}let e$=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/],eq=[{key:"home",href:"/",icon:p,match:e=>"/"===e},{key:"notebooks",href:"/notebooks",icon:c.BookOpen,match:e=>e.startsWith("/notebooks")||e.startsWith("/error-items")||e.startsWith("/practice")},{key:"tags",href:"/tags",icon:h,match:e=>e.startsWith("/tags")},{key:"stats",href:"/stats",icon:o.BarChart3,match:e=>e.startsWith("/stats")},{key:"exams",href:"/exams",icon:d.FileText,match:e=>e.startsWith("/exams")}];function eV({children:e}){let r=(0,l.usePathname)()||"/",{t:o}=(0,t.useLanguage)(),{data:c,status:d}=(0,a.useSession)();if(e$.some(e=>e.test(r))||"unauthenticated"===d)return(0,s.jsx)(s.Fragment,{children:e});let m=c?.user?.role==="admin",p=c?.user?.name||c?.user?.email||"";return(0,s.jsxs)("div",{className:"min-h-screen",children:[(0,s.jsx)("header",{className:"sticky top-0 z-40 border-b bg-card/80 backdrop-blur-md supports-[backdrop-filter]:bg-card/70 print:hidden",children:(0,s.jsxs)("div",{className:"mx-auto flex h-14 max-w-6xl items-center gap-3 px-4 md:h-16 md:px-8",children:[(0,s.jsxs)(n.default,{href:"/",className:"flex shrink-0 items-center gap-2",children:[(0,s.jsx)(i.default,{src:"/icons/icon.png",alt:"",width:32,height:32,className:"rounded-lg",priority:!0,unoptimized:!0}),(0,s.jsx)("span",{className:"text-base font-semibold tracking-tight",children:o.pageTitle.base})]}),(0,s.jsx)("nav",{className:"ml-4 hidden items-center gap-1 md:flex",children:eq.map(e=>{let t=e.match(r),a=e.icon;return(0,s.jsxs)(n.default,{href:e.href,className:(0,en.cn)("flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors",t?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),"aria-current":t?"page":void 0,children:[(0,s.jsx)(a,{className:"h-4 w-4"}),o.nav[e.key]]},e.key)})}),(0,s.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[p&&(0,s.jsxs)("span",{className:"mr-2 hidden max-w-40 items-center gap-2 truncate text-sm text-muted-foreground lg:flex",children:[(0,s.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary",children:p.slice(0,1).toUpperCase()}),(0,s.jsx)("span",{className:"truncate",children:p})]}),m&&(0,s.jsx)(n.default,{href:"/admin",title:o.nav.admin,children:(0,s.jsxs)(f.Button,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,s.jsx)(x,{className:"h-5 w-5"}),(0,s.jsx)("span",{className:"sr-only",children:o.nav.admin})]})}),(0,s.jsx)(eO,{}),(0,s.jsx)(f.Button,{variant:"ghost",size:"icon",className:"rounded-full text-muted-foreground hover:text-destructive",onClick:()=>(0,a.signOut)({callbackUrl:"/login"}),title:o.app.logout,children:(0,s.jsx)(u,{className:"h-5 w-5"})})]})]})}),(0,s.jsx)("div",{className:"pb-20 md:pb-0",children:e}),(0,s.jsx)("nav",{className:"pb-safe fixed inset-x-0 bottom-0 z-40 border-t bg-card/90 backdrop-blur-md md:hidden print:hidden",children:(0,s.jsx)("div",{className:"grid h-16 grid-cols-5",children:eq.map(e=>{let t=e.match(r),a=e.icon;return(0,s.jsxs)(n.default,{href:e.href,className:(0,en.cn)("flex flex-col items-center justify-center gap-1 text-[11px] font-medium transition-colors",t?"text-primary":"text-muted-foreground"),"aria-current":t?"page":void 0,children:[(0,s.jsx)("span",{className:(0,en.cn)("flex h-7 w-12 items-center justify-center rounded-full transition-colors",t&&"bg-accent"),children:(0,s.jsx)(a,{className:"h-5 w-5"})}),o.nav[e.key]]},e.key)})})})]})}let eH=(0,m.default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]),eW=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/];function eX(){let{t:e}=(0,t.useLanguage)(),{timeZone:i}=(0,r.useTimeZone)(),{status:o}=(0,a.useSession)(),c=(0,l.usePathname)(),[d,m]=(0,g.useState)(!1),[u,p]=(0,g.useState)([]),[x,h]=(0,g.useState)(()=>Date.now()),v="authenticated"!==o||eW.some(e=>e.test(c||"")),y=(0,g.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{let e=await eg.apiClient.get("/api/tasks");p(e.tasks),h(Date.now())}catch{}},[]);if((0,g.useEffect)(()=>{if(v)return;let e=setTimeout(y,0),s=setInterval(y,d?2e3:15e3);return()=>{clearTimeout(e),clearInterval(s)}},[v,d,y]),v)return null;let b=u.filter(e=>"running"===e.status).length,N=u.some(e=>"running"!==e.status),w=async()=>{try{let e=await eg.apiClient.delete("/api/tasks");p(e.tasks)}catch{}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(f.Button,{variant:"outline",size:"icon",className:"fixed bottom-20 right-4 z-40 h-11 w-11 rounded-full shadow-lg md:bottom-6 md:right-6 print:hidden",onClick:()=>m(!0),"aria-label":e.backgroundTasks.title,title:e.backgroundTasks.title,children:[b>0?(0,s.jsx)(S.Loader2,{className:"h-5 w-5 animate-spin"}):(0,s.jsx)(eH,{className:"h-5 w-5"}),b>0&&(0,s.jsx)("span",{className:"absolute -right-1 -top-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs text-primary-foreground",children:b})]}),(0,s.jsx)(j.Dialog,{open:d,onOpenChange:m,children:(0,s.jsxs)(j.DialogContent,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,s.jsxs)(j.DialogHeader,{children:[(0,s.jsx)(j.DialogTitle,{children:e.backgroundTasks.title}),(0,s.jsx)(j.DialogDescription,{children:e.backgroundTasks.description})]}),0===u.length?(0,s.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:e.backgroundTasks.empty}):(0,s.jsx)("ul",{className:"space-y-2",children:u.map(t=>{var a,r;let l;return(0,s.jsx)("li",{className:"rounded-md border p-3 text-sm",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:["running"===t.status&&(0,s.jsx)(S.Loader2,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-primary"}),"succeeded"===t.status&&(0,s.jsx)(M,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),"failed"===t.status&&(0,s.jsx)(_.XCircle,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"font-medium",children:[e.backgroundTasks.kinds[t.kind],(0,s.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",e.backgroundTasks.status[t.status]]})]}),t.subject&&(0,s.jsx)("div",{className:"break-words text-muted-foreground",children:t.subject}),t.progress&&t.progress.total>0&&(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-muted",children:(0,s.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.round(t.progress.done/t.progress.total*100)}%`}})}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e.backgroundTasks.progress.replace("{done}",String(t.progress.done)).replace("{total}",String(t.progress.total)),t.progress.failed>0&&` \xb7 ${e.backgroundTasks.failedCount.replace("{count}",String(t.progress.failed))}`]})]}),t.error&&(0,s.jsx)("div",{className:"text-xs text-destructive",children:(s=>{if(!s)return null;let t=e.backgroundTasks.errors[s]??e.errors[s];return"string"==typeof t?t:s})(t.error)}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{children:e.backgroundTasks.startedAt.replace("{time}",(0,F.formatDateTime)(t.startedAt,"HH:mm:ss",i))}),(0,s.jsx)("span",{children:e.backgroundTasks.elapsed.replace("{time}",(a=t.startedAt,r=t.finishedAt,l=Math.max(0,Math.round(((r?Date.parse(r):x)-Date.parse(a))/1e3)),`${Math.floor(l/60)}:${String(l%60).padStart(2,"0")}`))}),t.link&&(0,s.jsx)(n.default,{href:t.link,className:"text-primary hover:underline",onClick:()=>m(!1),children:e.backgroundTasks.view})]})]})]})},t.id)})}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:e.backgroundTasks.retentionHint}),N&&(0,s.jsx)(f.Button,{variant:"ghost",size:"sm",onClick:w,children:e.backgroundTasks.clearFinished})]})]})})]})}var eY=e.i(37727);let eZ={success:{icon:M,className:"text-success"},error:{icon:_.XCircle,className:"text-destructive"},warning:{icon:C,className:"text-warning"},info:{icon:eI,className:"text-primary"}};function eG(){let{t:e}=(0,t.useLanguage)(),[a,r]=(0,g.useState)([]),[i,n]=(0,g.useState)(null);return(0,g.useEffect)(()=>(0,ef.subscribeFeedback)(e=>{r(e.toasts),n(e.confirm)}),[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"pointer-events-none fixed inset-x-0 top-3 z-[100] flex flex-col items-center gap-2 px-4 print:hidden",role:"status","aria-live":"polite",children:a.map(t=>{let{icon:a,className:r}=eZ[t.type];return(0,s.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-sm items-start gap-3 rounded-xl border bg-card/95 px-4 py-3 text-sm shadow-lg backdrop-blur animate-in fade-in slide-in-from-top-2 duration-200",children:[(0,s.jsx)(a,{className:(0,en.cn)("mt-0.5 h-4 w-4 shrink-0",r)}),(0,s.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:t.message}),(0,s.jsx)("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>(0,ef.dismissToast)(t.id),"aria-label":e.common.close,children:(0,s.jsx)(eY.X,{className:"h-3.5 w-3.5"})})]},t.id)})}),(0,s.jsx)(j.Dialog,{open:!!i,onOpenChange:e=>{e||i?.resolve(!1)},children:(0,s.jsxs)(j.DialogContent,{className:"sm:max-w-md",children:[(0,s.jsxs)(j.DialogHeader,{children:[(0,s.jsxs)(j.DialogTitle,{className:"flex items-center gap-2",children:[i?.destructive&&(0,s.jsx)(C,{className:"h-5 w-5 text-destructive"}),i?.title||e.common.confirmTitle]}),(0,s.jsx)(j.DialogDescription,{className:"whitespace-pre-line pt-1 text-left leading-relaxed",children:i?.message})]}),(0,s.jsxs)(j.DialogFooter,{className:"gap-2",children:[(0,s.jsx)(f.Button,{variant:"outline",onClick:()=>i?.resolve(!1),children:i?.cancelText||e.common.cancel}),(0,s.jsx)(f.Button,{variant:i?.destructive?"destructive":"default",onClick:()=>i?.resolve(!0),autoFocus:!0,children:i?.confirmText||e.common.confirm})]})]})})]})}e.s(["Providers",0,function({children:e,timeZone:i}){return(0,s.jsx)(a.SessionProvider,{children:(0,s.jsx)(t.LanguageProvider,{children:(0,s.jsxs)(r.TimeZoneProvider,{initialTimeZone:i,children:[(0,s.jsx)(eV,{children:e}),(0,s.jsx)(eX,{}),(0,s.jsx)(eG,{})]})})})}],1661)}]);
|
|
File without changes
|
/package/.next/static/{OpwRvHtdhPgxve2rKkWkK → PipzREVX2s4mdvp2gs1DS}/_clientMiddlewareManifest.js
RENAMED
|
File without changes
|
|
File without changes
|