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,19 +1,19 @@
|
|
|
1
|
-
module.exports=[18175,a=>{"use strict";var b=a.i(87924),c=a.i(50194),d=a.i(75003),e=a.i(29759),f=a.i(71987),g=a.i(38246),h=a.i(50944),i=a.i(39761),j=a.i(53722),k=a.i(4720),l=a.i(70106);let m=(0,l.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"}]]),n=(0,l.default)("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),o=(0,l.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"}]]),p=(0,l.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 q=a.i(72131),r=a.i(99570),s=a.i(14574),t=a.i(66718),u=a.i(70430),v=a.i(80701),w=a.i(75083);let x=(0,l.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 y=a.i(81560),z=a.i(96221);let A=(0,l.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 B=a.i(77156),C=a.i(41379),D=a.i(33836),E=a.i(46842);let F=(0,l.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 G=a.i(69520),H=a.i(15618);let I=(0,l.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"}]]),J=(0,l.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var K=a.i(62722),L=a.i(84505);let M=(0,l.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 N=a.i(86705),O=a.i(86304),P=a.i(7554),Q=a.i(70121),R=a.i(50104),S=a.i(25152),T=a.i(77994),U=a.i(3688);a.i(35112);var V=Symbol("radix.slottable");function W(a){return q.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===V}var X=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((a,c)=>{var d,e;let f,g,h,i=(e=d=`Primitive.${c}`,(f=q.forwardRef((a,b)=>{let{children:c,...d}=a;if(q.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==q.Fragment&&(h.ref=b?(0,Q.composeRefs)(b,g):g),q.cloneElement(c,h)}return q.Children.count(c)>1?q.Children.only(null):null})).displayName=`${e}.SlotClone`,g=f,(h=q.forwardRef((a,c)=>{let{children:d,...e}=a,f=q.Children.toArray(d),h=f.find(W);if(h){let a=h.props.children,d=f.map(b=>b!==h?b:q.Children.count(a)>1?q.Children.only(null):q.isValidElement(a)?a.props.children:null);return(0,b.jsx)(g,{...e,ref:c,children:q.isValidElement(a)?q.cloneElement(a,void 0,d):null})}return(0,b.jsx)(g,{...e,ref:c,children:d})})).displayName=`${d}.Slot`,h),j=q.forwardRef((a,d)=>{let{asChild:e,...f}=a;return(0,b.jsx)(e?i:c,{...f,ref:d})});return j.displayName=`Primitive.${c}`,{...a,[c]:j}},{}),Y="Switch",[Z,$]=(0,R.createContextScope)(Y),[_,aa]=Z(Y),ab=q.forwardRef((a,c)=>{let{__scopeSwitch:d,name:e,checked:f,defaultChecked:g,required:h,disabled:i,value:j="on",onCheckedChange:k,form:l,...m}=a,[n,o]=q.useState(null),p=(0,Q.useComposedRefs)(c,a=>o(a)),r=q.useRef(!1),s=!n||l||!!n.closest("form"),[t,u]=(0,S.useControllableState)({prop:f,defaultProp:g??!1,onChange:k,caller:Y});return(0,b.jsxs)(_,{scope:d,checked:t,disabled:i,children:[(0,b.jsx)(X.button,{type:"button",role:"switch","aria-checked":t,"aria-required":h,"data-state":af(t),"data-disabled":i?"":void 0,disabled:i,value:j,...m,ref:p,onClick:(0,P.composeEventHandlers)(a.onClick,a=>{u(a=>!a),s&&(r.current=a.isPropagationStopped(),r.current||a.stopPropagation())})}),s&&(0,b.jsx)(ae,{control:n,bubbles:!r.current,name:e,value:j,checked:t,required:h,disabled:i,form:l,style:{transform:"translateX(-100%)"}})]})});ab.displayName=Y;var ac="SwitchThumb",ad=q.forwardRef((a,c)=>{let{__scopeSwitch:d,...e}=a,f=aa(ac,d);return(0,b.jsx)(X.span,{"data-state":af(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:c})});ad.displayName=ac;var ae=q.forwardRef(({__scopeSwitch:a,control:c,checked:d,bubbles:e=!0,...f},g)=>{let h=q.useRef(null),i=(0,Q.useComposedRefs)(h,g),j=(0,T.usePrevious)(d),k=(0,U.useSize)(c);return q.useEffect(()=>{let a=h.current;if(!a)return;let b=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(j!==d&&b){let c=new Event("click",{bubbles:e});b.call(a,d),a.dispatchEvent(c)}},[j,d,e]),(0,b.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:d,...f,tabIndex:-1,ref:i,style:{...f.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function af(a){return a?"checked":"unchecked"}ae.displayName="SwitchBubbleInput";var ag=a.i(68114);let ah=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)(ab,{className:(0,ag.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",a),...c,ref:d,children:(0,b.jsx)(ad,{className:(0,ag.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")})}));ah.displayName=ab.displayName;let ai=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("div",{className:"relative w-full overflow-auto",children:(0,b.jsx)("table",{ref:d,className:(0,ag.cn)("w-full caption-bottom text-sm",a),...c})}));ai.displayName="Table";let aj=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("thead",{ref:d,className:(0,ag.cn)("[&_tr]:border-b",a),...c}));aj.displayName="TableHeader";let ak=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tbody",{ref:d,className:(0,ag.cn)("[&_tr:last-child]:border-0",a),...c}));ak.displayName="TableBody",q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tfoot",{ref:d,className:(0,ag.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...c})).displayName="TableFooter";let al=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tr",{ref:d,className:(0,ag.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...c}));al.displayName="TableRow";let am=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("th",{ref:d,className:(0,ag.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",a),...c}));am.displayName="TableHead";let an=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("td",{ref:d,className:(0,ag.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",a),...c}));an.displayName="TableCell",q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("caption",{ref:d,className:(0,ag.cn)("mt-4 text-sm text-muted-foreground",a),...c})).displayName="TableCaption";let ao=(0,l.default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ap=a.i(16201),aq=a.i(91938),ar=a.i(10302);function as(){let{timeZone:a}=(0,e.useTimeZone)(),{data:f}=(0,d.useSession)(),{t:g,language:h}=(0,c.useLanguage)(),[i,j]=(0,q.useState)([]),[k,l]=(0,q.useState)(!0),[m,n]=(0,q.useState)(!0),[o,p]=(0,q.useState)(!1);(0,q.useEffect)(()=>{v(),s()},[]);let s=async()=>{try{let a=await aq.apiClient.get("/api/settings");n(!1!==a.allowRegistration)}catch(a){console.error("Failed to fetch config",a)}},t=async a=>{p(!0);try{await aq.apiClient.post("/api/settings",{allowRegistration:a}),n(a)}catch(a){console.error("Failed to update registration setting",a),ar.toast.error(g.common.error)}finally{p(!1)}},v=async()=>{l(!0);try{let a=await aq.apiClient.get("/api/admin/users");j(a)}catch(a){console.error("Failed to fetch users",a)}finally{l(!1)}},w=async a=>{let b=a.isActive?g.admin.confirmDisable:g.admin.confirmEnable;if(await (0,ar.confirmDialog)(b))try{await aq.apiClient.patch(`/api/admin/users/${a.id}`,{isActive:!a.isActive}),v()}catch(a){console.error("Failed to update user status",a),ar.toast.error(g.common.error)}},x=async a=>{if(await (0,ar.confirmDialog)(g.admin.confirmDelete,{destructive:!0}))try{await aq.apiClient.delete(`/api/admin/users/${a.id}`),v()}catch(b){console.error("Failed to delete user",b);let a=b.data?.message||g.common.error;ar.toast.error(a)}};return k?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(z.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(u.Label,{className:"text-base",children:g.admin?.allowRegistration||"Allow New Registrations"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g.admin?.allowRegistrationDesc||"When disabled, new users cannot register"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[o&&(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}),(0,b.jsx)(ah,{checked:m,onCheckedChange:t,disabled:o})]})]}),(0,b.jsx)("div",{className:"sm:hidden space-y-3",children:i.map(c=>(0,b.jsxs)("div",{className:"border rounded-lg p-4 bg-card space-y-3",children:[(0,b.jsxs)("div",{className:"flex justify-between items-start",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"font-medium",children:c.name||"N/A"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:c.email})]}),(0,b.jsx)(O.Badge,{variant:"admin"===c.role?"default":"secondary",children:"admin"===c.role?g.admin.admin:g.admin.user})]}),(0,b.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,b.jsxs)("div",{className:"text-muted-foreground",children:[g.admin.errors,": ",c._count.errorItems," | ",g.admin.practiceCount,": ",c._count.practiceRecords]}),(0,b.jsx)(O.Badge,{variant:c.isActive?"default":"destructive",className:"text-xs",children:c.isActive?g.admin.active:g.admin.disabled})]}),(0,b.jsxs)("div",{className:"flex justify-between items-center pt-2 border-t",children:[(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,N.formatDateTime)(c.createdAt,"yyyy-MM-dd",a)}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>w(c),disabled:c.id===(f?.user).id,children:c.isActive?(0,b.jsx)(ao,{className:"h-4 w-4 text-orange-500"}):(0,b.jsx)(ap.CheckCircle,{className:"h-4 w-4 text-green-500"})}),(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>x(c),disabled:c.id===(f?.user).id,children:(0,b.jsx)(y.Trash2,{className:"h-4 w-4 text-destructive"})})]})]})]},c.id))}),(0,b.jsx)("div",{className:"hidden sm:block border rounded-lg overflow-hidden",children:(0,b.jsxs)(ai,{children:[(0,b.jsx)(aj,{children:(0,b.jsxs)(al,{children:[(0,b.jsx)(am,{children:g.admin.nameEmail}),(0,b.jsx)(am,{children:g.admin.role}),(0,b.jsx)(am,{children:g.admin.stats}),(0,b.jsx)(am,{children:g.admin.createdAt}),(0,b.jsx)(am,{children:g.admin.status}),(0,b.jsx)(am,{className:"text-right",children:g.admin.actions})]})}),(0,b.jsx)(ak,{children:i.map(c=>(0,b.jsxs)(al,{children:[(0,b.jsxs)(an,{children:[(0,b.jsx)("div",{className:"font-medium",children:c.name||"N/A"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:c.email})]}),(0,b.jsx)(an,{children:(0,b.jsx)(O.Badge,{variant:"admin"===c.role?"default":"secondary",children:"admin"===c.role?g.admin.admin:g.admin.user})}),(0,b.jsxs)(an,{children:[(0,b.jsxs)("div",{className:"text-sm",children:[g.admin.errors,": ",c._count.errorItems]}),(0,b.jsxs)("div",{className:"text-sm",children:[g.admin.practiceCount,": ",c._count.practiceRecords]})]}),(0,b.jsx)(an,{children:(0,N.formatDateTime)(c.createdAt,"yyyy-MM-dd",a)}),(0,b.jsx)(an,{children:(0,b.jsx)(O.Badge,{variant:c.isActive?"default":"destructive",children:c.isActive?g.admin.active:g.admin.disabled})}),(0,b.jsxs)(an,{className:"text-right space-x-2",children:[(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>w(c),disabled:c.id===(f?.user).id,title:c.isActive?g.admin.disable:g.admin.enable,children:c.isActive?(0,b.jsx)(ao,{className:"h-4 w-4 text-orange-500"}):(0,b.jsx)(ap.CheckCircle,{className:"h-4 w-4 text-green-500"})}),(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>x(c),disabled:c.id===(f?.user).id,title:g.admin.delete,children:(0,b.jsx)(y.Trash2,{className:"h-4 w-4 text-destructive"})})]})]},c.id))})]})})]})}var at=a.i(30534);function au({provider:a,apiKey:d,baseUrl:e,currentModel:f,onModelChange:g}){let{t:h}=(0,c.useLanguage)(),[i,j]=(0,q.useState)([]),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)(null),[o,p]=(0,q.useState)(f||""),[s,w]=(0,q.useState)(!1);(0,q.useEffect)(()=>{p(f||"")},[f]);let x=async()=>{if(!d)return void n(h.modelSelector?.enterApiKeyFirst||"Please enter API Key first");l(!0),n(null);try{let b=await aq.apiClient.post("/api/ai/models",{provider:a,apiKey:d,...e&&{baseUrl:e}});if("error"in b&&"string"==typeof b.error){n(b.error),w(!0),j([]);return}j(b.models),0===b.models.length&&(n(h.modelSelector?.noVisionModel||"No vision model found, please enter manually"),w(!0))}catch(a){console.error("Failed to fetch models:",a),n((a?.message||h.modelSelector?.fetchFailed||"Failed to fetch models")+(h.modelSelector?.enterManually||", please enter manually")),w(!0)}finally{l(!1)}};return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(u.Label,{className:"flex-1",children:h.modelSelector?.modelName||"Model Name"}),(0,b.jsx)(r.Button,{type:"button",variant:"outline",size:"sm",onClick:x,disabled:k||!d,children:k?(0,b.jsx)(z.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(G.RefreshCw,{className:"h-3 w-3"})})]}),m&&(0,b.jsx)("p",{className:"text-xs text-yellow-600",children:m}),s||0===i.length?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(t.Input,{value:o,onChange:a=>{var b;p(b=a.target.value),g(b)},placeholder:"openai"===a?"gpt-4o":"gemini-1.5-flash"}),i.length>0&&(0,b.jsx)(r.Button,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>w(!1),children:h.modelSelector?.selectFromList||"Select from List"})]}):(0,b.jsx)("div",{className:"space-y-2",children:(0,b.jsxs)(v.Select,{value:f,onValueChange:a=>{"_custom"===a?w(!0):(w(!1),p(a),g(a))},children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{placeholder:h.modelSelector?.selectModel||"Select Model"})}),(0,b.jsxs)(v.SelectContent,{children:[i.map(a=>(0,b.jsxs)(v.SelectItem,{value:a.id,children:[a.name,a.owned_by&&` (${a.owned_by})`]},a.id)),(0,b.jsx)(v.SelectItem,{value:"_custom",children:h.modelSelector?.customInput||"Custom Input..."})]})]})})]})}var av=a.i(29246);let aw=`请参考《高思学校竞赛数学导引》(每讲分兴趣篇、拓展篇、超越篇,题目左侧标 1~5 颗星)的星级标准,结合题目所在年级评定难度:
|
|
1
|
+
module.exports=[18175,a=>{"use strict";var b=a.i(87924),c=a.i(50194),d=a.i(75003),e=a.i(29759),f=a.i(71987),g=a.i(38246),h=a.i(50944),i=a.i(39761),j=a.i(53722),k=a.i(4720),l=a.i(70106);let m=(0,l.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"}]]),n=(0,l.default)("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),o=(0,l.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"}]]),p=(0,l.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 q=a.i(72131),r=a.i(99570),s=a.i(14574),t=a.i(66718),u=a.i(70430),v=a.i(80701),w=a.i(75083);let x=(0,l.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 y=a.i(81560),z=a.i(96221);let A=(0,l.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 B=a.i(77156),C=a.i(41379),D=a.i(33836),E=a.i(46842);let F=(0,l.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 G=a.i(69520),H=a.i(15618);let I=(0,l.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"}]]),J=(0,l.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var K=a.i(62722),L=a.i(84505);let M=(0,l.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 N=a.i(86705),O=a.i(86304),P=a.i(7554),Q=a.i(70121),R=a.i(50104),S=a.i(25152),T=a.i(77994),U=a.i(3688);a.i(35112);var V=Symbol("radix.slottable");function W(a){return q.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===V}var X=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((a,c)=>{var d,e;let f,g,h,i=(e=d=`Primitive.${c}`,(f=q.forwardRef((a,b)=>{let{children:c,...d}=a;if(q.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==q.Fragment&&(h.ref=b?(0,Q.composeRefs)(b,g):g),q.cloneElement(c,h)}return q.Children.count(c)>1?q.Children.only(null):null})).displayName=`${e}.SlotClone`,g=f,(h=q.forwardRef((a,c)=>{let{children:d,...e}=a,f=q.Children.toArray(d),h=f.find(W);if(h){let a=h.props.children,d=f.map(b=>b!==h?b:q.Children.count(a)>1?q.Children.only(null):q.isValidElement(a)?a.props.children:null);return(0,b.jsx)(g,{...e,ref:c,children:q.isValidElement(a)?q.cloneElement(a,void 0,d):null})}return(0,b.jsx)(g,{...e,ref:c,children:d})})).displayName=`${d}.Slot`,h),j=q.forwardRef((a,d)=>{let{asChild:e,...f}=a;return(0,b.jsx)(e?i:c,{...f,ref:d})});return j.displayName=`Primitive.${c}`,{...a,[c]:j}},{}),Y="Switch",[Z,$]=(0,R.createContextScope)(Y),[_,aa]=Z(Y),ab=q.forwardRef((a,c)=>{let{__scopeSwitch:d,name:e,checked:f,defaultChecked:g,required:h,disabled:i,value:j="on",onCheckedChange:k,form:l,...m}=a,[n,o]=q.useState(null),p=(0,Q.useComposedRefs)(c,a=>o(a)),r=q.useRef(!1),s=!n||l||!!n.closest("form"),[t,u]=(0,S.useControllableState)({prop:f,defaultProp:g??!1,onChange:k,caller:Y});return(0,b.jsxs)(_,{scope:d,checked:t,disabled:i,children:[(0,b.jsx)(X.button,{type:"button",role:"switch","aria-checked":t,"aria-required":h,"data-state":af(t),"data-disabled":i?"":void 0,disabled:i,value:j,...m,ref:p,onClick:(0,P.composeEventHandlers)(a.onClick,a=>{u(a=>!a),s&&(r.current=a.isPropagationStopped(),r.current||a.stopPropagation())})}),s&&(0,b.jsx)(ae,{control:n,bubbles:!r.current,name:e,value:j,checked:t,required:h,disabled:i,form:l,style:{transform:"translateX(-100%)"}})]})});ab.displayName=Y;var ac="SwitchThumb",ad=q.forwardRef((a,c)=>{let{__scopeSwitch:d,...e}=a,f=aa(ac,d);return(0,b.jsx)(X.span,{"data-state":af(f.checked),"data-disabled":f.disabled?"":void 0,...e,ref:c})});ad.displayName=ac;var ae=q.forwardRef(({__scopeSwitch:a,control:c,checked:d,bubbles:e=!0,...f},g)=>{let h=q.useRef(null),i=(0,Q.useComposedRefs)(h,g),j=(0,T.usePrevious)(d),k=(0,U.useSize)(c);return q.useEffect(()=>{let a=h.current;if(!a)return;let b=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(j!==d&&b){let c=new Event("click",{bubbles:e});b.call(a,d),a.dispatchEvent(c)}},[j,d,e]),(0,b.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:d,...f,tabIndex:-1,ref:i,style:{...f.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function af(a){return a?"checked":"unchecked"}ae.displayName="SwitchBubbleInput";var ag=a.i(68114);let ah=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)(ab,{className:(0,ag.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",a),...c,ref:d,children:(0,b.jsx)(ad,{className:(0,ag.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")})}));ah.displayName=ab.displayName;let ai=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("div",{className:"relative w-full overflow-auto",children:(0,b.jsx)("table",{ref:d,className:(0,ag.cn)("w-full caption-bottom text-sm",a),...c})}));ai.displayName="Table";let aj=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("thead",{ref:d,className:(0,ag.cn)("[&_tr]:border-b",a),...c}));aj.displayName="TableHeader";let ak=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tbody",{ref:d,className:(0,ag.cn)("[&_tr:last-child]:border-0",a),...c}));ak.displayName="TableBody",q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tfoot",{ref:d,className:(0,ag.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...c})).displayName="TableFooter";let al=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("tr",{ref:d,className:(0,ag.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...c}));al.displayName="TableRow";let am=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("th",{ref:d,className:(0,ag.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",a),...c}));am.displayName="TableHead";let an=q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("td",{ref:d,className:(0,ag.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",a),...c}));an.displayName="TableCell",q.forwardRef(({className:a,...c},d)=>(0,b.jsx)("caption",{ref:d,className:(0,ag.cn)("mt-4 text-sm text-muted-foreground",a),...c})).displayName="TableCaption";let ao=(0,l.default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ap=a.i(16201),aq=a.i(91938),ar=a.i(10302);function as(){let{timeZone:a}=(0,e.useTimeZone)(),{data:f}=(0,d.useSession)(),{t:g,language:h}=(0,c.useLanguage)(),[i,j]=(0,q.useState)([]),[k,l]=(0,q.useState)(!0),[m,n]=(0,q.useState)(!0),[o,p]=(0,q.useState)(!1);(0,q.useEffect)(()=>{v(),s()},[]);let s=async()=>{try{let a=await aq.apiClient.get("/api/settings");n(!1!==a.allowRegistration)}catch(a){console.error("Failed to fetch config",a)}},t=async a=>{p(!0);try{await aq.apiClient.post("/api/settings",{allowRegistration:a}),n(a)}catch(a){console.error("Failed to update registration setting",a),ar.toast.error(g.common.error)}finally{p(!1)}},v=async()=>{l(!0);try{let a=await aq.apiClient.get("/api/admin/users");j(a)}catch(a){console.error("Failed to fetch users",a)}finally{l(!1)}},w=async a=>{let b=a.isActive?g.admin.confirmDisable:g.admin.confirmEnable;if(await (0,ar.confirmDialog)(b))try{await aq.apiClient.patch(`/api/admin/users/${a.id}`,{isActive:!a.isActive}),v()}catch(a){console.error("Failed to update user status",a),ar.toast.error(g.common.error)}},x=async a=>{if(await (0,ar.confirmDialog)(g.admin.confirmDelete,{destructive:!0}))try{await aq.apiClient.delete(`/api/admin/users/${a.id}`),v()}catch(b){console.error("Failed to delete user",b);let a=b.data?.message||g.common.error;ar.toast.error(a)}};return k?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(z.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between p-4 border rounded-lg bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)(u.Label,{className:"text-base",children:g.admin?.allowRegistration||"Allow New Registrations"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:g.admin?.allowRegistrationDesc||"When disabled, new users cannot register"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[o&&(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}),(0,b.jsx)(ah,{checked:m,onCheckedChange:t,disabled:o})]})]}),(0,b.jsx)("div",{className:"sm:hidden space-y-3",children:i.map(c=>(0,b.jsxs)("div",{className:"border rounded-lg p-4 bg-card space-y-3",children:[(0,b.jsxs)("div",{className:"flex justify-between items-start",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"font-medium",children:c.name||"N/A"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:c.email})]}),(0,b.jsx)(O.Badge,{variant:"admin"===c.role?"default":"secondary",children:"admin"===c.role?g.admin.admin:g.admin.user})]}),(0,b.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,b.jsxs)("div",{className:"text-muted-foreground",children:[g.admin.errors,": ",c._count.errorItems," | ",g.admin.practiceCount,": ",c._count.practiceRecords]}),(0,b.jsx)(O.Badge,{variant:c.isActive?"default":"destructive",className:"text-xs",children:c.isActive?g.admin.active:g.admin.disabled})]}),(0,b.jsxs)("div",{className:"flex justify-between items-center pt-2 border-t",children:[(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,N.formatDateTime)(c.createdAt,"yyyy-MM-dd",a)}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>w(c),disabled:c.id===(f?.user).id,children:c.isActive?(0,b.jsx)(ao,{className:"h-4 w-4 text-orange-500"}):(0,b.jsx)(ap.CheckCircle,{className:"h-4 w-4 text-green-500"})}),(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>x(c),disabled:c.id===(f?.user).id,children:(0,b.jsx)(y.Trash2,{className:"h-4 w-4 text-destructive"})})]})]})]},c.id))}),(0,b.jsx)("div",{className:"hidden sm:block border rounded-lg overflow-hidden",children:(0,b.jsxs)(ai,{children:[(0,b.jsx)(aj,{children:(0,b.jsxs)(al,{children:[(0,b.jsx)(am,{children:g.admin.nameEmail}),(0,b.jsx)(am,{children:g.admin.role}),(0,b.jsx)(am,{children:g.admin.stats}),(0,b.jsx)(am,{children:g.admin.createdAt}),(0,b.jsx)(am,{children:g.admin.status}),(0,b.jsx)(am,{className:"text-right",children:g.admin.actions})]})}),(0,b.jsx)(ak,{children:i.map(c=>(0,b.jsxs)(al,{children:[(0,b.jsxs)(an,{children:[(0,b.jsx)("div",{className:"font-medium",children:c.name||"N/A"}),(0,b.jsx)("div",{className:"text-sm text-muted-foreground",children:c.email})]}),(0,b.jsx)(an,{children:(0,b.jsx)(O.Badge,{variant:"admin"===c.role?"default":"secondary",children:"admin"===c.role?g.admin.admin:g.admin.user})}),(0,b.jsxs)(an,{children:[(0,b.jsxs)("div",{className:"text-sm",children:[g.admin.errors,": ",c._count.errorItems]}),(0,b.jsxs)("div",{className:"text-sm",children:[g.admin.practiceCount,": ",c._count.practiceRecords]})]}),(0,b.jsx)(an,{children:(0,N.formatDateTime)(c.createdAt,"yyyy-MM-dd",a)}),(0,b.jsx)(an,{children:(0,b.jsx)(O.Badge,{variant:c.isActive?"default":"destructive",children:c.isActive?g.admin.active:g.admin.disabled})}),(0,b.jsxs)(an,{className:"text-right space-x-2",children:[(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>w(c),disabled:c.id===(f?.user).id,title:c.isActive?g.admin.disable:g.admin.enable,children:c.isActive?(0,b.jsx)(ao,{className:"h-4 w-4 text-orange-500"}):(0,b.jsx)(ap.CheckCircle,{className:"h-4 w-4 text-green-500"})}),(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>x(c),disabled:c.id===(f?.user).id,title:g.admin.delete,children:(0,b.jsx)(y.Trash2,{className:"h-4 w-4 text-destructive"})})]})]},c.id))})]})})]})}var at=a.i(30534);let au={minimax:{name:"MiniMax",baseUrl:"https://api.minimax.cn/v1",model:"MiniMax-M3.1-Flash",envPrefix:"MINIMAX",consoleUrl:"https://platform.minimax.cn"},glm:{name:"智谱 GLM",baseUrl:"https://open.bigmodel.cn/api/paas/v4",model:"glm-5.3-flash",envPrefix:"GLM",consoleUrl:"https://open.bigmodel.cn"},deepseek:{name:"DeepSeek",baseUrl:"https://api.deepseek.com",model:"deepseek-flash",envPrefix:"DEEPSEEK",consoleUrl:"https://platform.deepseek.com"},kimi:{name:"Kimi",baseUrl:"https://api.moonshot.cn/v1",model:"kimi-k3",envPrefix:"KIMI",consoleUrl:"https://platform.kimi.com"}},av=Object.keys(au);function aw(a){return"string"==typeof a&&Object.prototype.hasOwnProperty.call(au,a)}function ax({provider:a,apiKey:d,baseUrl:e,currentModel:f,onModelChange:g}){let{t:h}=(0,c.useLanguage)(),[i,j]=(0,q.useState)([]),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)(null),[o,p]=(0,q.useState)(f||""),[s,w]=(0,q.useState)(!1);(0,q.useEffect)(()=>{p(f||"")},[f]);let x=async()=>{if(!d)return void n(h.modelSelector?.enterApiKeyFirst||"Please enter API Key first");l(!0),n(null);try{let b=await aq.apiClient.post("/api/ai/models",{provider:a,apiKey:d,...e&&{baseUrl:e}});if("error"in b&&"string"==typeof b.error){n(b.error),w(!0),j([]);return}j(b.models),0===b.models.length&&(n(h.modelSelector?.noVisionModel||"No vision model found, please enter manually"),w(!0))}catch(a){console.error("Failed to fetch models:",a),n((a?.message||h.modelSelector?.fetchFailed||"Failed to fetch models")+(h.modelSelector?.enterManually||", please enter manually")),w(!0)}finally{l(!1)}};return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(u.Label,{className:"flex-1",children:h.modelSelector?.modelName||"Model Name"}),(0,b.jsx)(r.Button,{type:"button",variant:"outline",size:"sm",onClick:x,disabled:k||!d,children:k?(0,b.jsx)(z.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(G.RefreshCw,{className:"h-3 w-3"})})]}),m&&(0,b.jsx)("p",{className:"text-xs text-yellow-600",children:m}),s||0===i.length?(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(t.Input,{value:o,onChange:a=>{var b;p(b=a.target.value),g(b)},placeholder:aw(a)?au[a].model:"openai"===a?"gpt-6.1-sol":"gemini-1.5-flash"}),i.length>0&&(0,b.jsx)(r.Button,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-xs",onClick:()=>w(!1),children:h.modelSelector?.selectFromList||"Select from List"})]}):(0,b.jsx)("div",{className:"space-y-2",children:(0,b.jsxs)(v.Select,{value:f,onValueChange:a=>{"_custom"===a?w(!0):(w(!1),p(a),g(a))},children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{placeholder:h.modelSelector?.selectModel||"Select Model"})}),(0,b.jsxs)(v.SelectContent,{children:[i.map(a=>(0,b.jsxs)(v.SelectItem,{value:a.id,children:[a.name,a.owned_by&&` (${a.owned_by})`]},a.id)),(0,b.jsx)(v.SelectItem,{value:"_custom",children:h.modelSelector?.customInput||"Custom Input..."})]})]})})]})}var ay=a.i(29246);let az=`请参考《高思学校竞赛数学导引》(每讲分兴趣篇、拓展篇、超越篇,题目左侧标 1~5 颗星)的星级标准,结合题目所在年级评定难度:
|
|
2
2
|
- 1 星:课本基础题,直接套用概念、公式或简单计算即可(相当于兴趣篇前几题)。
|
|
3
3
|
- 2 星:校内拔高题,需要两三步推理或简单综合(相当于兴趣篇后几题)。
|
|
4
4
|
- 3 星:常规奥数题,小升初、杯赛常见难度,需要掌握该专题的典型方法(相当于拓展篇)。
|
|
5
5
|
- 4 星:较难奥数题,需要构造、分类讨论、转化或多种方法综合(相当于拓展篇末题、超越篇前几题)。
|
|
6
6
|
- 5 星:竞赛压轴题,集训队水平,思路巧妙、步骤长(相当于超越篇难题)。
|
|
7
|
-
非数学学科按同样的 1~5 级划分:1 星为基础识记,3 星为综合应用,5 星为竞赛或压轴难度。`,
|
|
7
|
+
非数学学科按同样的 1~5 级划分:1 星为基础识记,3 星为综合应用,5 星为竞赛或压轴难度。`,aA=`- 输出一个完整的 <svg> 元素,包含 xmlns="http://www.w3.org/2000/svg" 和 viewBox(建议宽 400~600),不要用 Markdown 代码块包裹。
|
|
8
8
|
- 白色背景、黑色线条(stroke="#000",线宽 1.5~2),需要区分的区域可用浅灰填充;不要使用彩色装饰。
|
|
9
9
|
- 按原图比例和相对位置绘制,保留所有标注:顶点字母、数字、长度、角度、单位、箭头和虚线等,文字用 <text>(font-size 14~18)。
|
|
10
10
|
- 只使用基本图形元素:line、polyline、polygon、rect、circle、ellipse、path、text、g、defs、marker。
|
|
11
|
-
- 严禁使用 <image>、<script>、<foreignObject>、外部链接、外部字体或事件属性。`,
|
|
11
|
+
- 严禁使用 <image>、<script>、<foreignObject>、外部链接、外部字体或事件属性。`,aB=String.raw`- 行内公式用 $...$,独立公式用 $$...$$;不要用 \(...\) 或 \[...\],每个 $ 必须成对出现。
|
|
12
12
|
- 所有 LaTeX 命令(如 \frac、\sqrt、\times、\angle)都必须写在 $...$ 内,公式外不能出现反斜杠命令。
|
|
13
13
|
- 只使用 KaTeX 支持的命令和环境:方程组用 \begin{cases}...\end{cases},多行推导用 \begin{aligned}...\end{aligned}(放在 $$...$$ 中),不要用 align、eqnarray、\newcommand、\usepackage、\label、\tag 等。
|
|
14
14
|
- 大括号 {} 必须成对,\left 与 \right 必须成对,\begin{...} 与 \end{...} 必须对应。
|
|
15
15
|
- 公式中的中文写在 \text{...} 里,或放到公式外;百分号写成 \%,美元符号写成 \$。
|
|
16
|
-
- 反斜杠只写一个(\frac),不要写成 \\frac;换行符 \\ 只能用在 cases、aligned 等环境里。`,
|
|
16
|
+
- 反斜杠只写一个(\frac),不要写成 \\frac;换行符 \\ 只能用在 cases、aligned 等环境里。`,aC=`【角色与核心任务 (ROLE AND CORE TASK)】
|
|
17
17
|
你是一位世界顶尖的、经验丰富的、专业的跨学科考试分析专家(Interdisciplinary Exam Analysis Expert)。你的核心任务是极致准确地分析用户提供的考试题目图片,全面理解所有文本、图表和隐含约束,并提供一个完整、高度结构化且专业的解决方案。
|
|
18
18
|
|
|
19
19
|
{{language_instruction}}
|
|
@@ -41,7 +41,7 @@ module.exports=[18175,a=>{"use strict";var b=a.i(87924),c=a.i(50194),d=a.i(75003
|
|
|
41
41
|
|
|
42
42
|
<figure_svg>
|
|
43
43
|
如果 has_figure 为 true,用 SVG 重新绘制题目配图:
|
|
44
|
-
${
|
|
44
|
+
${aA}
|
|
45
45
|
如果 has_figure 为 false,请留空。
|
|
46
46
|
</figure_svg>
|
|
47
47
|
|
|
@@ -55,7 +55,7 @@ ${ax}
|
|
|
55
55
|
|
|
56
56
|
<difficulty_stars>
|
|
57
57
|
只填写 1 到 5 之间的一个整数,表示题目难度星级。
|
|
58
|
-
${
|
|
58
|
+
${az}
|
|
59
59
|
</difficulty_stars>
|
|
60
60
|
|
|
61
61
|
<mistake_analysis>
|
|
@@ -130,10 +130,10 @@ ${aw}
|
|
|
130
130
|
3. **内容完整**:如果包含子问题,请在 question_text 中完整列出。
|
|
131
131
|
4. **禁止图片**:严禁包含任何图片链接或 markdown 图片语法。
|
|
132
132
|
5. **LaTeX 规范**:
|
|
133
|
-
${
|
|
133
|
+
${aB}
|
|
134
134
|
|
|
135
135
|
{{grade_instruction}}
|
|
136
|
-
{{provider_hints}}`,
|
|
136
|
+
{{provider_hints}}`,aD=`你是一位资深的K12教育题目生成专家,具备跨学科的题目创作能力。你的核心任务是**根据以下原题和知识点,举一反三生成高质量教学题目**,帮助学生巩固知识并拓展解题思路。
|
|
137
137
|
### 角色定义
|
|
138
138
|
1. **学科全能专家**
|
|
139
139
|
- 精通K12阶段所有学科(数学/语文/英语/物理/化学/生物/历史/地理/政治)
|
|
@@ -185,9 +185,9 @@ ${ay}
|
|
|
185
185
|
###关键格式与内容约束 (CRITICAL RULES) !!!
|
|
186
186
|
1. **纯文本**:内容作为纯文本处理,**不要转义反斜杠**。
|
|
187
187
|
2. **LaTeX 规范**:
|
|
188
|
-
${
|
|
188
|
+
${aB}
|
|
189
189
|
|
|
190
190
|
{{grade_instruction}}
|
|
191
|
-
{{provider_hints}}`;var aB=a.i(87654);let aC=(0,l.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 aD({name:a,description:c}){return(0,b.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-2 text-xs py-1",children:[(0,b.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-primary shrink-0 w-fit",children:`{{${a}}}`}),(0,b.jsx)("span",{className:"text-muted-foreground",children:c})]})}function aE({config:a,onUpdate:d}){let{language:e,t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(""),[i,j]=(0,q.useState)("");(0,q.useEffect)(()=>{h(a.prompts?.analyze||az),j(a.prompts?.similar||aA)},[a.prompts]);let k=async a=>{if(!await (0,ar.confirmDialog)(f.settings?.prompts?.resetConfirm||"Are you sure you want to reset to default?",{destructive:!0}))return;let b="analyze"===a?az:aA;"analyze"===a?(h(b),d("analyze",b)):(j(b),d("similar",b))},l=(a,b)=>{"analyze"===a?(h(b),d("analyze",b)):(j(b),d("similar",b))},m=()=>(0,b.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,b.jsx)(A,{className:"h-5 w-5 shrink-0 text-amber-600"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"font-medium",children:f.settings?.prompts?.caution||"Modify with Caution"}),(0,b.jsx)("p",{className:"text-amber-800/90 text-xs",children:f.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,b.jsx)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:(0,b.jsxs)(w.Tabs,{defaultValue:"analyze",className:"w-full",children:[(0,b.jsxs)(w.TabsList,{className:"grid w-full grid-cols-2",children:[(0,b.jsx)(w.TabsTrigger,{value:"analyze",children:f.settings?.prompts?.analysisTab||"Analysis Prompt"}),(0,b.jsx)(w.TabsTrigger,{value:"similar",children:f.settings?.prompts?.similarTab||"Similar Question Prompt"})]}),(0,b.jsx)(w.TabsContent,{value:"analyze",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex justify-between items-center",children:[(0,b.jsx)(u.Label,{className:"text-base font-semibold",children:f.settings?.prompts?.customAnalysis||"Custom Analysis Template"}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>k("analyze"),children:[(0,b.jsx)(aB.RotateCcw,{className:"w-4 h-4 mr-2"}),f.settings?.prompts?.reset||"Reset Default"]})]}),(0,b.jsx)(m,{}),(0,b.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,b.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,b.jsx)(aC,{className:"h-3.5 w-3.5"}),f.settings?.prompts?.variables||"Available Variables"]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(aD,{name:"language_instruction",description:f.settings?.prompts?.vars?.languageInstruction||"Injects instructions based on target language (e.g., keep English questions in English but analysis in Chinese)."}),(0,b.jsx)(aD,{name:"knowledge_points_list",description:f.settings?.prompts?.vars?.knowledgePointsList||"Injects the standard list of knowledge point tags for the specific subject."}),(0,b.jsx)(aD,{name:"provider_hints",description:f.settings?.prompts?.vars?.providerHints||"System-injected hints (e.g., enforcing JSON format)."})]})]}),(0,b.jsx)(av.Textarea,{value:g,onChange:a=>l("analyze",a.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:az})]})}),(0,b.jsx)(w.TabsContent,{value:"similar",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex justify-between items-center",children:[(0,b.jsx)(u.Label,{className:"text-base font-semibold",children:f.settings?.prompts?.customSimilar||"Custom Similar Question Template"}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>k("similar"),children:[(0,b.jsx)(aB.RotateCcw,{className:"w-4 h-4 mr-2"}),f.settings?.prompts?.reset||"Reset Default"]})]}),(0,b.jsx)(m,{}),(0,b.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,b.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,b.jsx)(aC,{className:"h-3.5 w-3.5"}),f.settings?.prompts?.variables||"Available Variables"]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(aD,{name:"difficulty_level",description:f.settings?.prompts?.vars?.difficultyLevel||"Target difficulty level."}),(0,b.jsx)(aD,{name:"difficulty_instruction",description:f.settings?.prompts?.vars?.difficultyInstruction||"Specific writing instructions for the target difficulty."}),(0,b.jsx)(aD,{name:"original_question",description:f.settings?.prompts?.vars?.originalQuestion||"The full text of the original question."}),(0,b.jsx)(aD,{name:"knowledge_points",description:f.settings?.prompts?.vars?.knowledgePoints||"List of knowledge points to test."}),(0,b.jsx)(aD,{name:"language_instruction",description:f.settings?.prompts?.vars?.languageInstructionShort||"Language formatting instructions."})]})]}),(0,b.jsx)(av.Textarea,{value:i,onChange:a=>l("similar",a.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:aA})]})})]})})}function aF({field:a,label:d,description:e}){let{t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(!1),[i,j]=(0,q.useState)(!1),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)(null),o=`preference-${a}`;(0,q.useEffect)(()=>{aq.apiClient.get("/api/user").then(b=>h(!!b[a])).catch(()=>void 0).finally(()=>j(!0))},[a]);let p=async b=>{h(b),l(!0);try{await aq.apiClient.patch("/api/user",{[a]:b}),n(f.importFlow.preferenceSaved)}catch(c){h(!b),n(f.importFlow.preferenceSaveFailed),at.frontendLogger.error("[Settings]","Failed to save user preference",{field:a,error:c instanceof Error?c.message:String(c)})}finally{l(!1)}};return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsx)(u.Label,{htmlFor:o,children:d}),(0,b.jsx)(ah,{id:o,checked:g,onCheckedChange:p,disabled:!i||k})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e}),m&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:m})]})}function aG(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aF,{field:"confirmBeforeImport",label:a.importFlow.confirmBeforeImport,description:a.importFlow.confirmBeforeImportDesc})}function aH(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aF,{field:"enableGeogebra",label:a.importFlow.enableGeogebra,description:a.importFlow.enableGeogebraDesc})}function aI(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aF,{field:"enableSvgAnimation",label:a.importFlow.enableSvgAnimation,description:a.importFlow.enableSvgAnimationDesc})}function aJ({value:a,onChange:d}){let{t:e}=(0,c.useLanguage)(),[f,g]=(0,q.useState)(!1),h=(b,c)=>d({...a,[b]:c});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:f?"text":"password",value:a?.apiKey||"",onChange:a=>h("apiKey",a.target.value),placeholder:"sk-ant-...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>g(!f),"aria-label":f?"Hide API Key":"Show API Key",children:f?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:a?.baseUrl||"",onChange:a=>h("baseUrl",a.target.value),placeholder:"https://api.anthropic.com"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e.settings?.ai?.anthropicBaseUrlHint})]}),(0,b.jsx)(au,{provider:"anthropic",apiKey:a?.apiKey,baseUrl:a?.baseUrl,currentModel:a?.model,onModelChange:a=>h("model",a)})]})}var aK=a.i(42027);function aL({value:a,onChange:d,disabled:e}){let{t:f}=(0,c.useLanguage)();return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(u.Label,{htmlFor:"app-time-zone",children:f.settings.general.timeZoneLabel}),(0,b.jsx)(t.Input,{id:"app-time-zone",value:a,onChange:a=>d(a.target.value),disabled:e,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,b.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(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f.settings.general.timeZoneDesc})]})}let aM=(0,l.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"}]]),aN=(0,l.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"}]]),aO=(0,l.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"}]]),aP=(0,l.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 aQ(){let{timeZone:a,setTimeZone:f}=(0,e.useTimeZone)(),{data:g}=(0,d.useSession)(),j=g?.user?.role==="admin",{t:k,language:l,setLanguage:m}=(0,c.useLanguage)(),[n,p]=(0,q.useState)(!1),O=(0,q.useRef)(null),[P,Q]=(0,q.useState)(!1),[R,S]=(0,q.useState)(!1),[T,U]=(0,q.useState)(!1),[V,W]=(0,q.useState)(!1),[X,Y]=(0,q.useState)(!1),[Z,$]=(0,q.useState)(!1),[_,aa]=(0,q.useState)(""),[ab,ac]=(0,q.useState)(!1),[ad,ae]=(0,q.useState)({aiProvider:"gemini"}),[af,ag]=(0,q.useState)(void 0),[ah,ai]=(0,q.useState)(!1),[aj,ak]=(0,q.useState)(null),[al,am]=(0,q.useState)({name:"",email:"",educationStage:"",enrollmentYear:"",password:""}),[an,ao]=(0,q.useState)(""),[ap,av]=(0,q.useState)(!1),[aw,ax]=(0,q.useState)(!1),[ay,az]=(0,q.useState)(!1),[aA,aB]=(0,q.useState)(!1),[aD,aF]=(0,q.useState)(!1),[aQ,aR]=(0,q.useState)(!1),[aS,aT]=(0,q.useState)(null),[aU,aV]=(0,q.useState)(""),aW=(0,h.useRouter)();(0,q.useEffect)(()=>{n&&(aX(),aY()),fetch("/api/version").then(a=>a.json()).then(a=>aa(a.version)).catch(()=>{})},[n]);let aX=async()=>{$(!0);try{let a=await aq.apiClient.get("/api/settings");ae(a)}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to fetch settings",{error:a instanceof Error?a.message:String(a)})}finally{$(!1)}},aY=async()=>{av(!0);try{let a=await aq.apiClient.get("/api/user");am({name:a.name||"",email:a.email||"",educationStage:a.educationStage||"",enrollmentYear:a.enrollmentYear||"",password:""})}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to fetch profile",{error:a instanceof Error?a.message:String(a)})}finally{av(!1)}},aZ=async()=>{if(!(0,N.isValidTimeZone)(ad.timeZone??N.DEFAULT_TIME_ZONE))return void ar.toast.error(k.settings.general.invalidTimeZone);let a=(()=>{if("openai"!==ad.aiProvider)return null;for(let a of ad.openai?.instances||[]){if(!a.name?.trim())return k.settings?.ai?.validationNameRequired||"实例名称不能为空";if(!a.apiKey?.trim())return k.settings?.ai?.validationApiKeyRequired||"API Key 不能为空";if(!a.baseUrl?.trim())return k.settings?.ai?.validationBaseUrlRequired||"Base URL 不能为空";if(!a.model?.trim())return k.settings?.ai?.validationModelRequired||"模型名称不能为空"}return null})();if(a)return void ar.toast.error(a);let b="azure"!==ad.aiProvider?null:ad.azure?.endpoint?.trim()?ad.azure?.deploymentName?.trim()?ad.azure?.apiKey?.trim()?null:k.settings?.ai?.validationApiKeyRequired||"API Key is required":k.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required":k.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(b)return void ar.toast.error(b);Y(!0);try{let a=await aq.apiClient.post("/api/settings",ad);ae(a),f(a.timeZone||N.DEFAULT_TIME_ZONE),ar.toast.success(k.settings?.messages?.saved||"Settings saved"),O.current?.scrollTo({top:0,behavior:"smooth"})}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to save settings",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.messages?.saveFailed||"Failed to save")}finally{Y(!1)}},a$=async()=>{ax(!0);try{if(al.password&&al.password!==an){ar.toast.error(k.settings?.messages?.passwordMismatch||"Passwords do not match"),ax(!1);return}let a={name:al.name,email:al.email,educationStage:al.educationStage};al.enrollmentYear&&(a.enrollmentYear=parseInt(al.enrollmentYear.toString())),al.password&&(a.password=al.password),await aq.apiClient.patch("/api/user",a),ar.toast.success(k.settings?.messages?.profileUpdated||"Profile updated"),am(a=>({...a,password:""})),ao(""),az(!1),aB(!1),window.location.reload()}catch(b){at.frontendLogger.error("[SettingsDialog]","Failed to update profile",{error:b?.data?.message||b?.message||String(b)});let a=b.data?.message||k.settings?.messages?.updateFailed||"Update failed";ar.toast.error(a)}finally{ax(!1)}},a_=async()=>{if(await (0,ar.confirmDialog)(k.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})){Q(!0);try{await aq.apiClient.delete("/api/stats/practice/clear"),ar.toast.success(k.settings?.clearSuccess||"Success"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to clear practice data",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed")}finally{Q(!1)}}},a0=async()=>{if(await (0,ar.confirmDialog)(k.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})){S(!0);try{await aq.apiClient.delete("/api/error-items/clear"),ar.toast.success(k.settings?.clearSuccess||"Success"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to clear error data",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed")}finally{S(!1)}}},a1=async()=>{if(!await (0,ar.confirmDialog)(k.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let a=prompt(k.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==a){null!==a&&ar.toast.error(k.common?.error||"Confirmation failed");return}U(!0);try{await aq.apiClient.post("/api/admin/system-reset",{}),ar.toast.success(k.settings?.clearSuccess||"Success - System Reset Complete"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","System reset failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed to reset system")}finally{U(!1)}},a2=async()=>{aF(!0);try{let a=await fetch("/api/export");if(!a.ok)throw Error("Export failed");let b=await a.blob(),c=window.URL.createObjectURL(b),d=document.createElement("a");d.href=c;let e=a.headers.get("Content-Disposition"),f=e?.match(/filename="(.+)"/);d.download=f?f[1]:"wrong-notebook-export.json",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c),ar.toast.success(k.settings?.exportSuccess||"Export successful")}catch(a){at.frontendLogger.error("[SettingsDialog]","Export failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.exportFailed||"Export failed")}finally{aF(!1)}},a3=async()=>{if(await (0,ar.confirmDialog)(k.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){aF(!0);try{let a=await fetch("/api/export?all=true");if(!a.ok){let b=await a.json();throw Error(b.message||"Export failed")}let b=await a.blob(),c=window.URL.createObjectURL(b),d=document.createElement("a");d.href=c;let e=a.headers.get("Content-Disposition"),f=e?.match(/filename="(.+)"/);d.download=f?f[1]:"wrong-notebook-export-all.json",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c),ar.toast.success(k.settings?.exportSuccess||"Export successful")}catch(a){at.frontendLogger.error("[SettingsDialog]","Export all failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.exportFailed||"Export failed")}finally{aF(!1)}}},a4=async()=>{if(aS&&await (0,ar.confirmDialog)(k.settings?.importConfirm||"Are you sure you want to import?")){aR(!0);try{let a=await aS.text(),b=JSON.parse(a),c=(await aq.apiClient.post("/api/import",b)).stats;ar.toast.success((k.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records.").replace("{subjects}",String(c.subjectsCreated)).replace("{tags}",String(c.tagsCreated)).replace("{items}",String(c.errorItemsCreated)).replace("{schedules}",String(c.reviewSchedulesCreated)).replace("{records}",String(c.practiceRecordsCreated)).replace("{duplicates}",String(c.duplicateErrorItems??0))),aT(null),aV(""),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Import failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.importFailed||"Import failed")}finally{aR(!1)}}},a5=async()=>{if(aS&&await (0,ar.confirmDialog)(k.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.")){aR(!0);try{let a=await aS.text(),b=JSON.parse(a),c=await fetch("/api/import?all=true",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),d=await c.json();if(d.success){let a=d.stats;ar.toast.success((k.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records.").replace("{subjects}",String(a.subjectsCreated)).replace("{tags}",String(a.tagsCreated)).replace("{items}",String(a.errorItemsCreated)).replace("{schedules}",String(a.reviewSchedulesCreated)).replace("{records}",String(a.practiceRecordsCreated)).replace("{duplicates}",String(a.duplicateErrorItems??0))),aT(null),aV(""),window.location.reload()}else throw Error(d.message||"Import failed")}catch(a){at.frontendLogger.error("[SettingsDialog]","Import all failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.importFailed||"Import failed")}finally{aR(!1)}}},a6=async()=>{if(await (0,ar.confirmDialog)(k.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})){W(!0);try{let a=await aq.apiClient.post("/api/admin/migrate-tags",{});ar.toast.success(`${k.settings?.clearSuccess||"Success"}: ${a.count||0} tags migrated.`)}catch(a){at.frontendLogger.error("[SettingsDialog]","Tag migration failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed to migrate tags")}finally{W(!1)}}},a7=(a,b,c)=>{"gemini"===a&&ae(a=>({...a,gemini:{...a.gemini,[b]:c}}))},a8=()=>{let a=ad.openai?.instances||[],b=af||ad.openai?.activeInstanceId;return a.find(a=>a.id===b)},a9=(a,b)=>{let c=ad.openai?.instances||[],d=af||ad.openai?.activeInstanceId,e=c.map(c=>c.id===d?{...c,[a]:b}:c);ae(a=>({...a,openai:{...a.openai,instances:e}}))};(0,q.useEffect)(()=>{ad.openai?.activeInstanceId&&!af&&ag(ad.openai.activeInstanceId)},[ad.openai?.activeInstanceId,af]);let ba=async()=>{ai(!0),ak(null);try{let a;if("openai"===ad.aiProvider){let b=a8();if(!b?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"openai",apiKey:b.apiKey,baseUrl:b.baseUrl,model:b.model,language:l}}else if("gemini"===ad.aiProvider){if(!ad.gemini?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"gemini",apiKey:ad.gemini.apiKey,baseUrl:ad.gemini.baseUrl,model:ad.gemini.model,language:l}}else if("anthropic"===ad.aiProvider){if(!ad.anthropic?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"anthropic",apiKey:ad.anthropic.apiKey,baseUrl:ad.anthropic.baseUrl,model:ad.anthropic.model,language:l}}else{if("azure"!==ad.aiProvider)return void ai(!1);if(!ad.azure?.apiKey||!ad.azure?.endpoint||!ad.azure?.deploymentName){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete"}),ai(!1);return}a={provider:"azure",apiKey:ad.azure.apiKey,endpoint:ad.azure.endpoint,deploymentName:ad.azure.deploymentName,apiVersion:ad.azure.apiVersion,model:ad.azure.model,language:l}}let b=await aq.apiClient.post("/api/ai/test",a);ak(b)}catch(a){at.frontendLogger.error("[SettingsDialog]","AI connection test failed",{error:a instanceof Error?a.message:String(a)}),ak({success:!1,textSupport:!1,visionSupport:!1,textError:a instanceof Error?a.message:String(a)})}finally{ai(!1)}};return(0,b.jsxs)(s.Dialog,{open:n,onOpenChange:p,children:[(0,b.jsx)(s.DialogTrigger,{asChild:!0,children:(0,b.jsxs)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,b.jsx)(x,{className:"h-5 w-5"}),(0,b.jsx)("span",{className:"sr-only",children:k.settings?.title||"Settings"})]})}),(0,b.jsxs)(s.DialogContent,{ref:O,className:"w-[calc(100vw-2rem)] sm:max-w-[900px] max-h-[85vh] overflow-y-auto",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsx)(s.DialogTitle,{children:k.settings?.title||"Settings"}),(0,b.jsx)(s.DialogDescription,{children:k.settings?.desc||"Manage your preferences and data."})]}),(0,b.jsxs)(w.Tabs,{defaultValue:"general",className:"w-full",children:[(0,b.jsxs)(w.TabsList,{className:`grid w-full grid-cols-4 ${g?.user?.role==="admin"?"sm:grid-cols-7":"sm:grid-cols-4"} gap-1 h-auto`,children:[(0,b.jsxs)(w.TabsTrigger,{value:"general",className:"px-2 sm:px-3",children:[(0,b.jsx)(D.Languages,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.general||"General"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"account",className:"px-2 sm:px-3",children:[(0,b.jsx)(E.User,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.account||"Account"})]}),g?.user?.role==="admin"&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(w.TabsTrigger,{value:"ai",className:"px-2 sm:px-3",children:[(0,b.jsx)(F,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.ai||"AI Provider"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"prompts",className:"px-2 sm:px-3",children:[(0,b.jsx)(aM,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.prompts||"Prompts"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"admin",className:"px-2 sm:px-3",children:[(0,b.jsx)(o,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.admin||"User Management"})]})]}),(0,b.jsxs)(w.TabsTrigger,{value:"danger",className:"px-2 sm:px-3",children:[(0,b.jsx)(A,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.danger||"Danger"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"about",className:"px-2 sm:px-3",children:[(0,b.jsx)(aC,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.about||"About"})]})]}),(0,b.jsxs)(w.TabsContent,{value:"general",className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.language||"Language"}),(0,b.jsxs)(v.Select,{value:l,onValueChange:a=>m(a),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsxs)(v.SelectContent,{children:[(0,b.jsx)(v.SelectItem,{value:"zh",children:"中文 (Chinese)"}),(0,b.jsx)(v.SelectItem,{value:"en",children:"English"})]})]})]}),(0,b.jsx)(aL,{value:ad.timeZone??a,onChange:a=>ae(b=>({...b,timeZone:a})),disabled:!j||Z||X}),j&&(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(u.Label,{children:k.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,b.jsx)(t.Input,{type:"number",value:ad.timeouts?.analyze?ad.timeouts.analyze/1e3:"",onChange:a=>{let b=""===a.target.value?0:parseInt(a.target.value);ae(a=>({...a,timeouts:{...a.timeouts,analyze:isNaN(b)?0:1e3*b}}))},onBlur:()=>{let a=(ad.timeouts?.analyze||0)/1e3,b=a;b<120&&(b=120),b>600&&(b=600),b!==a&&ae(a=>({...a,timeouts:{...a.timeouts,analyze:1e3*b}}))},min:120,max:600}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:k.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,b.jsx)(aG,{}),(0,b.jsx)(aI,{}),(0,b.jsx)(aH,{}),(0,b.jsx)(aK.DuplicateThresholdSetting,{})]}),j&&(0,b.jsxs)(r.Button,{onClick:aZ,disabled:X,className:"w-full",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.save||"Save Settings"]})]}),(0,b.jsx)(w.TabsContent,{value:"account",className:"space-y-4 py-4",children:ap?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(z.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.name||"Name"}),(0,b.jsx)(t.Input,{value:al.name||"",onChange:a=>am({...al,name:a.target.value})})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.email||"Email"}),(0,b.jsx)(t.Input,{value:al.email||"",onChange:a=>am({...al,email:a.target.value}),type:"email"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.educationStage||"Education Stage"}),(0,b.jsxs)(v.Select,{value:al.educationStage||"",onValueChange:a=>am({...al,educationStage:a}),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{placeholder:k.auth?.selectStage||"Select Stage"})}),(0,b.jsxs)(v.SelectContent,{children:[(0,b.jsx)(v.SelectItem,{value:"primary",children:k.auth?.primary||"Primary School"}),(0,b.jsx)(v.SelectItem,{value:"junior_high",children:k.auth?.juniorHigh||"Junior High"}),(0,b.jsx)(v.SelectItem,{value:"senior_high",children:k.auth?.seniorHigh||"Senior High"}),(0,b.jsx)(v.SelectItem,{value:"university",children:k.auth?.university||"University"})]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.enrollmentYear||"Enrollment Year"}),(0,b.jsx)(t.Input,{type:"number",value:al.enrollmentYear||"",onChange:a=>am({...al,enrollmentYear:a.target.value}),placeholder:"YYYY"})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ay?"text":"password",value:al.password,onChange:a=>am({...al,password:a.target.value}),placeholder:"******",minLength:6,className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>az(!ay),tabIndex:-1,children:ay?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),al.password&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.confirmPassword||"Confirm Password"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:aA?"text":"password",value:an,onChange:a=>ao(a.target.value),placeholder:"******",minLength:6,className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>aB(!aA),tabIndex:-1,children:aA?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]})]}),(0,b.jsxs)(r.Button,{onClick:a$,disabled:aw,className:"w-full",children:[aw&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.account?.update||"Update Profile"]})]})}),(0,b.jsx)(w.TabsContent,{value:"ai",className:"space-y-4 py-4",children:Z?(0,b.jsx)("div",{className:"flex justify-center py-4",children:(0,b.jsx)(z.Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.tabs?.ai||"AI Provider"}),(0,b.jsxs)(v.Select,{value:ad.aiProvider,onValueChange:a=>ae(b=>({...b,aiProvider:a})),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsxs)(v.SelectContent,{children:[(0,b.jsx)(v.SelectItem,{value:"gemini",children:"Google Gemini"}),(0,b.jsx)(v.SelectItem,{value:"openai",children:"OpenAI / Compatible"}),(0,b.jsx)(v.SelectItem,{value:"azure",children:"Azure OpenAI"}),(0,b.jsx)(v.SelectItem,{value:"anthropic",children:"Anthropic / Compatible"})]})]})]}),"openai"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.instances||"Instance"}),(0,b.jsxs)(r.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>{let a=ad.openai?.instances||[];if(a.length>=10)return;let b={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let b=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)}),name:`Instance ${a.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-4o"};ae(a=>({...a,openai:{instances:[...a.openai?.instances||[],b],activeInstanceId:b.id}})),ag(b.id)},disabled:(ad.openai?.instances?.length||0)>=10,className:"h-7 px-2 text-xs",children:[(0,b.jsx)(H.Plus,{className:"h-3 w-3 mr-1"}),k.settings?.ai?.addInstance||"Add"]})]}),(ad.openai?.instances?.length||0)>0?(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(v.Select,{value:af||ad.openai?.activeInstanceId||"",onValueChange:a=>{ag(a),ae(b=>({...b,openai:{...b.openai,activeInstanceId:a}}))},children:[(0,b.jsx)(v.SelectTrigger,{className:"flex-1",children:(0,b.jsx)(v.SelectValue,{placeholder:k.settings?.ai?.selectInstance||"Select Instance"})}),(0,b.jsx)(v.SelectContent,{children:(ad.openai?.instances||[]).map(a=>(0,b.jsx)(v.SelectItem,{value:a.id,children:a.name},a.id))})]}),(ad.openai?.instances?.length||0)>1&&(0,b.jsx)(r.Button,{type:"button",variant:"outline",size:"icon",onClick:async()=>{let a,b,c=af||ad.openai?.activeInstanceId;c&&await (0,ar.confirmDialog)(k.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0})&&(b=(a=(ad.openai?.instances||[]).filter(a=>a.id!==c)).length>0?a[0].id:void 0,ae(c=>({...c,openai:{instances:a,activeInstanceId:b}})),ag(b))},className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:k.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),(ad.openai?.instances?.length||0)>=10&&(0,b.jsx)("p",{className:"text-xs text-amber-600",children:k.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),a8()&&(0,b.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.instanceName||"Instance Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:a8()?.name||"",onChange:a=>a9("name",a.target.value),placeholder:"e.g. 智谱 GLM-4V",className:a8()?.name?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:a8()?.apiKey||"",onChange:a=>a9("apiKey",a.target.value),placeholder:"sk-...",className:`pr-10 ${!a8()?.apiKey?.trim()?"border-destructive":""}`}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)(u.Label,{children:["Base URL ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:a8()?.baseUrl||"",onChange:a=>a9("baseUrl",a.target.value),placeholder:"https://api.openai.com/v1",className:a8()?.baseUrl?.trim()?"":"border-destructive"})]}),(0,b.jsx)(au,{provider:"openai",apiKey:a8()?.apiKey,baseUrl:a8()?.baseUrl,currentModel:a8()?.model,onModelChange:a=>a9("model",a)})]})]}),"gemini"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:ad.gemini?.apiKey||"",onChange:a=>a7("gemini","apiKey",a.target.value),placeholder:"AIza...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:ad.gemini?.baseUrl||"",onChange:a=>a7("gemini","baseUrl",a.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,b.jsx)(au,{provider:"gemini",apiKey:ad.gemini?.apiKey,baseUrl:ad.gemini?.baseUrl,currentModel:ad.gemini?.model,onModelChange:a=>a7("gemini","model",a)})]}),"anthropic"===ad.aiProvider&&(0,b.jsx)(aJ,{value:ad.anthropic,onChange:a=>ae(b=>({...b,anthropic:a}))}),"azure"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:ad.azure?.endpoint||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,endpoint:a.target.value}})),placeholder:k.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:ad.azure?.endpoint?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:ad.azure?.deploymentName||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,deploymentName:a.target.value}})),placeholder:k.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:ad.azure?.deploymentName?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:ad.azure?.apiKey||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,apiKey:a.target.value}})),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:`pr-10 ${!ad.azure?.apiKey?.trim()?"border-destructive":""}`}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.azureApiVersion||"API Version"}),(0,b.jsx)(t.Input,{value:ad.azure?.apiVersion||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,apiVersion:a.target.value}})),placeholder:k.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.azureModel||"Model Display Name"}),(0,b.jsx)(t.Input,{value:ad.azure?.model||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,model:a.target.value}})),placeholder:"gpt-4o"})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(r.Button,{type:"button",variant:"outline",onClick:ba,disabled:ah||X,className:"flex-1",children:[ah?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(I,{className:"mr-2 h-4 w-4"}),ah?k.settings?.ai?.testing||"测试中...":k.settings?.ai?.testConnection||"测试连接"]}),(0,b.jsxs)(r.Button,{onClick:aZ,disabled:X||ah,className:"flex-1",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.ai?.save||"Save AI Settings"]})]}),aj&&(0,b.jsxs)("div",{className:`p-3 rounded-md text-sm ${aj.success?"bg-green-50 border border-green-200":"bg-red-50 border border-red-200"}`,children:[(0,b.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:aj.success?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(J,{className:"h-4 w-4 text-green-600"}),(0,b.jsx)("span",{className:"text-green-700",children:k.settings?.ai?.testSuccess||"连接成功"}),aj.modelInfo&&(0,b.jsxs)("span",{className:"text-green-600 text-xs",children:["(",aj.modelInfo,")"]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(K.XCircle,{className:"h-4 w-4 text-red-600"}),(0,b.jsx)("span",{className:"text-red-700",children:k.settings?.ai?.testFailed||"连接失败"})]})}),aj.success&&(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[k.settings?.ai?.textSupport||"文本生成",":"]}),(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",k.settings?.ai?.supported||"支持"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[k.settings?.ai?.visionSupport||"图像识别/多模态",":"]}),aj.visionSupport?(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",k.settings?.ai?.supported||"支持"]}):(0,b.jsxs)("span",{className:"text-amber-600",children:["✗ ",aj.visionError?k.settings?.ai?.errors?.[aj.visionError]||aj.visionError.replace("UNKNOWN:",""):k.settings?.ai?.notSupported||"不支持"]})]}),(0,b.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:"* 由于网络问题,可能测试结果不准确"})]}),!aj.success&&aj.textError&&(0,b.jsx)("p",{className:"text-red-600 text-xs mt-1",children:k.settings?.ai?.errors?.[aj.textError]||aj.textError.replace("UNKNOWN:","")})]})]})]})}),(0,b.jsxs)(w.TabsContent,{value:"prompts",className:"space-y-4 py-4",children:[(0,b.jsx)(aE,{config:ad,onUpdate:(a,b)=>{ae(c=>({...c,prompts:{...c.prompts,[a]:b}}))}}),(0,b.jsxs)(r.Button,{onClick:aZ,disabled:X,className:"w-full",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.prompts?.save||"Save Prompt Settings"]})]}),g?.user?.role==="admin"&&(0,b.jsxs)(w.TabsContent,{value:"admin",className:"space-y-4 py-4",children:[(0,b.jsxs)(r.Button,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{p(!1),aW.push("/admin")},children:[(0,b.jsx)(i.BarChart3,{className:"h-4 w-4"}),k.admin?.dashboard?.title||"Admin Dashboard"]}),(0,b.jsx)("div",{className:"border-t pt-4",children:(0,b.jsx)(as,{})})]}),(0,b.jsx)(w.TabsContent,{value:"danger",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,b.jsx)("h4",{className:"text-sm font-bold text-blue-900 mb-3",children:k.settings?.dataManagement||"Data Management"}),(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:k.settings?.exportData||"Export Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a2,disabled:aD,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[aD?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(L.Download,{className:"mr-2 h-4 w-4"}),k.settings?.exportData||"Export"]}),g?.user?.role==="admin"&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a3,disabled:aD,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[aD?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(L.Download,{className:"mr-2 h-4 w-4"}),k.settings?.exportAllData||"Export All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:k.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:k.settings?.importData||"Import Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"file",accept:".json",onChange:a=>{let b=a.target.files?.[0];b&&(aT(b),aV(b.name))},className:"hidden",id:"import-file-input",disabled:aQ}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:aQ,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[aQ?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(M,{className:"mr-2 h-4 w-4"}),aU||k.settings?.selectFile||"Select File"]}),aS&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a4,disabled:aQ,className:"bg-green-100 hover:bg-green-200 text-green-900 border-green-300",children:[aQ?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(J,{className:"mr-2 h-4 w-4"}),k.settings?.importData||"Import"]}),aS&&g?.user?.role==="admin"&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a5,disabled:aQ,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[aQ?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(J,{className:"mr-2 h-4 w-4"}),k.settings?.importAllData||"Import All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:k.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]}),g?.user?.role==="admin"&&(0,b.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsxs)("span",{className:"text-sm text-blue-900 font-bold flex items-center gap-2",children:[(0,b.jsx)(G.RefreshCw,{className:"h-4 w-4"}),k.settings?.migrateTags||"Migrate Tags"]})}),(0,b.jsx)(r.Button,{variant:"outline",size:"sm",onClick:a6,disabled:V,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:V?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(G.RefreshCw,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-blue-800 mt-2 font-medium",children:k.settings?.migrateTagsDesc||"Re-populates standard tags from file"})]}),(0,b.jsxs)("div",{className:"p-4 border border-red-200 rounded-lg bg-red-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-sm text-red-700 font-medium",children:k.settings?.clearData||"Clear Practice Data"}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a_,disabled:P,children:P?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-600 mt-2",children:k.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible."})]}),(0,b.jsxs)("div",{className:"p-4 border border-red-200 rounded-lg bg-red-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-sm text-red-700 font-medium",children:k.settings?.clearErrorData||"Clear Error Data"}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a0,disabled:R,children:R?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-600 mt-2",children:k.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible."})]}),g?.user?.role==="admin"&&(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:"p-4 border border-red-600/50 rounded-lg bg-red-100/50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsxs)("span",{className:"text-sm text-red-900 font-bold flex items-center gap-2",children:[(0,b.jsx)(A,{className:"h-4 w-4"}),k.settings?.systemReset||"System Initialization"]})}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a1,disabled:T,className:"bg-red-700 hover:bg-red-800",children:T?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-800 mt-2 font-medium",children:k.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data."})]})})]})}),(0,b.jsx)(w.TabsContent,{value:"about",className:"space-y-4 py-4",children:(0,b.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,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("h3",{className:"text-2xl font-bold",children:k.app?.title||"Smart Error Notebook"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:k.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,b.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,b.jsx)(aC,{className:"h-4 w-4"}),(0,b.jsxs)("span",{children:[k.settings?.about?.version||"Version",": v",_||"unknown"]})]}),(0,b.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,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aO,{className:"h-4 w-4"}),k.settings?.about?.github||"GitHub Repository",(0,b.jsx)(aN,{className:"h-3 w-3 ml-1 opacity-50"})]})}),(0,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook/releases",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aP,{className:"h-4 w-4"}),k.settings?.about?.releaseNotes||"Release Notes",(0,b.jsx)(aN,{className:"h-3 w-3 ml-1 opacity-50"})]})}),(0,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook/issues",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aM,{className:"h-4 w-4"}),k.settings?.about?.feedback||"Feedback",(0,b.jsx)(aN,{className:"h-3 w-3 ml-1 opacity-50"})]})})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:k.settings?.about?.copyright||"© 2025 Wttwins. All rights reserved."})]})})]})]})]})}let aR=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/],aS=[{key:"home",href:"/",icon:n,match:a=>"/"===a},{key:"notebooks",href:"/notebooks",icon:j.BookOpen,match:a=>a.startsWith("/notebooks")||a.startsWith("/error-items")||a.startsWith("/practice")},{key:"tags",href:"/tags",icon:p,match:a=>a.startsWith("/tags")},{key:"stats",href:"/stats",icon:i.BarChart3,match:a=>a.startsWith("/stats")},{key:"exams",href:"/exams",icon:k.FileText,match:a=>a.startsWith("/exams")}];function aT({children:a}){let e=(0,h.usePathname)()||"/",{t:i}=(0,c.useLanguage)(),{data:j,status:k}=(0,d.useSession)();if(aR.some(a=>a.test(e))||"unauthenticated"===k)return(0,b.jsx)(b.Fragment,{children:a});let l=j?.user?.role==="admin",n=j?.user?.name||j?.user?.email||"";return(0,b.jsxs)("div",{className:"min-h-screen",children:[(0,b.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,b.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,b.jsxs)(g.default,{href:"/",className:"flex shrink-0 items-center gap-2",children:[(0,b.jsx)(f.default,{src:"/icons/icon.png",alt:"",width:32,height:32,className:"rounded-lg",priority:!0,unoptimized:!0}),(0,b.jsx)("span",{className:"text-base font-semibold tracking-tight",children:i.pageTitle.base})]}),(0,b.jsx)("nav",{className:"ml-4 hidden items-center gap-1 md:flex",children:aS.map(a=>{let c=a.match(e),d=a.icon;return(0,b.jsxs)(g.default,{href:a.href,className:(0,ag.cn)("flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors",c?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),"aria-current":c?"page":void 0,children:[(0,b.jsx)(d,{className:"h-4 w-4"}),i.nav[a.key]]},a.key)})}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[n&&(0,b.jsxs)("span",{className:"mr-2 hidden max-w-40 items-center gap-2 truncate text-sm text-muted-foreground lg:flex",children:[(0,b.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:n.slice(0,1).toUpperCase()}),(0,b.jsx)("span",{className:"truncate",children:n})]}),l&&(0,b.jsx)(g.default,{href:"/admin",title:i.nav.admin,children:(0,b.jsxs)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,b.jsx)(o,{className:"h-5 w-5"}),(0,b.jsx)("span",{className:"sr-only",children:i.nav.admin})]})}),(0,b.jsx)(aQ,{}),(0,b.jsx)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full text-muted-foreground hover:text-destructive",onClick:()=>(0,d.signOut)({callbackUrl:"/login"}),title:i.app.logout,children:(0,b.jsx)(m,{className:"h-5 w-5"})})]})]})}),(0,b.jsx)("div",{className:"pb-20 md:pb-0",children:a}),(0,b.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,b.jsx)("div",{className:"grid h-16 grid-cols-5",children:aS.map(a=>{let c=a.match(e),d=a.icon;return(0,b.jsxs)(g.default,{href:a.href,className:(0,ag.cn)("flex flex-col items-center justify-center gap-1 text-[11px] font-medium transition-colors",c?"text-primary":"text-muted-foreground"),"aria-current":c?"page":void 0,children:[(0,b.jsx)("span",{className:(0,ag.cn)("flex h-7 w-12 items-center justify-center rounded-full transition-colors",c&&"bg-accent"),children:(0,b.jsx)(d,{className:"h-5 w-5"})}),i.nav[a.key]]},a.key)})})})]})}let aU=(0,l.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"}]]),aV=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/];function aW(){let{t:a}=(0,c.useLanguage)(),{timeZone:f}=(0,e.useTimeZone)(),{status:i}=(0,d.useSession)(),j=(0,h.usePathname)(),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)([]),[o,p]=(0,q.useState)(()=>Date.now()),t="authenticated"!==i||aV.some(a=>a.test(j||"")),u=(0,q.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{let a=await aq.apiClient.get("/api/tasks");n(a.tasks),p(Date.now())}catch{}},[]);if((0,q.useEffect)(()=>{if(t)return;let a=setTimeout(u,0),b=setInterval(u,k?2e3:15e3);return()=>{clearTimeout(a),clearInterval(b)}},[t,k,u]),t)return null;let v=m.filter(a=>"running"===a.status).length,w=m.some(a=>"running"!==a.status),x=async()=>{try{let a=await aq.apiClient.delete("/api/tasks");n(a.tasks)}catch{}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(r.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:()=>l(!0),"aria-label":a.backgroundTasks.title,title:a.backgroundTasks.title,children:[v>0?(0,b.jsx)(z.Loader2,{className:"h-5 w-5 animate-spin"}):(0,b.jsx)(aU,{className:"h-5 w-5"}),v>0&&(0,b.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:v})]}),(0,b.jsx)(s.Dialog,{open:k,onOpenChange:l,children:(0,b.jsxs)(s.DialogContent,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsx)(s.DialogTitle,{children:a.backgroundTasks.title}),(0,b.jsx)(s.DialogDescription,{children:a.backgroundTasks.description})]}),0===m.length?(0,b.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a.backgroundTasks.empty}):(0,b.jsx)("ul",{className:"space-y-2",children:m.map(c=>{var d,e;let h;return(0,b.jsx)("li",{className:"rounded-md border p-3 text-sm",children:(0,b.jsxs)("div",{className:"flex items-start gap-2",children:["running"===c.status&&(0,b.jsx)(z.Loader2,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-primary"}),"succeeded"===c.status&&(0,b.jsx)(J,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),"failed"===c.status&&(0,b.jsx)(K.XCircle,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,b.jsxs)("div",{className:"font-medium",children:[a.backgroundTasks.kinds[c.kind],(0,b.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",a.backgroundTasks.status[c.status]]})]}),c.subject&&(0,b.jsx)("div",{className:"break-words text-muted-foreground",children:c.subject}),c.progress&&c.progress.total>0&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-muted",children:(0,b.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.round(c.progress.done/c.progress.total*100)}%`}})}),(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:[a.backgroundTasks.progress.replace("{done}",String(c.progress.done)).replace("{total}",String(c.progress.total)),c.progress.failed>0&&` \xb7 ${a.backgroundTasks.failedCount.replace("{count}",String(c.progress.failed))}`]})]}),c.error&&(0,b.jsx)("div",{className:"text-xs text-destructive",children:(b=>{if(!b)return null;let c=a.backgroundTasks.errors[b]??a.errors[b];return"string"==typeof c?c:b})(c.error)}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:a.backgroundTasks.startedAt.replace("{time}",(0,N.formatDateTime)(c.startedAt,"HH:mm:ss",f))}),(0,b.jsx)("span",{children:a.backgroundTasks.elapsed.replace("{time}",(d=c.startedAt,e=c.finishedAt,h=Math.max(0,Math.round(((e?Date.parse(e):o)-Date.parse(d))/1e3)),`${Math.floor(h/60)}:${String(h%60).padStart(2,"0")}`))}),c.link&&(0,b.jsx)(g.default,{href:c.link,className:"text-primary hover:underline",onClick:()=>l(!1),children:a.backgroundTasks.view})]})]})]})},c.id)})}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a.backgroundTasks.retentionHint}),w&&(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:x,children:a.backgroundTasks.clearFinished})]})]})})]})}var aX=a.i(33508);let aY={success:{icon:J,className:"text-success"},error:{icon:K.XCircle,className:"text-destructive"},warning:{icon:A,className:"text-warning"},info:{icon:aC,className:"text-primary"}};function aZ(){let{t:a}=(0,c.useLanguage)(),[d,e]=(0,q.useState)([]),[f,g]=(0,q.useState)(null);return(0,q.useEffect)(()=>(0,ar.subscribeFeedback)(a=>{e(a.toasts),g(a.confirm)}),[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.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:d.map(c=>{let{icon:d,className:e}=aY[c.type];return(0,b.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,b.jsx)(d,{className:(0,ag.cn)("mt-0.5 h-4 w-4 shrink-0",e)}),(0,b.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:c.message}),(0,b.jsx)("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>(0,ar.dismissToast)(c.id),"aria-label":a.common.close,children:(0,b.jsx)(aX.X,{className:"h-3.5 w-3.5"})})]},c.id)})}),(0,b.jsx)(s.Dialog,{open:!!f,onOpenChange:a=>{a||f?.resolve(!1)},children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsxs)(s.DialogTitle,{className:"flex items-center gap-2",children:[f?.destructive&&(0,b.jsx)(A,{className:"h-5 w-5 text-destructive"}),f?.title||a.common.confirmTitle]}),(0,b.jsx)(s.DialogDescription,{className:"whitespace-pre-line pt-1 text-left leading-relaxed",children:f?.message})]}),(0,b.jsxs)(s.DialogFooter,{className:"gap-2",children:[(0,b.jsx)(r.Button,{variant:"outline",onClick:()=>f?.resolve(!1),children:f?.cancelText||a.common.cancel}),(0,b.jsx)(r.Button,{variant:f?.destructive?"destructive":"default",onClick:()=>f?.resolve(!0),autoFocus:!0,children:f?.confirmText||a.common.confirm})]})]})})]})}a.s(["Providers",0,function({children:a,timeZone:f}){return(0,b.jsx)(d.SessionProvider,{children:(0,b.jsx)(c.LanguageProvider,{children:(0,b.jsxs)(e.TimeZoneProvider,{initialTimeZone:f,children:[(0,b.jsx)(aT,{children:a}),(0,b.jsx)(aW,{}),(0,b.jsx)(aZ,{})]})})})}],18175)}];
|
|
191
|
+
{{provider_hints}}`;var aE=a.i(87654);let aF=(0,l.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 aG({name:a,description:c}){return(0,b.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-2 text-xs py-1",children:[(0,b.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded font-mono text-primary shrink-0 w-fit",children:`{{${a}}}`}),(0,b.jsx)("span",{className:"text-muted-foreground",children:c})]})}function aH({config:a,onUpdate:d}){let{language:e,t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(""),[i,j]=(0,q.useState)("");(0,q.useEffect)(()=>{h(a.prompts?.analyze||aC),j(a.prompts?.similar||aD)},[a.prompts]);let k=async a=>{if(!await (0,ar.confirmDialog)(f.settings?.prompts?.resetConfirm||"Are you sure you want to reset to default?",{destructive:!0}))return;let b="analyze"===a?aC:aD;"analyze"===a?(h(b),d("analyze",b)):(j(b),d("similar",b))},l=(a,b)=>{"analyze"===a?(h(b),d("analyze",b)):(j(b),d("similar",b))},m=()=>(0,b.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,b.jsx)(A,{className:"h-5 w-5 shrink-0 text-amber-600"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"font-medium",children:f.settings?.prompts?.caution||"Modify with Caution"}),(0,b.jsx)("p",{className:"text-amber-800/90 text-xs",children:f.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,b.jsx)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:(0,b.jsxs)(w.Tabs,{defaultValue:"analyze",className:"w-full",children:[(0,b.jsxs)(w.TabsList,{className:"grid w-full grid-cols-2",children:[(0,b.jsx)(w.TabsTrigger,{value:"analyze",children:f.settings?.prompts?.analysisTab||"Analysis Prompt"}),(0,b.jsx)(w.TabsTrigger,{value:"similar",children:f.settings?.prompts?.similarTab||"Similar Question Prompt"})]}),(0,b.jsx)(w.TabsContent,{value:"analyze",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex justify-between items-center",children:[(0,b.jsx)(u.Label,{className:"text-base font-semibold",children:f.settings?.prompts?.customAnalysis||"Custom Analysis Template"}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>k("analyze"),children:[(0,b.jsx)(aE.RotateCcw,{className:"w-4 h-4 mr-2"}),f.settings?.prompts?.reset||"Reset Default"]})]}),(0,b.jsx)(m,{}),(0,b.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,b.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,b.jsx)(aF,{className:"h-3.5 w-3.5"}),f.settings?.prompts?.variables||"Available Variables"]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(aG,{name:"language_instruction",description:f.settings?.prompts?.vars?.languageInstruction||"Injects instructions based on target language (e.g., keep English questions in English but analysis in Chinese)."}),(0,b.jsx)(aG,{name:"knowledge_points_list",description:f.settings?.prompts?.vars?.knowledgePointsList||"Injects the standard list of knowledge point tags for the specific subject."}),(0,b.jsx)(aG,{name:"provider_hints",description:f.settings?.prompts?.vars?.providerHints||"System-injected hints (e.g., enforcing JSON format)."})]})]}),(0,b.jsx)(ay.Textarea,{value:g,onChange:a=>l("analyze",a.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:aC})]})}),(0,b.jsx)(w.TabsContent,{value:"similar",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex justify-between items-center",children:[(0,b.jsx)(u.Label,{className:"text-base font-semibold",children:f.settings?.prompts?.customSimilar||"Custom Similar Question Template"}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>k("similar"),children:[(0,b.jsx)(aE.RotateCcw,{className:"w-4 h-4 mr-2"}),f.settings?.prompts?.reset||"Reset Default"]})]}),(0,b.jsx)(m,{}),(0,b.jsxs)("div",{className:"space-y-2 border rounded-md p-3 bg-background",children:[(0,b.jsxs)("h4",{className:"text-xs font-medium flex items-center gap-1.5 mb-2",children:[(0,b.jsx)(aF,{className:"h-3.5 w-3.5"}),f.settings?.prompts?.variables||"Available Variables"]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(aG,{name:"difficulty_level",description:f.settings?.prompts?.vars?.difficultyLevel||"Target difficulty level."}),(0,b.jsx)(aG,{name:"difficulty_instruction",description:f.settings?.prompts?.vars?.difficultyInstruction||"Specific writing instructions for the target difficulty."}),(0,b.jsx)(aG,{name:"original_question",description:f.settings?.prompts?.vars?.originalQuestion||"The full text of the original question."}),(0,b.jsx)(aG,{name:"knowledge_points",description:f.settings?.prompts?.vars?.knowledgePoints||"List of knowledge points to test."}),(0,b.jsx)(aG,{name:"language_instruction",description:f.settings?.prompts?.vars?.languageInstructionShort||"Language formatting instructions."})]})]}),(0,b.jsx)(ay.Textarea,{value:i,onChange:a=>l("similar",a.target.value),className:"font-mono text-xs min-h-[400px]",placeholder:aD})]})})]})})}function aI({field:a,label:d,description:e}){let{t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(!1),[i,j]=(0,q.useState)(!1),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)(null),o=`preference-${a}`;(0,q.useEffect)(()=>{aq.apiClient.get("/api/user").then(b=>h(!!b[a])).catch(()=>void 0).finally(()=>j(!0))},[a]);let p=async b=>{h(b),l(!0);try{await aq.apiClient.patch("/api/user",{[a]:b}),n(f.importFlow.preferenceSaved)}catch(c){h(!b),n(f.importFlow.preferenceSaveFailed),at.frontendLogger.error("[Settings]","Failed to save user preference",{field:a,error:c instanceof Error?c.message:String(c)})}finally{l(!1)}};return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsx)(u.Label,{htmlFor:o,children:d}),(0,b.jsx)(ah,{id:o,checked:g,onCheckedChange:p,disabled:!i||k})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e}),m&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:m})]})}function aJ(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aI,{field:"confirmBeforeImport",label:a.importFlow.confirmBeforeImport,description:a.importFlow.confirmBeforeImportDesc})}function aK(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aI,{field:"enableGeogebra",label:a.importFlow.enableGeogebra,description:a.importFlow.enableGeogebraDesc})}function aL(){let{t:a}=(0,c.useLanguage)();return(0,b.jsx)(aI,{field:"enableSvgAnimation",label:a.importFlow.enableSvgAnimation,description:a.importFlow.enableSvgAnimationDesc})}function aM({value:a,onChange:d}){let{t:e}=(0,c.useLanguage)(),[f,g]=(0,q.useState)(!1),h=(b,c)=>d({...a,[b]:c});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:f?"text":"password",value:a?.apiKey||"",onChange:a=>h("apiKey",a.target.value),placeholder:"sk-ant-...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>g(!f),"aria-label":f?"Hide API Key":"Show API Key",children:f?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:a?.baseUrl||"",onChange:a=>h("baseUrl",a.target.value),placeholder:"https://api.anthropic.com"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:e.settings?.ai?.anthropicBaseUrlHint})]}),(0,b.jsx)(ax,{provider:"anthropic",apiKey:a?.apiKey,baseUrl:a?.baseUrl,currentModel:a?.model,onModelChange:a=>h("model",a)})]})}function aN({provider:a,value:d,onChange:e}){let{t:f}=(0,c.useLanguage)(),[g,h]=(0,q.useState)(!1),i=au[a],j=(a,b)=>e({...d,[a]:b});return(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:g?"text":"password",value:d?.apiKey||"",onChange:a=>j("apiKey",a.target.value),placeholder:"sk-...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>h(!g),"aria-label":g?"Hide API Key":"Show API Key",children:g?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[f.settings?.ai?.vendorApiKeyHint||"Get an API key from the console:"," ",(0,b.jsx)("a",{href:i.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"underline break-all",children:i.consoleUrl})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:d?.baseUrl||"",onChange:a=>j("baseUrl",a.target.value),placeholder:i.baseUrl}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f.settings?.ai?.vendorBaseUrlHint})]}),(0,b.jsx)(ax,{provider:a,apiKey:d?.apiKey,baseUrl:d?.baseUrl,currentModel:d?.model||i.model,onModelChange:a=>j("model",a)})]})}var aO=a.i(42027);function aP({value:a,onChange:d,disabled:e}){let{t:f}=(0,c.useLanguage)();return(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(u.Label,{htmlFor:"app-time-zone",children:f.settings.general.timeZoneLabel}),(0,b.jsx)(t.Input,{id:"app-time-zone",value:a,onChange:a=>d(a.target.value),disabled:e,list:"app-time-zones",placeholder:"Asia/Shanghai"}),(0,b.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(a=>(0,b.jsx)("option",{value:a},a))}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f.settings.general.timeZoneDesc})]})}let aQ=(0,l.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"}]]),aR=(0,l.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"}]]),aS=(0,l.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"}]]),aT=(0,l.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 aU(){let{timeZone:a,setTimeZone:f}=(0,e.useTimeZone)(),{data:g}=(0,d.useSession)(),j=g?.user?.role==="admin",{t:k,language:l,setLanguage:m}=(0,c.useLanguage)(),[n,p]=(0,q.useState)(!1),O=(0,q.useRef)(null),[P,Q]=(0,q.useState)(!1),[R,S]=(0,q.useState)(!1),[T,U]=(0,q.useState)(!1),[V,W]=(0,q.useState)(!1),[X,Y]=(0,q.useState)(!1),[Z,$]=(0,q.useState)(!1),[_,aa]=(0,q.useState)(""),[ab,ac]=(0,q.useState)(!1),[ad,ae]=(0,q.useState)({aiProvider:"minimax"}),[af,ag]=(0,q.useState)(void 0),[ah,ai]=(0,q.useState)(!1),[aj,ak]=(0,q.useState)(null),[al,am]=(0,q.useState)({name:"",email:"",educationStage:"",enrollmentYear:"",password:""}),[an,ao]=(0,q.useState)(""),[ap,ay]=(0,q.useState)(!1),[az,aA]=(0,q.useState)(!1),[aB,aC]=(0,q.useState)(!1),[aD,aE]=(0,q.useState)(!1),[aG,aI]=(0,q.useState)(!1),[aU,aV]=(0,q.useState)(!1),[aW,aX]=(0,q.useState)(null),[aY,aZ]=(0,q.useState)(""),a$=(0,h.useRouter)();(0,q.useEffect)(()=>{n&&(a_(),a0()),fetch("/api/version").then(a=>a.json()).then(a=>aa(a.version)).catch(()=>{})},[n]);let a_=async()=>{$(!0);try{let a=await aq.apiClient.get("/api/settings");ae(a)}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to fetch settings",{error:a instanceof Error?a.message:String(a)})}finally{$(!1)}},a0=async()=>{ay(!0);try{let a=await aq.apiClient.get("/api/user");am({name:a.name||"",email:a.email||"",educationStage:a.educationStage||"",enrollmentYear:a.enrollmentYear||"",password:""})}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to fetch profile",{error:a instanceof Error?a.message:String(a)})}finally{ay(!1)}},a1=async()=>{if(!(0,N.isValidTimeZone)(ad.timeZone??N.DEFAULT_TIME_ZONE))return void ar.toast.error(k.settings.general.invalidTimeZone);let a=(()=>{if("openai"!==ad.aiProvider)return null;for(let a of ad.openai?.instances||[]){if(!a.name?.trim())return k.settings?.ai?.validationNameRequired||"实例名称不能为空";if(!a.apiKey?.trim())return k.settings?.ai?.validationApiKeyRequired||"API Key 不能为空";if(!a.baseUrl?.trim())return k.settings?.ai?.validationBaseUrlRequired||"Base URL 不能为空";if(!a.model?.trim())return k.settings?.ai?.validationModelRequired||"模型名称不能为空"}return null})();if(a)return void ar.toast.error(a);let b="azure"!==ad.aiProvider?null:ad.azure?.endpoint?.trim()?ad.azure?.deploymentName?.trim()?ad.azure?.apiKey?.trim()?null:k.settings?.ai?.validationApiKeyRequired||"API Key is required":k.settings?.ai?.validationAzureDeploymentRequired||"Deployment Name is required":k.settings?.ai?.validationAzureEndpointRequired||"Azure Endpoint is required";if(b)return void ar.toast.error(b);Y(!0);try{let a=await aq.apiClient.post("/api/settings",ad);ae(a),f(a.timeZone||N.DEFAULT_TIME_ZONE),ar.toast.success(k.settings?.messages?.saved||"Settings saved"),O.current?.scrollTo({top:0,behavior:"smooth"})}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to save settings",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.messages?.saveFailed||"Failed to save")}finally{Y(!1)}},a2=async()=>{aA(!0);try{if(al.password&&al.password!==an){ar.toast.error(k.settings?.messages?.passwordMismatch||"Passwords do not match"),aA(!1);return}let a={name:al.name,email:al.email,educationStage:al.educationStage};al.enrollmentYear&&(a.enrollmentYear=parseInt(al.enrollmentYear.toString())),al.password&&(a.password=al.password),await aq.apiClient.patch("/api/user",a),ar.toast.success(k.settings?.messages?.profileUpdated||"Profile updated"),am(a=>({...a,password:""})),ao(""),aC(!1),aE(!1),window.location.reload()}catch(b){at.frontendLogger.error("[SettingsDialog]","Failed to update profile",{error:b?.data?.message||b?.message||String(b)});let a=b.data?.message||k.settings?.messages?.updateFailed||"Update failed";ar.toast.error(a)}finally{aA(!1)}},a3=async()=>{if(await (0,ar.confirmDialog)(k.settings?.clearDataConfirm||"Are you sure?",{destructive:!0})){Q(!0);try{await aq.apiClient.delete("/api/stats/practice/clear"),ar.toast.success(k.settings?.clearSuccess||"Success"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to clear practice data",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed")}finally{Q(!1)}}},a4=async()=>{if(await (0,ar.confirmDialog)(k.settings?.clearErrorDataConfirm||"Are you sure?",{destructive:!0})){S(!0);try{await aq.apiClient.delete("/api/error-items/clear"),ar.toast.success(k.settings?.clearSuccess||"Success"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Failed to clear error data",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed")}finally{S(!1)}}},a5=async()=>{if(!await (0,ar.confirmDialog)(k.settings?.systemResetConfirm||"WARNING: Deleting ALL data. Undoing is impossible. Are you sure?",{destructive:!0}))return;let a=prompt(k.settings?.systemResetPrompt||"Type 'RESET' to confirm system initialization:","");if("RESET"!==a){null!==a&&ar.toast.error(k.common?.error||"Confirmation failed");return}U(!0);try{await aq.apiClient.post("/api/admin/system-reset",{}),ar.toast.success(k.settings?.clearSuccess||"Success - System Reset Complete"),p(!1),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","System reset failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed to reset system")}finally{U(!1)}},a6=async()=>{aI(!0);try{let a=await fetch("/api/export");if(!a.ok)throw Error("Export failed");let b=await a.blob(),c=window.URL.createObjectURL(b),d=document.createElement("a");d.href=c;let e=a.headers.get("Content-Disposition"),f=e?.match(/filename="(.+)"/);d.download=f?f[1]:"wrong-notebook-export.json",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c),ar.toast.success(k.settings?.exportSuccess||"Export successful")}catch(a){at.frontendLogger.error("[SettingsDialog]","Export failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.exportFailed||"Export failed")}finally{aI(!1)}},a7=async()=>{if(await (0,ar.confirmDialog)(k.settings?.exportAllConfirm||"Export all users' data? This may take a while.")){aI(!0);try{let a=await fetch("/api/export?all=true");if(!a.ok){let b=await a.json();throw Error(b.message||"Export failed")}let b=await a.blob(),c=window.URL.createObjectURL(b),d=document.createElement("a");d.href=c;let e=a.headers.get("Content-Disposition"),f=e?.match(/filename="(.+)"/);d.download=f?f[1]:"wrong-notebook-export-all.json",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c),ar.toast.success(k.settings?.exportSuccess||"Export successful")}catch(a){at.frontendLogger.error("[SettingsDialog]","Export all failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.exportFailed||"Export failed")}finally{aI(!1)}}},a8=async()=>{if(aW&&await (0,ar.confirmDialog)(k.settings?.importConfirm||"Are you sure you want to import?")){aV(!0);try{let a=await aW.text(),b=JSON.parse(a),c=(await aq.apiClient.post("/api/import",b)).stats;ar.toast.success((k.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records.").replace("{subjects}",String(c.subjectsCreated)).replace("{tags}",String(c.tagsCreated)).replace("{items}",String(c.errorItemsCreated)).replace("{schedules}",String(c.reviewSchedulesCreated)).replace("{records}",String(c.practiceRecordsCreated)).replace("{duplicates}",String(c.duplicateErrorItems??0))),aX(null),aZ(""),window.location.reload()}catch(a){at.frontendLogger.error("[SettingsDialog]","Import failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.importFailed||"Import failed")}finally{aV(!1)}}},a9=async()=>{if(aW&&await (0,ar.confirmDialog)(k.settings?.importAllConfirm||"Import all users' data? This will restore data for all users from the export file.")){aV(!0);try{let a=await aW.text(),b=JSON.parse(a),c=await fetch("/api/import?all=true",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)}),d=await c.json();if(d.success){let a=d.stats;ar.toast.success((k.settings?.importResultDesc||"Imported {subjects} notebooks, {tags} tags, {items} error items, {schedules} review schedules, {records} practice records.").replace("{subjects}",String(a.subjectsCreated)).replace("{tags}",String(a.tagsCreated)).replace("{items}",String(a.errorItemsCreated)).replace("{schedules}",String(a.reviewSchedulesCreated)).replace("{records}",String(a.practiceRecordsCreated)).replace("{duplicates}",String(a.duplicateErrorItems??0))),aX(null),aZ(""),window.location.reload()}else throw Error(d.message||"Import failed")}catch(a){at.frontendLogger.error("[SettingsDialog]","Import all failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.importFailed||"Import failed")}finally{aV(!1)}}},ba=async()=>{if(await (0,ar.confirmDialog)(k.settings?.migrateTagsConfirm||"This will reset system tags. Confirm?",{destructive:!0})){W(!0);try{let a=await aq.apiClient.post("/api/admin/migrate-tags",{});ar.toast.success(`${k.settings?.clearSuccess||"Success"}: ${a.count||0} tags migrated.`)}catch(a){at.frontendLogger.error("[SettingsDialog]","Tag migration failed",{error:a instanceof Error?a.message:String(a)}),ar.toast.error(k.settings?.clearError||"Failed to migrate tags")}finally{W(!1)}}},bb=(a,b,c)=>{"gemini"===a&&ae(a=>({...a,gemini:{...a.gemini,[b]:c}}))},bc=()=>{let a=ad.openai?.instances||[],b=af||ad.openai?.activeInstanceId;return a.find(a=>a.id===b)},bd=(a,b)=>{let c=ad.openai?.instances||[],d=af||ad.openai?.activeInstanceId,e=c.map(c=>c.id===d?{...c,[a]:b}:c);ae(a=>({...a,openai:{...a.openai,instances:e}}))};(0,q.useEffect)(()=>{ad.openai?.activeInstanceId&&!af&&ag(ad.openai.activeInstanceId)},[ad.openai?.activeInstanceId,af]);let be=async()=>{ai(!0),ak(null);try{let a;if("openai"===ad.aiProvider){let b=bc();if(!b?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"openai",apiKey:b.apiKey,baseUrl:b.baseUrl,model:b.model,language:l}}else if("gemini"===ad.aiProvider){if(!ad.gemini?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"gemini",apiKey:ad.gemini.apiKey,baseUrl:ad.gemini.baseUrl,model:ad.gemini.model,language:l}}else if("anthropic"===ad.aiProvider){if(!ad.anthropic?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:"anthropic",apiKey:ad.anthropic.apiKey,baseUrl:ad.anthropic.baseUrl,model:ad.anthropic.model,language:l}}else if(aw(ad.aiProvider)){let b=ad[ad.aiProvider];if(!b?.apiKey){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationApiKeyRequired||"API Key is required"}),ai(!1);return}a={provider:ad.aiProvider,apiKey:b.apiKey,baseUrl:b.baseUrl,model:b.model,language:l}}else{if("azure"!==ad.aiProvider)return void ai(!1);if(!ad.azure?.apiKey||!ad.azure?.endpoint||!ad.azure?.deploymentName){ak({success:!1,textSupport:!1,visionSupport:!1,textError:k.settings?.ai?.validationAzureEndpointRequired||"Azure config is incomplete"}),ai(!1);return}a={provider:"azure",apiKey:ad.azure.apiKey,endpoint:ad.azure.endpoint,deploymentName:ad.azure.deploymentName,apiVersion:ad.azure.apiVersion,model:ad.azure.model,language:l}}let b=await aq.apiClient.post("/api/ai/test",a);ak(b)}catch(a){at.frontendLogger.error("[SettingsDialog]","AI connection test failed",{error:a instanceof Error?a.message:String(a)}),ak({success:!1,textSupport:!1,visionSupport:!1,textError:a instanceof Error?a.message:String(a)})}finally{ai(!1)}};return(0,b.jsxs)(s.Dialog,{open:n,onOpenChange:p,children:[(0,b.jsx)(s.DialogTrigger,{asChild:!0,children:(0,b.jsxs)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,b.jsx)(x,{className:"h-5 w-5"}),(0,b.jsx)("span",{className:"sr-only",children:k.settings?.title||"Settings"})]})}),(0,b.jsxs)(s.DialogContent,{ref:O,className:"w-[calc(100vw-2rem)] sm:max-w-[900px] max-h-[85vh] overflow-y-auto",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsx)(s.DialogTitle,{children:k.settings?.title||"Settings"}),(0,b.jsx)(s.DialogDescription,{children:k.settings?.desc||"Manage your preferences and data."})]}),(0,b.jsxs)(w.Tabs,{defaultValue:"general",className:"w-full",children:[(0,b.jsxs)(w.TabsList,{className:`grid w-full grid-cols-4 ${g?.user?.role==="admin"?"sm:grid-cols-7":"sm:grid-cols-4"} gap-1 h-auto`,children:[(0,b.jsxs)(w.TabsTrigger,{value:"general",className:"px-2 sm:px-3",children:[(0,b.jsx)(D.Languages,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.general||"General"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"account",className:"px-2 sm:px-3",children:[(0,b.jsx)(E.User,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.account||"Account"})]}),g?.user?.role==="admin"&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(w.TabsTrigger,{value:"ai",className:"px-2 sm:px-3",children:[(0,b.jsx)(F,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.ai||"AI Provider"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"prompts",className:"px-2 sm:px-3",children:[(0,b.jsx)(aQ,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.prompts||"Prompts"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"admin",className:"px-2 sm:px-3",children:[(0,b.jsx)(o,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.admin||"User Management"})]})]}),(0,b.jsxs)(w.TabsTrigger,{value:"danger",className:"px-2 sm:px-3",children:[(0,b.jsx)(A,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.danger||"Danger"})]}),(0,b.jsxs)(w.TabsTrigger,{value:"about",className:"px-2 sm:px-3",children:[(0,b.jsx)(aF,{className:"h-4 w-4 sm:mr-2"}),(0,b.jsx)("span",{className:"hidden sm:inline",children:k.settings?.tabs?.about||"About"})]})]}),(0,b.jsxs)(w.TabsContent,{value:"general",className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.language||"Language"}),(0,b.jsxs)(v.Select,{value:l,onValueChange:a=>m(a),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsxs)(v.SelectContent,{children:[(0,b.jsx)(v.SelectItem,{value:"zh",children:"中文 (Chinese)"}),(0,b.jsx)(v.SelectItem,{value:"en",children:"English"})]})]})]}),(0,b.jsx)(aP,{value:ad.timeZone??a,onChange:a=>ae(b=>({...b,timeZone:a})),disabled:!j||Z||X}),j&&(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsx)(u.Label,{children:k.settings?.general?.timeoutLabel||"AI Analysis Timeout (Seconds)"}),(0,b.jsx)(t.Input,{type:"number",value:ad.timeouts?.analyze?ad.timeouts.analyze/1e3:"",onChange:a=>{let b=""===a.target.value?0:parseInt(a.target.value);ae(a=>({...a,timeouts:{...a.timeouts,analyze:isNaN(b)?0:1e3*b}}))},onBlur:()=>{let a=(ad.timeouts?.analyze||0)/1e3,b=a;b<120&&(b=120),b>600&&(b=600),b!==a&&ae(a=>({...a,timeouts:{...a.timeouts,analyze:1e3*b}}))},min:120,max:600}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:k.settings?.general?.timeoutDesc||"Increase this value if you experience frequent timeouts during AI analysis."})]}),(0,b.jsx)(aJ,{}),(0,b.jsx)(aL,{}),(0,b.jsx)(aK,{}),(0,b.jsx)(aO.DuplicateThresholdSetting,{})]}),j&&(0,b.jsxs)(r.Button,{onClick:a1,disabled:X,className:"w-full",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.save||"Save Settings"]})]}),(0,b.jsx)(w.TabsContent,{value:"account",className:"space-y-4 py-4",children:ap?(0,b.jsx)("div",{className:"flex justify-center py-8",children:(0,b.jsx)(z.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.name||"Name"}),(0,b.jsx)(t.Input,{value:al.name||"",onChange:a=>am({...al,name:a.target.value})})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.email||"Email"}),(0,b.jsx)(t.Input,{value:al.email||"",onChange:a=>am({...al,email:a.target.value}),type:"email"})]})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.educationStage||"Education Stage"}),(0,b.jsxs)(v.Select,{value:al.educationStage||"",onValueChange:a=>am({...al,educationStage:a}),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{placeholder:k.auth?.selectStage||"Select Stage"})}),(0,b.jsxs)(v.SelectContent,{children:[(0,b.jsx)(v.SelectItem,{value:"primary",children:k.auth?.primary||"Primary School"}),(0,b.jsx)(v.SelectItem,{value:"junior_high",children:k.auth?.juniorHigh||"Junior High"}),(0,b.jsx)(v.SelectItem,{value:"senior_high",children:k.auth?.seniorHigh||"Senior High"}),(0,b.jsx)(v.SelectItem,{value:"university",children:k.auth?.university||"University"})]})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.enrollmentYear||"Enrollment Year"}),(0,b.jsx)(t.Input,{type:"number",value:al.enrollmentYear||"",onChange:a=>am({...al,enrollmentYear:a.target.value}),placeholder:"YYYY"})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-2 border-t",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.account?.changePassword||"Change Password (Leave empty to keep)"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:aB?"text":"password",value:al.password,onChange:a=>am({...al,password:a.target.value}),placeholder:"******",minLength:6,className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>aC(!aB),tabIndex:-1,children:aB?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),al.password&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.auth?.confirmPassword||"Confirm Password"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:aD?"text":"password",value:an,onChange:a=>ao(a.target.value),placeholder:"******",minLength:6,className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>aE(!aD),tabIndex:-1,children:aD?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]})]}),(0,b.jsxs)(r.Button,{onClick:a2,disabled:az,className:"w-full",children:[az&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.account?.update||"Update Profile"]})]})}),(0,b.jsx)(w.TabsContent,{value:"ai",className:"space-y-4 py-4",children:Z?(0,b.jsx)("div",{className:"flex justify-center py-4",children:(0,b.jsx)(z.Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,b.jsxs)("div",{className:"space-y-4 border rounded-lg p-4 bg-muted/30",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.tabs?.ai||"AI Provider"}),(0,b.jsxs)(v.Select,{value:ad.aiProvider,onValueChange:a=>ae(b=>({...b,aiProvider:a})),children:[(0,b.jsx)(v.SelectTrigger,{children:(0,b.jsx)(v.SelectValue,{})}),(0,b.jsxs)(v.SelectContent,{children:[av.map(a=>(0,b.jsx)(v.SelectItem,{value:a,children:au[a].name},a)),(0,b.jsx)(v.SelectItem,{value:"anthropic",children:"Anthropic / Compatible"}),(0,b.jsx)(v.SelectItem,{value:"azure",children:"Azure OpenAI"}),(0,b.jsx)(v.SelectItem,{value:"openai",children:"OpenAI / Compatible"}),(0,b.jsx)(v.SelectItem,{value:"gemini",children:"Google Gemini"})]})]})]}),"openai"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.instances||"Instance"}),(0,b.jsxs)(r.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>{let a=ad.openai?.instances||[];if(a.length>=10)return;let b={id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,a=>{let b=16*Math.random()|0;return("x"===a?b:3&b|8).toString(16)}),name:`Instance ${a.length+1}`,apiKey:"",baseUrl:"https://api.openai.com/v1",model:"gpt-6.1-sol"};ae(a=>({...a,openai:{instances:[...a.openai?.instances||[],b],activeInstanceId:b.id}})),ag(b.id)},disabled:(ad.openai?.instances?.length||0)>=10,className:"h-7 px-2 text-xs",children:[(0,b.jsx)(H.Plus,{className:"h-3 w-3 mr-1"}),k.settings?.ai?.addInstance||"Add"]})]}),(ad.openai?.instances?.length||0)>0?(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(v.Select,{value:af||ad.openai?.activeInstanceId||"",onValueChange:a=>{ag(a),ae(b=>({...b,openai:{...b.openai,activeInstanceId:a}}))},children:[(0,b.jsx)(v.SelectTrigger,{className:"flex-1",children:(0,b.jsx)(v.SelectValue,{placeholder:k.settings?.ai?.selectInstance||"Select Instance"})}),(0,b.jsx)(v.SelectContent,{children:(ad.openai?.instances||[]).map(a=>(0,b.jsx)(v.SelectItem,{value:a.id,children:a.name},a.id))})]}),(ad.openai?.instances?.length||0)>1&&(0,b.jsx)(r.Button,{type:"button",variant:"outline",size:"icon",onClick:async()=>{let a,b,c=af||ad.openai?.activeInstanceId;c&&await (0,ar.confirmDialog)(k.settings?.ai?.confirmDelete||"Delete this instance?",{destructive:!0})&&(b=(a=(ad.openai?.instances||[]).filter(a=>a.id!==c)).length>0?a[0].id:void 0,ae(c=>({...c,openai:{instances:a,activeInstanceId:b}})),ag(b))},className:"h-10 w-10 text-destructive hover:text-destructive",children:(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}):(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:k.settings?.ai?.noInstances||"No instances configured. Click 'Add' to create one."}),(ad.openai?.instances?.length||0)>=10&&(0,b.jsx)("p",{className:"text-xs text-amber-600",children:k.settings?.ai?.maxInstancesReached||"Maximum instances reached (10)"})]}),bc()&&(0,b.jsxs)("div",{className:"space-y-3 p-3 border rounded-md bg-background",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.instanceName||"Instance Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:bc()?.name||"",onChange:a=>bd("name",a.target.value),placeholder:"e.g. 智谱 GLM-4V",className:bc()?.name?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:bc()?.apiKey||"",onChange:a=>bd("apiKey",a.target.value),placeholder:"sk-...",className:`pr-10 ${!bc()?.apiKey?.trim()?"border-destructive":""}`}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2 pt-4 border-t",children:[(0,b.jsxs)(u.Label,{children:["Base URL ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:bc()?.baseUrl||"",onChange:a=>bd("baseUrl",a.target.value),placeholder:"https://api.openai.com/v1",className:bc()?.baseUrl?.trim()?"":"border-destructive"})]}),(0,b.jsx)(ax,{provider:"openai",apiKey:bc()?.apiKey,baseUrl:bc()?.baseUrl,currentModel:bc()?.model,onModelChange:a=>bd("model",a)})]})]}),"gemini"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"API Key"}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:ad.gemini?.apiKey||"",onChange:a=>bb("gemini","apiKey",a.target.value),placeholder:"AIza...",className:"pr-10"}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:"Base URL (Optional)"}),(0,b.jsx)(t.Input,{value:ad.gemini?.baseUrl||"",onChange:a=>bb("gemini","baseUrl",a.target.value),placeholder:"https://generativelanguage.googleapis.com"})]}),(0,b.jsx)(ax,{provider:"gemini",apiKey:ad.gemini?.apiKey,baseUrl:ad.gemini?.baseUrl,currentModel:ad.gemini?.model,onModelChange:a=>bb("gemini","model",a)})]}),"anthropic"===ad.aiProvider&&(0,b.jsx)(aM,{value:ad.anthropic,onChange:a=>ae(b=>({...b,anthropic:a}))}),aw(ad.aiProvider)&&(0,b.jsx)(aN,{provider:ad.aiProvider,value:ad[ad.aiProvider],onChange:a=>ae(b=>({...b,[b.aiProvider]:a}))},ad.aiProvider),"azure"===ad.aiProvider&&(0,b.jsxs)("div",{className:"space-y-3 animate-in fade-in slide-in-from-top-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.azureEndpoint||"Azure Endpoint"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:ad.azure?.endpoint||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,endpoint:a.target.value}})),placeholder:k.settings?.ai?.azureEndpointPlaceholder||"https://your-resource.openai.azure.com",className:ad.azure?.endpoint?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:[k.settings?.ai?.azureDeployment||"Deployment Name"," ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsx)(t.Input,{value:ad.azure?.deploymentName||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,deploymentName:a.target.value}})),placeholder:k.settings?.ai?.azureDeploymentPlaceholder||"gpt-4o-deployment",className:ad.azure?.deploymentName?.trim()?"":"border-destructive"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)(u.Label,{children:["API Key ",(0,b.jsx)("span",{className:"text-destructive",children:"*"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(t.Input,{type:ab?"text":"password",value:ad.azure?.apiKey||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,apiKey:a.target.value}})),placeholder:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:`pr-10 ${!ad.azure?.apiKey?.trim()?"border-destructive":""}`}),(0,b.jsx)(r.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",onClick:()=>ac(!ab),children:ab?(0,b.jsx)(C.EyeOff,{className:"h-4 w-4 text-muted-foreground"}):(0,b.jsx)(B.Eye,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.azureApiVersion||"API Version"}),(0,b.jsx)(t.Input,{value:ad.azure?.apiVersion||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,apiVersion:a.target.value}})),placeholder:k.settings?.ai?.azureApiVersionPlaceholder||"2024-02-15-preview"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(u.Label,{children:k.settings?.ai?.azureModel||"Model Display Name"}),(0,b.jsx)(t.Input,{value:ad.azure?.model||"",onChange:a=>ae(b=>({...b,azure:{...b.azure,model:a.target.value}})),placeholder:"gpt-4o"})]})]}),(0,b.jsxs)("div",{className:"space-y-3 pt-3 border-t",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(r.Button,{type:"button",variant:"outline",onClick:be,disabled:ah||X,className:"flex-1",children:[ah?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(I,{className:"mr-2 h-4 w-4"}),ah?k.settings?.ai?.testing||"测试中...":k.settings?.ai?.testConnection||"测试连接"]}),(0,b.jsxs)(r.Button,{onClick:a1,disabled:X||ah,className:"flex-1",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.ai?.save||"Save AI Settings"]})]}),aj&&(0,b.jsxs)("div",{className:`p-3 rounded-md text-sm ${aj.success?"bg-green-50 border border-green-200":"bg-red-50 border border-red-200"}`,children:[(0,b.jsx)("div",{className:"flex items-center gap-2 font-medium mb-2",children:aj.success?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(J,{className:"h-4 w-4 text-green-600"}),(0,b.jsx)("span",{className:"text-green-700",children:k.settings?.ai?.testSuccess||"连接成功"}),aj.modelInfo&&(0,b.jsxs)("span",{className:"text-green-600 text-xs",children:["(",aj.modelInfo,")"]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(K.XCircle,{className:"h-4 w-4 text-red-600"}),(0,b.jsx)("span",{className:"text-red-700",children:k.settings?.ai?.testFailed||"连接失败"})]})}),aj.success&&(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[k.settings?.ai?.textSupport||"文本生成",":"]}),(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",k.settings?.ai?.supported||"支持"]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[k.settings?.ai?.visionSupport||"图像识别/多模态",":"]}),aj.visionSupport?(0,b.jsxs)("span",{className:"text-green-600",children:["✓ ",k.settings?.ai?.supported||"支持"]}):(0,b.jsxs)("span",{className:"text-amber-600",children:["✗ ",aj.visionError?k.settings?.ai?.errors?.[aj.visionError]||aj.visionError.replace("UNKNOWN:",""):k.settings?.ai?.notSupported||"不支持"]})]}),(0,b.jsx)("p",{className:"text-muted-foreground/60 text-[10px] pl-1",children:"* 由于网络问题,可能测试结果不准确"})]}),!aj.success&&aj.textError&&(0,b.jsx)("p",{className:"text-red-600 text-xs mt-1",children:k.settings?.ai?.errors?.[aj.textError]||aj.textError.replace("UNKNOWN:","")})]})]})]})}),(0,b.jsxs)(w.TabsContent,{value:"prompts",className:"space-y-4 py-4",children:[(0,b.jsx)(aH,{config:ad,onUpdate:(a,b)=>{ae(c=>({...c,prompts:{...c.prompts,[a]:b}}))}}),(0,b.jsxs)(r.Button,{onClick:a1,disabled:X,className:"w-full",children:[X&&(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),k.settings?.prompts?.save||"Save Prompt Settings"]})]}),g?.user?.role==="admin"&&(0,b.jsxs)(w.TabsContent,{value:"admin",className:"space-y-4 py-4",children:[(0,b.jsxs)(r.Button,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{p(!1),a$.push("/admin")},children:[(0,b.jsx)(i.BarChart3,{className:"h-4 w-4"}),k.admin?.dashboard?.title||"Admin Dashboard"]}),(0,b.jsx)("div",{className:"border-t pt-4",children:(0,b.jsx)(as,{})})]}),(0,b.jsx)(w.TabsContent,{value:"danger",className:"space-y-4 py-4",children:(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,b.jsx)("h4",{className:"text-sm font-bold text-blue-900 mb-3",children:k.settings?.dataManagement||"Data Management"}),(0,b.jsxs)("div",{className:"mb-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:k.settings?.exportData||"Export Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a6,disabled:aG,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[aG?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(L.Download,{className:"mr-2 h-4 w-4"}),k.settings?.exportData||"Export"]}),g?.user?.role==="admin"&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a7,disabled:aG,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[aG?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(L.Download,{className:"mr-2 h-4 w-4"}),k.settings?.exportAllData||"Export All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:k.settings?.exportDataDesc||"Export all data as JSON file."})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,b.jsx)("span",{className:"text-sm text-blue-800 font-medium",children:k.settings?.importData||"Import Data"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{type:"file",accept:".json",onChange:a=>{let b=a.target.files?.[0];b&&(aX(b),aZ(b.name))},className:"hidden",id:"import-file-input",disabled:aU}),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>document.getElementById("import-file-input")?.click(),disabled:aU,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:[aU?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(M,{className:"mr-2 h-4 w-4"}),aY||k.settings?.selectFile||"Select File"]}),aW&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a8,disabled:aU,className:"bg-green-100 hover:bg-green-200 text-green-900 border-green-300",children:[aU?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(J,{className:"mr-2 h-4 w-4"}),k.settings?.importData||"Import"]}),aW&&g?.user?.role==="admin"&&(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:a9,disabled:aU,className:"bg-orange-100 hover:bg-orange-200 text-orange-900 border-orange-300",children:[aU?(0,b.jsx)(z.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,b.jsx)(J,{className:"mr-2 h-4 w-4"}),k.settings?.importAllData||"Import All"]})]})]}),(0,b.jsx)("p",{className:"text-xs text-blue-700",children:k.settings?.importDataDesc||"Import data from JSON file. Existing data will be skipped."})]})]}),g?.user?.role==="admin"&&(0,b.jsxs)("div",{className:"p-4 border border-blue-200 rounded-lg bg-blue-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsxs)("span",{className:"text-sm text-blue-900 font-bold flex items-center gap-2",children:[(0,b.jsx)(G.RefreshCw,{className:"h-4 w-4"}),k.settings?.migrateTags||"Migrate Tags"]})}),(0,b.jsx)(r.Button,{variant:"outline",size:"sm",onClick:ba,disabled:V,className:"bg-blue-100 hover:bg-blue-200 text-blue-900 border-blue-300",children:V?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(G.RefreshCw,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-blue-800 mt-2 font-medium",children:k.settings?.migrateTagsDesc||"Re-populates standard tags from file"})]}),(0,b.jsxs)("div",{className:"p-4 border border-red-200 rounded-lg bg-red-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-sm text-red-700 font-medium",children:k.settings?.clearData||"Clear Practice Data"}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a3,disabled:P,children:P?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-600 mt-2",children:k.settings?.clearDataDesc||"This will permanently delete all practice history. Irreversible."})]}),(0,b.jsxs)("div",{className:"p-4 border border-red-200 rounded-lg bg-red-50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-sm text-red-700 font-medium",children:k.settings?.clearErrorData||"Clear Error Data"}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a4,disabled:R,children:R?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-600 mt-2",children:k.settings?.clearErrorDataDesc||"This will permanently delete all error items. Irreversible."})]}),g?.user?.role==="admin"&&(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)("div",{className:"p-4 border border-red-600/50 rounded-lg bg-red-100/50",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsxs)("span",{className:"text-sm text-red-900 font-bold flex items-center gap-2",children:[(0,b.jsx)(A,{className:"h-4 w-4"}),k.settings?.systemReset||"System Initialization"]})}),(0,b.jsx)(r.Button,{variant:"destructive",size:"sm",onClick:a5,disabled:T,className:"bg-red-700 hover:bg-red-800",children:T?(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}):(0,b.jsx)(y.Trash2,{className:"h-4 w-4"})})]}),(0,b.jsx)("p",{className:"text-xs text-red-800 mt-2 font-medium",children:k.settings?.systemResetDesc||"Resets the system to factory state. Deletes ALL data."})]})})]})}),(0,b.jsx)(w.TabsContent,{value:"about",className:"space-y-4 py-4",children:(0,b.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,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("h3",{className:"text-2xl font-bold",children:k.app?.title||"Smart Error Notebook"}),(0,b.jsx)("p",{className:"text-muted-foreground",children:k.settings?.about?.desc||"AI-powered learning assistant"})]}),(0,b.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,b.jsx)(aF,{className:"h-4 w-4"}),(0,b.jsxs)("span",{children:[k.settings?.about?.version||"Version",": v",_||"unknown"]})]}),(0,b.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,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aS,{className:"h-4 w-4"}),k.settings?.about?.github||"GitHub Repository",(0,b.jsx)(aR,{className:"h-3 w-3 ml-1 opacity-50"})]})}),(0,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook/releases",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aT,{className:"h-4 w-4"}),k.settings?.about?.releaseNotes||"Release Notes",(0,b.jsx)(aR,{className:"h-3 w-3 ml-1 opacity-50"})]})}),(0,b.jsx)(r.Button,{variant:"outline",asChild:!0,className:"gap-2 w-full sm:w-auto",children:(0,b.jsxs)("a",{href:"https://github.com/wttwins/wrong-notebook/issues",target:"_blank",rel:"noopener noreferrer",children:[(0,b.jsx)(aQ,{className:"h-4 w-4"}),k.settings?.about?.feedback||"Feedback",(0,b.jsx)(aR,{className:"h-3 w-3 ml-1 opacity-50"})]})})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-8",children:k.settings?.about?.copyright||"© 2025 Wttwins. All rights reserved."})]})})]})]})]})}let aV=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/],aW=[{key:"home",href:"/",icon:n,match:a=>"/"===a},{key:"notebooks",href:"/notebooks",icon:j.BookOpen,match:a=>a.startsWith("/notebooks")||a.startsWith("/error-items")||a.startsWith("/practice")},{key:"tags",href:"/tags",icon:p,match:a=>a.startsWith("/tags")},{key:"stats",href:"/stats",icon:i.BarChart3,match:a=>a.startsWith("/stats")},{key:"exams",href:"/exams",icon:k.FileText,match:a=>a.startsWith("/exams")}];function aX({children:a}){let e=(0,h.usePathname)()||"/",{t:i}=(0,c.useLanguage)(),{data:j,status:k}=(0,d.useSession)();if(aV.some(a=>a.test(e))||"unauthenticated"===k)return(0,b.jsx)(b.Fragment,{children:a});let l=j?.user?.role==="admin",n=j?.user?.name||j?.user?.email||"";return(0,b.jsxs)("div",{className:"min-h-screen",children:[(0,b.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,b.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,b.jsxs)(g.default,{href:"/",className:"flex shrink-0 items-center gap-2",children:[(0,b.jsx)(f.default,{src:"/icons/icon.png",alt:"",width:32,height:32,className:"rounded-lg",priority:!0,unoptimized:!0}),(0,b.jsx)("span",{className:"text-base font-semibold tracking-tight",children:i.pageTitle.base})]}),(0,b.jsx)("nav",{className:"ml-4 hidden items-center gap-1 md:flex",children:aW.map(a=>{let c=a.match(e),d=a.icon;return(0,b.jsxs)(g.default,{href:a.href,className:(0,ag.cn)("flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors",c?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"),"aria-current":c?"page":void 0,children:[(0,b.jsx)(d,{className:"h-4 w-4"}),i.nav[a.key]]},a.key)})}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[n&&(0,b.jsxs)("span",{className:"mr-2 hidden max-w-40 items-center gap-2 truncate text-sm text-muted-foreground lg:flex",children:[(0,b.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:n.slice(0,1).toUpperCase()}),(0,b.jsx)("span",{className:"truncate",children:n})]}),l&&(0,b.jsx)(g.default,{href:"/admin",title:i.nav.admin,children:(0,b.jsxs)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full",children:[(0,b.jsx)(o,{className:"h-5 w-5"}),(0,b.jsx)("span",{className:"sr-only",children:i.nav.admin})]})}),(0,b.jsx)(aU,{}),(0,b.jsx)(r.Button,{variant:"ghost",size:"icon",className:"rounded-full text-muted-foreground hover:text-destructive",onClick:()=>(0,d.signOut)({callbackUrl:"/login"}),title:i.app.logout,children:(0,b.jsx)(m,{className:"h-5 w-5"})})]})]})}),(0,b.jsx)("div",{className:"pb-20 md:pb-0",children:a}),(0,b.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,b.jsx)("div",{className:"grid h-16 grid-cols-5",children:aW.map(a=>{let c=a.match(e),d=a.icon;return(0,b.jsxs)(g.default,{href:a.href,className:(0,ag.cn)("flex flex-col items-center justify-center gap-1 text-[11px] font-medium transition-colors",c?"text-primary":"text-muted-foreground"),"aria-current":c?"page":void 0,children:[(0,b.jsx)("span",{className:(0,ag.cn)("flex h-7 w-12 items-center justify-center rounded-full transition-colors",c&&"bg-accent"),children:(0,b.jsx)(d,{className:"h-5 w-5"})}),i.nav[a.key]]},a.key)})})})]})}let aY=(0,l.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"}]]),aZ=[/^\/login/,/^\/register/,/^\/print-preview/,/^\/exams\/[^/]+\/print/];function a$(){let{t:a}=(0,c.useLanguage)(),{timeZone:f}=(0,e.useTimeZone)(),{status:i}=(0,d.useSession)(),j=(0,h.usePathname)(),[k,l]=(0,q.useState)(!1),[m,n]=(0,q.useState)([]),[o,p]=(0,q.useState)(()=>Date.now()),t="authenticated"!==i||aZ.some(a=>a.test(j||"")),u=(0,q.useCallback)(async()=>{if("u"<typeof document||"hidden"!==document.visibilityState)try{let a=await aq.apiClient.get("/api/tasks");n(a.tasks),p(Date.now())}catch{}},[]);if((0,q.useEffect)(()=>{if(t)return;let a=setTimeout(u,0),b=setInterval(u,k?2e3:15e3);return()=>{clearTimeout(a),clearInterval(b)}},[t,k,u]),t)return null;let v=m.filter(a=>"running"===a.status).length,w=m.some(a=>"running"!==a.status),x=async()=>{try{let a=await aq.apiClient.delete("/api/tasks");n(a.tasks)}catch{}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(r.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:()=>l(!0),"aria-label":a.backgroundTasks.title,title:a.backgroundTasks.title,children:[v>0?(0,b.jsx)(z.Loader2,{className:"h-5 w-5 animate-spin"}):(0,b.jsx)(aY,{className:"h-5 w-5"}),v>0&&(0,b.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:v})]}),(0,b.jsx)(s.Dialog,{open:k,onOpenChange:l,children:(0,b.jsxs)(s.DialogContent,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsx)(s.DialogTitle,{children:a.backgroundTasks.title}),(0,b.jsx)(s.DialogDescription,{children:a.backgroundTasks.description})]}),0===m.length?(0,b.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:a.backgroundTasks.empty}):(0,b.jsx)("ul",{className:"space-y-2",children:m.map(c=>{var d,e;let h;return(0,b.jsx)("li",{className:"rounded-md border p-3 text-sm",children:(0,b.jsxs)("div",{className:"flex items-start gap-2",children:["running"===c.status&&(0,b.jsx)(z.Loader2,{className:"mt-0.5 h-4 w-4 shrink-0 animate-spin text-primary"}),"succeeded"===c.status&&(0,b.jsx)(J,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),"failed"===c.status&&(0,b.jsx)(K.XCircle,{className:"mt-0.5 h-4 w-4 shrink-0 text-destructive"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,b.jsxs)("div",{className:"font-medium",children:[a.backgroundTasks.kinds[c.kind],(0,b.jsxs)("span",{className:"font-normal text-muted-foreground",children:[" · ",a.backgroundTasks.status[c.status]]})]}),c.subject&&(0,b.jsx)("div",{className:"break-words text-muted-foreground",children:c.subject}),c.progress&&c.progress.total>0&&(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("div",{className:"h-1.5 overflow-hidden rounded bg-muted",children:(0,b.jsx)("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.round(c.progress.done/c.progress.total*100)}%`}})}),(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:[a.backgroundTasks.progress.replace("{done}",String(c.progress.done)).replace("{total}",String(c.progress.total)),c.progress.failed>0&&` \xb7 ${a.backgroundTasks.failedCount.replace("{count}",String(c.progress.failed))}`]})]}),c.error&&(0,b.jsx)("div",{className:"text-xs text-destructive",children:(b=>{if(!b)return null;let c=a.backgroundTasks.errors[b]??a.errors[b];return"string"==typeof c?c:b})(c.error)}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:a.backgroundTasks.startedAt.replace("{time}",(0,N.formatDateTime)(c.startedAt,"HH:mm:ss",f))}),(0,b.jsx)("span",{children:a.backgroundTasks.elapsed.replace("{time}",(d=c.startedAt,e=c.finishedAt,h=Math.max(0,Math.round(((e?Date.parse(e):o)-Date.parse(d))/1e3)),`${Math.floor(h/60)}:${String(h%60).padStart(2,"0")}`))}),c.link&&(0,b.jsx)(g.default,{href:c.link,className:"text-primary hover:underline",onClick:()=>l(!1),children:a.backgroundTasks.view})]})]})]})},c.id)})}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 pt-1",children:[(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a.backgroundTasks.retentionHint}),w&&(0,b.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:x,children:a.backgroundTasks.clearFinished})]})]})})]})}var a_=a.i(33508);let a0={success:{icon:J,className:"text-success"},error:{icon:K.XCircle,className:"text-destructive"},warning:{icon:A,className:"text-warning"},info:{icon:aF,className:"text-primary"}};function a1(){let{t:a}=(0,c.useLanguage)(),[d,e]=(0,q.useState)([]),[f,g]=(0,q.useState)(null);return(0,q.useEffect)(()=>(0,ar.subscribeFeedback)(a=>{e(a.toasts),g(a.confirm)}),[]),(0,b.jsxs)(b.Fragment,{children:[(0,b.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:d.map(c=>{let{icon:d,className:e}=a0[c.type];return(0,b.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,b.jsx)(d,{className:(0,ag.cn)("mt-0.5 h-4 w-4 shrink-0",e)}),(0,b.jsx)("p",{className:"min-w-0 flex-1 whitespace-pre-line break-words leading-relaxed",children:c.message}),(0,b.jsx)("button",{type:"button",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",onClick:()=>(0,ar.dismissToast)(c.id),"aria-label":a.common.close,children:(0,b.jsx)(a_.X,{className:"h-3.5 w-3.5"})})]},c.id)})}),(0,b.jsx)(s.Dialog,{open:!!f,onOpenChange:a=>{a||f?.resolve(!1)},children:(0,b.jsxs)(s.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsxs)(s.DialogHeader,{children:[(0,b.jsxs)(s.DialogTitle,{className:"flex items-center gap-2",children:[f?.destructive&&(0,b.jsx)(A,{className:"h-5 w-5 text-destructive"}),f?.title||a.common.confirmTitle]}),(0,b.jsx)(s.DialogDescription,{className:"whitespace-pre-line pt-1 text-left leading-relaxed",children:f?.message})]}),(0,b.jsxs)(s.DialogFooter,{className:"gap-2",children:[(0,b.jsx)(r.Button,{variant:"outline",onClick:()=>f?.resolve(!1),children:f?.cancelText||a.common.cancel}),(0,b.jsx)(r.Button,{variant:f?.destructive?"destructive":"default",onClick:()=>f?.resolve(!0),autoFocus:!0,children:f?.confirmText||a.common.confirm})]})]})})]})}a.s(["Providers",0,function({children:a,timeZone:f}){return(0,b.jsx)(d.SessionProvider,{children:(0,b.jsx)(c.LanguageProvider,{children:(0,b.jsxs)(e.TimeZoneProvider,{initialTimeZone:f,children:[(0,b.jsx)(aX,{children:a}),(0,b.jsx)(a$,{}),(0,b.jsx)(a1,{})]})})})}],18175)}];
|
|
192
192
|
|
|
193
193
|
//# sourceMappingURL=src_components_providers_tsx_09kw-mv._.js.map
|
|
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
|
|
|
7
7
|
"static/chunks/0cz1d0mv5g_q7.js"
|
|
8
8
|
],
|
|
9
9
|
"lowPriorityFiles": [
|
|
10
|
-
"static/
|
|
11
|
-
"static/
|
|
12
|
-
"static/
|
|
10
|
+
"static/PipzREVX2s4mdvp2gs1DS/_buildManifest.js",
|
|
11
|
+
"static/PipzREVX2s4mdvp2gs1DS/_ssgManifest.js",
|
|
12
|
+
"static/PipzREVX2s4mdvp2gs1DS/_clientMiddlewareManifest.js"
|
|
13
13
|
],
|
|
14
14
|
"rootMainFiles": [
|
|
15
15
|
"static/chunks/1oiuiyv1cv06v.js",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"wasm": [],
|
|
22
22
|
"assets": [],
|
|
23
23
|
"env": {
|
|
24
|
-
"__NEXT_BUILD_ID": "
|
|
25
|
-
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "
|
|
26
|
-
"__NEXT_PREVIEW_MODE_ID": "
|
|
27
|
-
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "
|
|
28
|
-
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "
|
|
24
|
+
"__NEXT_BUILD_ID": "PipzREVX2s4mdvp2gs1DS",
|
|
25
|
+
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY": "BL9WGQNoWOshvdZ+aoftjEWl4VUt4BiKJyVt++brqkM=",
|
|
26
|
+
"__NEXT_PREVIEW_MODE_ID": "665d674a3ae687385a22d0d6bd521613",
|
|
27
|
+
"__NEXT_PREVIEW_MODE_ENCRYPTION_KEY": "b73ad7be24b8a072140df06ef38e8fcf45d2fd32ac2e6770e6333ecdd785e46d",
|
|
28
|
+
"__NEXT_PREVIEW_MODE_SIGNING_KEY": "b009baa12a4b62701b0269b142a9c5d7c104b6b011e115123933ff42b5bfb274"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/1oiuiyv1cv06v.js"/><script src="/_next/static/chunks/3jta6jrk-jubq.js" async=""></script><script src="/_next/static/chunks/0dzfsm6h13fyr.js" async=""></script><script src="/_next/static/chunks/0_w084ms_lq25.js" async=""></script><script src="/_next/static/chunks/turbopack-1-0r7_puvz3eq.js" async=""></script><script src="/_next/static/chunks/0ehjiuuxbbhq9.js" async=""></script><link rel="manifest" href="/manifest.webmanifest"/><link rel="icon" href="/favicon.ico?favicon.2vob68tjqpejf.ico" sizes="256x256" type="image/x-icon"/><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/1oiuiyv1cv06v.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"default\",1]\n7:X\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/1oiuiyv1cv06v.js"/><script src="/_next/static/chunks/3jta6jrk-jubq.js" async=""></script><script src="/_next/static/chunks/0dzfsm6h13fyr.js" async=""></script><script src="/_next/static/chunks/0_w084ms_lq25.js" async=""></script><script src="/_next/static/chunks/turbopack-1-0r7_puvz3eq.js" async=""></script><script src="/_next/static/chunks/0ehjiuuxbbhq9.js" async=""></script><link rel="manifest" href="/manifest.webmanifest"/><link rel="icon" href="/favicon.ico?favicon.2vob68tjqpejf.ico" sizes="256x256" type="image/x-icon"/><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/1oiuiyv1cv06v.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[39756,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"default\"]\n3:I[37457,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"default\"]\n4:I[97367,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[97367,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"ViewportBoundary\"]\na:I[97367,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"MetadataBoundary\"]\nc:I[68027,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"default\",1]\n7:X\n0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{},\"$undefined\",\"$undefined\",4624]},\"$undefined\",\"$undefined\",4624],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"r\":\"$undefined\",\"s\":\"$undefined\",\"a\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"PipzREVX2s4mdvp2gs1DS\"}\n7:C\n9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\nd:I[27201,[\"/_next/static/chunks/0ehjiuuxbbhq9.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"link\",\"0\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?favicon.2vob68tjqpejf.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Ld\",\"2\",{}]]\n"])</script></body></html>
|