openlearn-next 0.3.22 → 0.4.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.
Files changed (69) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/AdminDirectoryView-DY--WM5Z.js +1 -0
  3. package/dist/assets/{BatchPickerModal-C9FH3J57.js → BatchPickerModal-DCDKZsrS.js} +1 -1
  4. package/dist/assets/ClassesView-COk1pTlX.js +22 -0
  5. package/dist/assets/ClassroomCountdownWidget-CHUvYSrT.js +2 -0
  6. package/dist/assets/CloudDriveModal-DY7BSVJN.js +1 -0
  7. package/dist/assets/ComputerLabView-1qWDNRQ2.js +1 -0
  8. package/dist/assets/CourseManagement-DA1m3Div.js +1 -0
  9. package/dist/assets/CourseWizardModal-yDZpcltW.js +3 -0
  10. package/dist/assets/CoursewareHubPanel-CaEizhxl.js +1 -0
  11. package/dist/assets/Dashboard-QTNgTjoi.js +8 -0
  12. package/dist/assets/{ExportWeightModal-C4d-0uTM.js → ExportWeightModal-Cq3BaikE.js} +1 -1
  13. package/dist/assets/HelpTour-CMJbbGne.js +1 -0
  14. package/dist/assets/{HelpView-B9Pny6u9.js → HelpView-DY4CA5VA.js} +4 -4
  15. package/dist/assets/{ImportLessonsModal-hKRuw9p4.js → ImportLessonsModal-DzeCcQOI.js} +1 -1
  16. package/dist/assets/{ImportModal-CVXHZ1Ei.js → ImportModal-D7L-KNhZ.js} +1 -1
  17. package/dist/assets/InteractiveCoursewareViewer-D5py6E0c.js +1 -0
  18. package/dist/assets/InteractiveWhiteboard-D5YKM1I6.js +77 -0
  19. package/dist/assets/LazyCourseware-DWCx60AO.js +2 -0
  20. package/dist/assets/LazyWhiteboard-CFn-1ATp.js +2 -0
  21. package/dist/assets/LessonEditorView-CfvhQfzG.js +1 -0
  22. package/dist/assets/LiveClassroomView-CB_0PN1X.js +59 -0
  23. package/dist/assets/{NotificationDetailModal-1MOkBDr_.js → NotificationDetailModal-DBg7UPZh.js} +1 -1
  24. package/dist/assets/PluginView-wozVlSXQ.js +66 -0
  25. package/dist/assets/{ProcessLogsModal-gZ9LILYM.js → ProcessLogsModal-DmFXg9mG.js} +1 -1
  26. package/dist/assets/QuizGeneratorModal-DnW-ff7D.js +1 -0
  27. package/dist/assets/StudentAssignmentView-tQiAv5Xn.js +1 -0
  28. package/dist/assets/StudentLessonView-DRwhbGoU.js +1 -0
  29. package/dist/assets/StudentPreviewModal-BQ_a7sQY.js +1 -0
  30. package/dist/assets/StudentView-XBaWzGO3.js +2 -0
  31. package/dist/assets/{SystemResourceLibraryModal-Ce-Dis6M.js → SystemResourceLibraryModal-Bcak0WSz.js} +1 -1
  32. package/dist/assets/TeacherView-961tBSMT.js +2 -0
  33. package/dist/assets/{TimetableView-0VaTfpz3.js → TimetableView-BQG-rEb5.js} +4 -4
  34. package/dist/assets/index-BQF_s4QO.js +217 -0
  35. package/dist/assets/index-CvGu7LSj.css +1 -0
  36. package/dist/assets/{index.es-CkgATcHw.js → index.es-C5eWEO4o.js} +1 -1
  37. package/dist/assets/{vendor-charts-U9fLlNC_.js → vendor-charts-qLbgF1eL.js} +1 -1
  38. package/dist/assets/{vendor-icons-30iiuCQb.js → vendor-icons-BRmhY6fg.js} +1 -1
  39. package/dist/assets/vendor-motion-BFAPOs-b.js +1 -0
  40. package/dist/assets/{vendor-pdf-Bw0ZQZtM.js → vendor-pdf-D7rGevI1.js} +3 -2
  41. package/dist/index.html +12 -13
  42. package/dist/server.cjs +4955 -623
  43. package/package.json +9 -4
  44. package/dist/assets/AdminDirectoryView-D-AOtp1o.js +0 -1
  45. package/dist/assets/ClassesView-DTuyCvYd.js +0 -19
  46. package/dist/assets/CloudDriveModal-Bi-aMuax.js +0 -1
  47. package/dist/assets/ComputerLabView-DWMtMSHV.js +0 -1
  48. package/dist/assets/CourseManagement-CeelAyst.js +0 -1
  49. package/dist/assets/CourseWizardModal-m7TDgcB2.js +0 -3
  50. package/dist/assets/CoursewareHubPanel-C4LQjt4v.js +0 -1
  51. package/dist/assets/Dashboard-CiBtG7Ge.js +0 -8
  52. package/dist/assets/HelpTour-00eT17Vg.js +0 -1
  53. package/dist/assets/InteractiveCoursewareViewer-DMMAs2k_.js +0 -1
  54. package/dist/assets/InteractiveWhiteboard-jpweQ094.js +0 -77
  55. package/dist/assets/LazyCourseware-DVgyrg3r.js +0 -2
  56. package/dist/assets/LazyWhiteboard-BSzsAPXC.js +0 -2
  57. package/dist/assets/LessonEditorView-D4g48fr5.js +0 -1
  58. package/dist/assets/LiveClassroomView-HQGhVwd_.js +0 -1
  59. package/dist/assets/PluginView-D8cQ8mLM.js +0 -65
  60. package/dist/assets/QuizGeneratorModal-BFCJe1cm.js +0 -1
  61. package/dist/assets/StudentAssignmentView-C34nleZT.js +0 -1
  62. package/dist/assets/StudentLessonView-DNbu2o04.js +0 -1
  63. package/dist/assets/StudentPreviewModal-BXbKzQgo.js +0 -1
  64. package/dist/assets/StudentView-BF2WjF4_.js +0 -2
  65. package/dist/assets/TeacherView-BySyCiZG.js +0 -2
  66. package/dist/assets/index-C7jMgry5.js +0 -216
  67. package/dist/assets/index-huP36ZNf.css +0 -1
  68. package/dist/assets/vendor-motion-DjY2czvL.js +0 -1
  69. /package/dist/assets/{vendor-content-CYR4BTuT.js → purify.es-CYR4BTuT.js} +0 -0
@@ -0,0 +1 @@
1
+ import{r as o,j as e}from"./vendor-react-B0t7H3hh.js";import{o as se,n as je,bm as A,bl as ye,T as ve,X as q,a3 as Ne,e as ne,U as re,f as we,R as ze,z as ae,i as Se,C as _e,bI as Ce}from"./vendor-icons-BRmhY6fg.js";import"./vendor-utils-m0Urvtws.js";function ke({computerLabs:m,onRefresh:_,lang:s,classes:u}){const[ie,w]=o.useState(!1),[C,L]=o.useState(null),[M,P]=o.useState(""),[p,T]=o.useState(5),[g,E]=o.useState(6),[k,x]=o.useState(""),[H,J]=o.useState(!1),[V,X]=o.useState(m.length>0?m[0].id:null),i=m.find(t=>t.id===(V||m[0]?.id)),[oe,G]=o.useState([]),[d,R]=o.useState(()=>{const t=m[0];if(!t)return null;const n=(u||[]).find(l=>l.lab_id===t.id);return n?n.id:null}),[$,K]=o.useState([]),[b,z]=o.useState([]),[le,Q]=o.useState(!1),[D,W]=o.useState(!1),[Y,O]=o.useState(""),[U,j]=o.useState(!1),[c,f]=o.useState(null);o.useEffect(()=>{u&&u.length>0?G(u):fetch("/api/classes").then(t=>t.ok?t.json():[]).then(t=>{Array.isArray(t)&&G(t)}).catch(t=>console.error("Failed to fetch classes in ComputerLabManager:",t))},[u]);const y=u&&u.length>0?u:oe,Z=o.useMemo(()=>i?y.filter(t=>t.lab_id===i.id):[],[y,i]);o.useEffect(()=>{if(!i)return;if(d){y.find(n=>n.id===d);return}const t=y.find(n=>n.lab_id===i.id);t&&R(t.id)},[i?.id,y]);const I=o.useCallback(async(t,n)=>{Q(!0),x(""),f(null);try{const[l,r]=await Promise.all([fetch(`/api/classes/${t}/seats`),fetch(`/api/classes/${t}/students`)]);let a=[];if(r.ok&&(a=await r.json(),K(a)),l.ok){const h=(await l.json()).seats||[],B=new Map(a.map(N=>[N.id,N])),fe=h.map(N=>{const te=B.get(N.student_id);return{...N,student_name:N.student_name||te?.name||"",student_number:N.student_number||te?.student_number||""}});z(fe)}j(!1)}catch(l){console.error("Error loading seating:",l),x(l.message||"Failed to load class seating data")}finally{Q(!1)}},[]);o.useEffect(()=>{d?I(d,i?.id):(K([]),z([]),j(!1),f(null))},[d,I]);const F=o.useMemo(()=>{const t=new Map;for(const n of b)t.set(`${n.row_idx}_${n.col_idx}`,n);return t},[b]),ee=o.useMemo(()=>new Set(b.map(t=>t.student_id)),[b]),S=o.useMemo(()=>$.filter(t=>!ee.has(t.id)).sort((t,n)=>String(t.student_number??t.name??"").localeCompare(String(n.student_number??n.name??""),"zh-Hans-CN",{numeric:!0})),[$,ee]),de=(t,n)=>{if(!d||!i)return;const l=F.get(`${t}_${n}`);if(c){const r={student_id:c.id,row_idx:t,col_idx:n,student_name:c.name,student_number:c.student_number};z(a=>[...a.filter(h=>h.student_id!==c.id&&!(h.row_idx===t&&h.col_idx===n)),r]),f(null),j(!0);return}if(l){const r=$.find(a=>a.id===l.student_id)||{id:l.student_id,name:l.student_name||"Student",student_number:l.student_number||""};f(r)}},ce=(t,n,l)=>{t.stopPropagation(),z(r=>r.filter(a=>!(a.row_idx===n&&a.col_idx===l))),j(!0)},xe=()=>{if(!i||S.length===0)return;const t=[];for(let r=0;r<i.rows;r++)for(let a=0;a<i.cols;a++)F.has(`${r}_${a}`)||t.push([r,a]);if(t.length===0)return;const l=S.slice(0,t.length).map((r,a)=>{const[v,h]=t[a];return{student_id:r.id,row_idx:v,col_idx:h,student_name:r.name,student_number:r.student_number}});z(r=>[...r,...l]),j(!0),f(null)},me=()=>{b.length!==0&&confirm(s==="zh"?"确定要清空当前班级在该机房的所有机位排座吗?":"Are you sure you want to clear all seat assignments for this class in this lab?")&&(z([]),j(!0),f(null))},ue=async()=>{if(!(!d||!i))try{W(!0),x(""),O("");const t=await fetch(`/api/classes/${d}/seats`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lab_id:i.id,seats:b.map(n=>({student_id:n.student_id,row_idx:n.row_idx,col_idx:n.col_idx}))})});if(t.ok)j(!1),O(s==="zh"?"统一机房排座已成功持久化至系统 student_seats 数据表!":"Seating assignments saved to system student_seats table successfully!"),_(),setTimeout(()=>O(""),4e3);else{const n=await t.json();x(n.error||"Failed to save seats")}}catch(t){x(t.message||"Network error saving seats")}finally{W(!1)}},he=()=>{P(""),T(5),E(6),x(""),L(null),w(!0)},pe=t=>{P(t.room_number),T(t.rows),E(t.cols),x(""),L(t.id),w(!0)},ge=async t=>{if(t.preventDefault(),!M.trim()){x(s==="zh"?"请输入机房编号/名称":"Please enter room name or number");return}if(p<=0||p>15){x(s==="zh"?"行数应在 1 至 15 之间":"Rows should be between 1 and 15");return}if(g<=0||g>15){x(s==="zh"?"列数应在 1 至 15 之间":"Columns should be between 1 and 15");return}try{J(!0),x("");const n=C?`/api/labs/${C}`:"/api/labs",r=await fetch(n,{method:C?"PUT":"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({room_number:M.trim(),rows:p,cols:g})});if(r.ok)_(),w(!1),L(null);else{const a=await r.json();x(a.error||"Server error saving lab")}}catch(n){x(n.message||"Network error")}finally{J(!1)}},be=async t=>{if(confirm(s==="zh"?"确定要删除该机房吗?删除后对应的座位分配也会被重置。":"Are you sure you want to delete this lab? Seat mappings will be cleared."))try{(await fetch(`/api/labs/${t}`,{method:"DELETE"})).ok&&(_(),V===t&&X(null))}catch(n){console.error(n)}};return e.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden",id:"lab_manager_root",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between pb-4 border-b border-gray-200 gap-4 shrink-0",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-xl font-bold text-gray-800 flex items-center gap-2",children:[e.jsx(se,{className:"text-indigo-600",size:24}),s==="zh"?"统一机房座位管理":"Unified Computer Lab Seating"]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s==="zh"?"维护物理机房规格及其行列排列规则,并直接根据班级信息读取并编排系统中已存的统一机房座位数据(student_seats 表)。":"Maintain physical lab layouts and manage unified student seat allocations directly synced with existing system data tables."})]}),e.jsxs("button",{onClick:he,className:"bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-xl text-xs font-semibold flex items-center gap-1.5 shadow-sm transition-all focus:ring-2 focus:ring-indigo-500 cursor-pointer",children:[e.jsx(je,{size:14}),s==="zh"?"新增机房规则":"New Lab Config"]})]}),e.jsxs("div",{className:"flex-1 min-h-0 grid grid-cols-1 lg:grid-cols-12 gap-6 pt-5 overflow-hidden",children:[e.jsxs("div",{className:"lg:col-span-4 flex flex-col min-h-0 bg-white border border-gray-200 rounded-2xl shadow-xs overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 bg-gray-50 flex justify-between items-center shrink-0",children:[e.jsx("span",{className:"text-xs font-bold text-gray-700 uppercase tracking-wider block",children:s==="zh"?"机房列表":"Computer Labs"}),e.jsx("span",{className:"bg-gray-200 text-gray-700 font-bold px-2 py-0.5 rounded-full text-xs",children:m.length})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:m.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center text-gray-400 h-full",children:[e.jsx(se,{size:40,className:"mb-2 opacity-30"}),e.jsx("p",{className:"text-xs font-medium",children:s==="zh"?"暂无机房编号规则":"No Computer Labs configured yet."}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s==="zh"?"点击右上角按钮添加首个机房规格。":"Click the button above to add your first computer room."})]}):m.map(t=>{const n=i?.id===t.id,l=y.filter(r=>r.lab_id===t.id);return e.jsxs("div",{onClick:()=>{X(t.id),w(!1)},className:`p-3 rounded-xl border transition-all cursor-pointer flex flex-col gap-2 group ${n?"border-indigo-300 bg-indigo-50/60 shadow-xs ring-1 ring-indigo-200":"border-gray-150 hover:border-gray-300 hover:bg-gray-50"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`p-2 rounded-lg ${n?"bg-indigo-600 text-white":"bg-gray-100 text-gray-500 group-hover:bg-gray-200"}`,children:e.jsx(A,{size:16})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold text-gray-800 flex items-center gap-1.5",children:t.room_number}),e.jsxs("div",{className:"text-xs text-gray-400 font-mono mt-0.5",children:[t.rows," ",s==="zh"?"行":"Rows"," × ",t.cols," ",s==="zh"?"列":"Cols",e.jsx("span",{className:"mx-1.5",children:"•"}),t.rows*t.cols," ",s==="zh"?"个机位":"Seats"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",children:[e.jsx("button",{onClick:r=>{r.stopPropagation(),pe(t)},className:"p-1 text-gray-500 hover:text-indigo-600 hover:bg-white rounded transition-colors",title:s==="zh"?"编辑规则":"Edit Rule",children:e.jsx(ye,{size:13})}),e.jsx("button",{onClick:r=>{r.stopPropagation(),be(t.id)},className:"p-1 text-gray-500 hover:text-rose-600 hover:bg-white rounded transition-colors",title:s==="zh"?"删除机房间":"Delete Lab",children:e.jsx(ve,{size:14})})]})]}),l.length>0&&e.jsxs("div",{className:"flex items-center gap-1 flex-wrap pt-1 border-t border-gray-100/80",children:[e.jsx("span",{className:"text-[10px] text-gray-400 font-medium",children:s==="zh"?"绑定班级:":"Bound:"}),l.map(r=>e.jsx("span",{className:"text-[10px] font-semibold bg-indigo-100/70 text-indigo-700 px-1.5 py-0.5 rounded-md",children:r.name},r.id))]})]},t.id)})})]}),e.jsx("div",{className:"lg:col-span-8 flex flex-col min-h-0 bg-white border border-gray-200 rounded-2xl shadow-xs overflow-hidden",children:ie?e.jsxs("form",{onSubmit:ge,className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 bg-gray-50 font-bold text-xs text-gray-700 uppercase tracking-wider shrink-0 flex items-center justify-between",children:[e.jsx("span",{children:C?s==="zh"?"编辑机房规则":"Edit Lab Seating":s==="zh"?"创建全新上机机房":"Create Computer Lab"}),e.jsx("button",{type:"button",onClick:()=>w(!1),className:"text-gray-400 hover:text-gray-600",children:e.jsx(q,{size:16})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:[k&&e.jsxs("div",{className:"p-3 bg-red-50 border border-red-200 text-red-700 text-xs rounded-xl flex items-center gap-1.5",children:[e.jsx(Ne,{size:14}),e.jsx("span",{children:k})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wide",children:s==="zh"?"机房编号 / 场所名称 *":"Lab Name / Number *"}),e.jsx("input",{type:"text",value:M,onChange:t=>P(t.target.value),placeholder:s==="zh"?"例如:305综合机房、软创中心、Lab A":"e.g. Lab 404, Software Sandbox, Suite C",className:"w-full text-xs p-2.5 border border-gray-300 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 rounded-xl mt-1.5",maxLength:32,required:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wide",children:s==="zh"?"排列行数 (Rows) *":"Rows Direction *"}),e.jsx("input",{type:"number",value:p,onChange:t=>T(Math.max(1,parseInt(t.target.value)||1)),min:1,max:15,className:"w-full text-xs p-2.5 border border-gray-300 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 rounded-xl mt-1.5",required:!0}),e.jsx("span",{className:"text-xs text-gray-400 block mt-0.5",children:s==="zh"?"上下方向机位数 (最大15行)":"Horizontal sets count (Max 15)"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wide",children:s==="zh"?"排列列数 (Columns) *":"Columns Direction *"}),e.jsx("input",{type:"number",value:g,onChange:t=>E(Math.max(1,parseInt(t.target.value)||1)),min:1,max:15,className:"w-full text-xs p-2.5 border border-gray-300 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500 rounded-xl mt-1.5",required:!0}),e.jsx("span",{className:"text-xs text-gray-400 block mt-0.5",children:s==="zh"?"左右方向机位数 (最大15列)":"Vertical sets count (Max 15)"})]})]}),e.jsxs("div",{className:"border border-dashed border-gray-200 bg-gray-50/50 p-4 rounded-xl",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block mb-2",children:s==="zh"?"布局网格缩略结构":"Layout Aspect Schema"}),e.jsxs("div",{className:"flex flex-col gap-1 items-center justify-center p-3 bg-white rounded-lg border border-gray-100 min-h-[120px]",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[Array.from({length:Math.min(p,6)}).map((t,n)=>e.jsxs("div",{className:"flex gap-1 justify-center",children:[Array.from({length:Math.min(g,8)}).map((l,r)=>e.jsx("div",{className:"w-4 h-4 rounded bg-indigo-100 border border-indigo-200 shrink-0"},r)),g>8&&e.jsx("div",{className:"w-4 text-xs text-gray-400 flex items-center justify-center",children:"..."})]},n)),p>6&&e.jsx("div",{className:"text-xs text-center text-gray-400 mt-1",children:"..."})]}),e.jsxs("span",{className:"text-xs text-gray-450 mt-3 font-medium",children:["配置容量:",p," × ",g," = ",p*g," 座位"]})]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 shrink-0 flex items-center justify-end gap-2 bg-gray-50",children:[e.jsx("button",{type:"button",onClick:()=>w(!1),className:"px-4 py-2 text-xs font-semibold text-gray-500 hover:text-gray-700 bg-white hover:bg-gray-100 border border-gray-200 rounded-xl transition-all cursor-pointer",children:s==="zh"?"取消":"Cancel"}),e.jsxs("button",{type:"submit",disabled:H,className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 rounded-xl flex items-center gap-1 shadow-sm transition-all cursor-pointer",children:[e.jsx(ne,{size:14}),e.jsx("span",{children:H?s==="zh"?"提交中...":"Saving...":s==="zh"?"提交保存":"Save Config"})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"p-3 border-b border-gray-100 bg-gray-50 flex flex-wrap items-center justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs font-bold text-gray-700 uppercase tracking-wider flex items-center gap-1.5",children:[e.jsx(re,{size:14,className:"text-indigo-600"}),s==="zh"?"班级机位联动:":"Class Seating Link:"]}),e.jsxs("select",{value:d||"",onChange:t=>R(t.target.value?t.target.value:null),className:"text-xs font-semibold bg-white border border-gray-300 rounded-lg px-2.5 py-1.5 text-gray-700 focus:outline-none focus:ring-1 focus:ring-indigo-500 cursor-pointer shadow-2xs",children:[e.jsx("option",{value:"",children:s==="zh"?"📐 物理规格总览 (无班级)":"📐 Physical Blueprint (No Class)"}),y.map(t=>{const n=t.lab_id===i?.id;return e.jsxs("option",{value:t.id,children:[t.name," ",n?s==="zh"?"★ 已绑定此机房":"★ Bound":""]},t.id)})]})]}),d&&i&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:xe,disabled:S.length===0,className:"px-2.5 py-1.5 text-xs font-semibold bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 rounded-lg flex items-center gap-1 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",title:s==="zh"?"将未排座学生按学号依次填入空闲机位":"Auto assign unplaced students",children:[e.jsx(we,{size:13}),e.jsx("span",{children:s==="zh"?"一键排座":"Auto Fill"})]}),e.jsxs("button",{type:"button",onClick:me,disabled:b.length===0,className:"px-2.5 py-1.5 text-xs font-semibold bg-gray-100 hover:bg-rose-50 text-gray-600 hover:text-rose-600 border border-gray-200 rounded-lg flex items-center gap-1 transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",title:s==="zh"?"清空当前班级排座":"Clear Seating",children:[e.jsx(ze,{size:13}),e.jsx("span",{children:s==="zh"?"清空":"Clear"})]}),e.jsxs("button",{type:"button",onClick:ue,disabled:D||!U&&!i,className:`px-3 py-1.5 text-xs font-bold rounded-lg flex items-center gap-1.5 shadow-xs transition-all cursor-pointer ${U?"bg-emerald-600 hover:bg-emerald-700 text-white animate-pulse":"bg-indigo-600 hover:bg-indigo-700 text-white disabled:opacity-60 disabled:cursor-not-allowed"}`,children:[D?e.jsx(ae,{size:13,className:"animate-spin"}):e.jsx(Se,{size:13}),e.jsx("span",{children:D?s==="zh"?"保存中...":"Saving...":U?s==="zh"?"保存排座 (已修改)":"Save (Modified)":s==="zh"?"已保存":"Saved"})]})]})]}),Y&&e.jsxs("div",{className:"bg-emerald-50 border-b border-emerald-200 text-emerald-800 text-xs px-4 py-2 flex items-center gap-1.5 animate-fadeIn",children:[e.jsx(ne,{size:14,className:"text-emerald-600 shrink-0"}),e.jsx("span",{className:"font-medium",children:Y})]}),k&&e.jsxs("div",{className:"bg-red-50 border-b border-red-200 text-red-700 text-xs px-4 py-2 flex items-center gap-1.5",children:[e.jsx(_e,{size:14,className:"text-red-500 shrink-0"}),e.jsx("span",{children:k})]}),i?e.jsxs("div",{className:"flex-1 flex flex-col min-h-0 bg-slate-950 text-white overflow-hidden relative",children:[e.jsx("div",{className:"py-2.5 flex justify-center shrink-0 border-b border-slate-900 bg-slate-950/80 backdrop-blur-xs z-10",children:e.jsx("div",{className:"w-56 bg-slate-900 border border-slate-700 py-1 rounded text-center text-xs font-bold text-slate-300 uppercase tracking-widest select-none shadow-sm flex items-center justify-center gap-1.5",children:e.jsxs("span",{children:["📽️ ",s==="zh"?"讲台 / 教师主荧幕":"Classroom Stage / Screen"]})})}),e.jsx("div",{className:"flex-1 overflow-auto p-4 flex flex-col items-center",children:le?e.jsxs("div",{className:"flex flex-col items-center justify-center h-48 gap-2 text-slate-400",children:[e.jsx(ae,{size:24,className:"animate-spin text-indigo-400"}),e.jsx("span",{className:"text-xs",children:s==="zh"?"正在读取统一机房座位数据...":"Loading lab seating data..."})]}):e.jsx("div",{className:"flex flex-col gap-2.5 py-2 max-w-full",children:Array.from({length:i.rows}).map((t,n)=>e.jsxs("div",{className:"flex gap-2.5 justify-center items-center",children:[e.jsxs("span",{className:"text-xs font-bold font-mono text-slate-500 w-6 text-right select-none pr-0.5",children:["R",n+1]}),Array.from({length:i.cols}).map((l,r)=>{const a=F.get(`${n}_${r}`),v=!!a,h=c&&(!v||a.student_id!==c.id);return e.jsx("div",{onClick:()=>de(n,r),className:`group relative rounded-xl flex flex-col items-center justify-center transition-all select-none shadow-sm cursor-pointer ${d?"w-20 h-14":"w-11 h-11"} ${v?"bg-slate-850 border border-indigo-500/70 hover:border-indigo-400 shadow-indigo-950/50":h?"bg-indigo-950/40 border border-dashed border-indigo-400 hover:bg-indigo-900/50 ring-1 ring-indigo-400/50 animate-pulse":"bg-slate-900 border border-slate-800 hover:border-slate-700 hover:bg-slate-850"}`,children:v?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"w-full h-full p-1.5 flex flex-col justify-between items-center text-center",children:[e.jsxs("div",{className:"flex items-center justify-between w-full px-0.5",children:[e.jsxs("span",{className:"text-[10px] font-mono text-indigo-300/80",children:[n+1,"-",r+1]}),d&&e.jsx("button",{type:"button",onClick:B=>ce(B,n,r),className:"opacity-0 group-hover:opacity-100 text-slate-400 hover:text-rose-400 p-0.5 rounded transition-opacity",title:s==="zh"?"移出此座位":"Unseat student",children:e.jsx(q,{size:11})})]}),e.jsx("div",{className:"font-bold text-xs text-white truncate max-w-[70px] leading-tight",children:a.student_name||"Student"}),e.jsx("div",{className:"text-[9px] font-mono text-slate-400 truncate max-w-[70px]",children:a.student_number||`ID:${a.student_id.slice(-4)}`})]}),e.jsxs("div",{className:"absolute bottom-16 bg-slate-900 text-white text-xs rounded-lg px-2.5 py-1.5 hidden group-hover:block whitespace-nowrap z-30 font-sans border border-indigo-700 shadow-2xl pointer-events-none",children:[e.jsx("div",{className:"font-bold text-indigo-300",children:a.student_name}),e.jsxs("div",{className:"text-[10px] text-slate-400 font-mono",children:[s==="zh"?"学号:":"No: ",a.student_number||a.student_id]}),e.jsx("div",{className:"text-[10px] text-slate-300 mt-0.5",children:s==="zh"?`第 ${n+1} 排,第 ${r+1} 列`:`Row ${n+1}, Col ${r+1}`})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(A,{size:d?14:15,className:h?"text-indigo-400 animate-bounce":"text-slate-600 opacity-60"}),e.jsxs("span",{className:"text-[10px] font-mono text-slate-500 mt-0.5",children:[n+1,"-",r+1]}),e.jsx("div",{className:"absolute bottom-12 bg-slate-900 text-white text-xs rounded px-2 py-1 hidden group-hover:block whitespace-nowrap z-30 font-sans border border-slate-700 shadow-xl pointer-events-none",children:c?s==="zh"?`点击安排 [${c.name}] 到第 ${n+1} 排第 ${r+1} 列`:`Place [${c.name}] here`:s==="zh"?`第 ${n+1} 排第 ${r+1} 列 (空闲)`:`Row ${n+1} / Column ${r+1} (Empty)`})]})},r)})]},n))})}),d?e.jsxs("div",{className:"border-t border-slate-900 bg-slate-900/90 p-3 shrink-0 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"font-bold text-slate-300 flex items-center gap-1.5",children:[e.jsx(re,{size:13,className:"text-indigo-400"}),s==="zh"?"待排座学生池:":"Unassigned Students Pool:"]}),e.jsxs("span",{className:"text-[11px] font-mono text-slate-400",children:[S.length," ",s==="zh"?"人未排":"unplaced"," /"," ",$.length," ",s==="zh"?"人总计":"total"]}),c&&e.jsxs("span",{className:"bg-indigo-900/80 text-indigo-300 border border-indigo-700 text-[11px] px-2 py-0.5 rounded-full flex items-center gap-1 animate-pulse",children:[e.jsx("span",{children:s==="zh"?`当前选择: ${c.name} (点击上方空位落座)`:`Selected: ${c.name} (click empty seat)`}),e.jsx("button",{type:"button",onClick:()=>f(null),className:"hover:text-white",children:e.jsx(q,{size:10})})]})]}),e.jsxs("div",{className:"text-[11px] font-mono text-slate-400",children:[s==="zh"?"机房已占:":"Occupied: ",e.jsx("span",{className:"text-indigo-400 font-bold",children:b.length})," /"," ",i.rows*i.cols]})]}),S.length===0?e.jsxs("div",{className:"text-xs text-slate-500 py-1 italic flex items-center gap-1",children:[e.jsx(Ce,{size:13,className:"text-emerald-400"}),e.jsx("span",{children:s==="zh"?"当前班级全部学生均已成功分配机位!":"All students in this class have been assigned seats!"})]}):e.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto py-1 max-h-16 pr-2",children:S.map(t=>{const n=c?.id===t.id;return e.jsxs("button",{type:"button",onClick:()=>f(n?null:t),className:`shrink-0 px-2.5 py-1 rounded-lg text-xs font-medium border transition-all cursor-pointer flex items-center gap-1.5 ${n?"bg-indigo-600 text-white border-indigo-400 ring-2 ring-indigo-400/50 shadow-md":"bg-slate-800 text-slate-300 border-slate-700 hover:border-indigo-500 hover:bg-slate-750"}`,children:[e.jsx("span",{children:t.name}),t.student_number&&e.jsx("span",{className:"text-[10px] font-mono text-slate-400",children:t.student_number})]},t.id)})})]}):e.jsxs("div",{className:"border-t border-slate-900 bg-slate-900/60 p-3 shrink-0 flex items-center justify-between text-xs text-slate-400 select-none",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-3.5 h-3.5 rounded bg-slate-800 border border-slate-700 flex items-center justify-center p-0.5",children:e.jsx(A,{size:10,className:"text-indigo-400 opacity-60"})}),e.jsx("span",{children:s==="zh"?"标准上机终端":"Console Terminals"})]}),Z.length>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-slate-500",children:s==="zh"?"已绑定班级:":"Bound Classes:"}),Z.map(t=>e.jsx("button",{type:"button",onClick:()=>R(t.id),className:"text-indigo-400 hover:text-indigo-300 underline font-semibold text-xs cursor-pointer ml-1",children:t.name},t.id))]})]}),e.jsxs("div",{className:"font-mono text-slate-500",children:[s==="zh"?"总行数:":"Rows: ",e.jsx("span",{className:"text-indigo-400 font-bold",children:i.rows})," |",s==="zh"?" 总列数:":" Columns: ",e.jsx("span",{className:"text-indigo-400 font-bold",children:i.cols})," |",s==="zh"?" 配置席位:":" Total: ",e.jsx("span",{className:"text-white font-bold",children:i.rows*i.cols})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center p-8 text-gray-400 h-full",children:[e.jsx(A,{size:48,className:"opacity-20 mb-3"}),e.jsx("p",{className:"text-xs font-medium",children:s==="zh"?"请选择一个机房以预览其座位图":"Please select a lab config to preview details."})]})]})})]})]})}function Me({computerLabs:m,onRefresh:_,lang:s,classes:u=[]}){return e.jsx(ke,{computerLabs:m,onRefresh:_,lang:s,classes:u})}export{Me as ComputerLabView};
@@ -0,0 +1 @@
1
+ import{r as i,j as e}from"./vendor-react-B0t7H3hh.js";import{a as G,M as H}from"./index-BQF_s4QO.js";import{B as y,d as Y,n as D,aF as _,X as Q,bI as ee,U as $,bJ as te,bK as se,b0 as re,E as ie,j as ae,T as A,a4 as oe,z as M}from"./vendor-icons-BRmhY6fg.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-D7rGevI1.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-pptx-C5-U7ieS.js";import"./vendor-charts-qLbgF1eL.js";function be({lang:s,session:I,lessons:d,lessonsSearchQuery:m,setLessonsSearchQuery:h,lessonsSortOrder:L,setLessonsSortOrder:T,filteredLessons:u,onOpenImportLessons:E,onOpenCourseWizard:f,onViewCourse:j,onDeleteCourse:F,onCopyCourse:O,filterEnrollment:N,setFilterEnrollment:R,filterHasContent:v,setFilterHasContent:U,filterThisMonth:w,setFilterThisMonth:B,copyingLessonId:V}){const P=G(t=>t.session),r=I||P,W=r?.username==="admin"||r?.userId==="usr_admin"||r?.role==="administrator"||r?.subRole==="administrator",[b,Z]=i.useState(!1),[a,g]=i.useState(null),[o,n]=i.useState(null),[z,C]=i.useState(!1),[J,k]=i.useState(!1),[c,S]=i.useState(null),K=t=>{navigator.clipboard.writeText(t).then(()=>{S(t),setTimeout(()=>S(null),1500)})},X=async t=>{g(t),n(null),k(!0);try{const x=await fetch(`/api/lessons/${t.id}/stats`);if(x.ok){const l=await x.json();n(l)}}catch{n({whiteboardCount:0,scheduleCount:0,enrollmentCount:0,assignmentCount:0})}finally{k(!1)}},q=async()=>{if(a){C(!0);try{await F(a.id),g(null),n(null)}finally{C(!1)}}};return e.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-y-auto",children:[e.jsxs("div",{className:"flex-1 bg-white border border-gray-200 rounded-xl shadow-sm flex flex-col min-h-0",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between shrink-0",children:[e.jsxs("h3",{className:"font-medium text-gray-700 flex items-center gap-2",children:[e.jsx(y,{size:16,className:"text-gray-400"}),s==="zh"?"课程与教学环节管理 (SQLite)":"Courses & Lessons Management"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{id:"import-lessons-csv-btn",onClick:E,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold rounded-lg shadow-3xs transition-all hover:shadow-xs hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(Y,{size:14}),s==="zh"?"批量导入课程 (CSV)":"Import Lessons (CSV)"]}),e.jsxs("button",{id:"add-course-wizard-btn",onClick:f,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs bg-indigo-600 hover:bg-indigo-700 text-white font-semibold rounded-lg shadow-sm transition-all hover:shadow-md hover:-translate-y-0.5 cursor-pointer",children:[e.jsx(D,{size:14}),s==="zh"?"手动添加课程 (向导)":"Add Course Wizard"]})]})]}),d.length>0&&e.jsxs("div",{className:"px-5 py-3.5 border-b border-gray-100 bg-gray-50/50 flex flex-col sm:flex-row items-center justify-between gap-3 shrink-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative w-full sm:w-64",children:[e.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-gray-400",children:e.jsx(_,{size:14})}),e.jsx("input",{type:"text",placeholder:"Search courses by title...",value:m,onChange:t=>h(t.target.value),className:"w-full pl-9 pr-8 py-1.5 text-xs bg-white border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 shadow-sm"}),m&&e.jsx("button",{onClick:()=>h(""),className:"absolute inset-y-0 right-0 flex items-center pr-2.5 text-gray-400 hover:text-gray-600",children:e.jsx(Q,{size:12,className:"bg-gray-100 hover:bg-gray-200 rounded-full p-0.5"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider",children:s==="zh"?"排序方式:":"Sort by:"}),e.jsxs("select",{value:L,onChange:t=>T(t.target.value),className:"bg-white border border-gray-200 text-xs text-gray-755 font-bold px-2.5 py-1.5 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-sm",id:"courses-sort-select",children:[e.jsx("option",{value:"recent",children:s==="zh"?"最新创建":"Most Recent"}),e.jsx("option",{value:"alphabetical",children:s==="zh"?"按名称 (A-Z)":"Alphabetical (A-Z)"}),e.jsx("option",{value:"enrollment",children:s==="zh"?"学生选课人次":"Student Enrollment Count"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{onClick:()=>Z(!b),className:`px-2 py-1 text-xs font-bold rounded-md border transition-all cursor-pointer ${b?"bg-indigo-600 text-white border-indigo-600 shadow-2xs":"bg-white text-gray-600 border-gray-200 hover:border-gray-300"}`,title:s==="zh"?"只看我创建的课程":"Only show courses created by me",children:[e.jsx(ee,{size:11,className:"inline mr-0.5 -mt-0.5"}),s==="zh"?"我的备课":"My Courses"]}),e.jsxs("button",{onClick:()=>R(!N),className:`px-2 py-1 text-xs font-bold rounded-md border transition-all cursor-pointer ${N?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx($,{size:11,className:"inline mr-0.5 -mt-0.5"}),s==="zh"?"有人选":"Enrolled"]}),e.jsxs("button",{onClick:()=>U(!v),className:`px-2 py-1 text-xs font-bold rounded-md border transition-all cursor-pointer ${v?"bg-indigo-50 text-indigo-700 border-indigo-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:[e.jsx(y,{size:11,className:"inline mr-0.5 -mt-0.5"}),s==="zh"?"有内容":"Has Content"]}),e.jsx("button",{onClick:()=>B(!w),className:`px-2 py-1 text-xs font-bold rounded-md border transition-all cursor-pointer ${w?"bg-amber-50 text-amber-700 border-amber-200":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"}`,children:s==="zh"?"本月":"This Month"})]}),e.jsxs("div",{className:"text-xs font-semibold text-gray-500",children:["Found ",e.jsx("span",{className:"text-indigo-650 font-bold",children:u.length})," of"," ",e.jsx("span",{className:"text-gray-700 font-bold",children:d.length})," course",d.length===1?"":"s"]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:d.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 min-h-[300px]",children:[e.jsx(y,{size:48,className:"mb-4 opacity-30 text-indigo-500"}),e.jsx("h3",{className:"text-lg font-bold text-gray-800",children:s==="zh"?"暂无可用课程":"No Courses Available"}),e.jsx("p",{className:"mt-2 text-sm text-gray-500 text-center max-w-xs",children:s==="zh"?"系统中暂未部署任何课程。请通过下方按钮启动添加向导指南。":"There are no courses active in the system yet. Build your first curriculum!"}),e.jsxs("button",{id:"empty-add-course-btn",onClick:f,className:"mt-5 flex items-center gap-2 px-5 py-2.5 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-md transition-all cursor-pointer",children:[e.jsx(D,{size:16}),s==="zh"?"使用向导指南来创建新课程":"Create Course via Wizard"]})]}):u.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-gray-450 text-center",children:[e.jsx(_,{size:44,className:"mb-3 opacity-30 text-gray-450"}),e.jsxs("h4",{className:"font-semibold text-gray-700 text-sm",children:['No Courses Match "',m,'"']}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 max-w-xs",children:"Double-check the spelling or try searching for another curriculum keyword."}),e.jsx("button",{onClick:()=>h(""),className:"mt-3 text-xs bg-indigo-50 hover:bg-indigo-100 text-indigo-700 border border-indigo-200 font-semibold px-3 py-1.5 rounded-lg transition-colors",children:"Clear Search Filter"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:u.filter(t=>b?!t.creator_id||t.creator_id===r?.userId||t.creator_id===r?.username:!0).map(t=>{const x=V===t.id,l=!t.creator_id||t.creator_id===r?.userId||t.creator_id===r?.username,p=W||l;return e.jsxs("div",{className:`border border-gray-200 hover:border-indigo-300 rounded-xl p-4 flex flex-col bg-gray-50/50 hover:shadow-md transition-all ${x?"opacity-60 pointer-events-none":""}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 gap-2",children:[e.jsx("div",{className:"font-semibold text-gray-800 text-lg truncate cursor-pointer hover:text-indigo-600 transition-colors",title:t.title,onClick:()=>j(t.id),children:t.title}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[t.creator_name?e.jsxs("span",{className:`text-xs font-medium px-1.5 py-0.5 rounded border flex items-center gap-0.5 ${l?"bg-indigo-50 text-indigo-700 border-indigo-200 font-semibold":"bg-slate-100 text-slate-600 border-slate-200"}`,title:s==="zh"?`创建教师: ${t.creator_name}`:`Created by: ${t.creator_name}`,children:[l?"👑 ":"👤 ",t.creator_name]}):null,e.jsxs("span",{className:"inline-flex items-center gap-1 bg-indigo-50 text-indigo-700 px-1.5 py-0.5 border border-indigo-100 rounded text-xs font-bold",children:[e.jsx($,{size:10,className:"text-indigo-500"}),t.enrollment_count||0]})]})]}),e.jsx("div",{className:"text-sm text-gray-500 line-clamp-3 mb-4 flex-1",children:e.jsx(H,{children:t.content})}),e.jsxs("div",{className:"flex justify-between items-center mt-auto",children:[e.jsxs("button",{onClick:()=>K(t.id),className:`flex items-center gap-1 text-xs rounded px-1.5 py-0.5 transition-all cursor-pointer ${c===t.id?"text-emerald-600 bg-emerald-50 border border-emerald-200":"text-gray-400 hover:text-indigo-600 hover:bg-indigo-50 border border-transparent"}`,title:c===t.id?s==="zh"?"已复制!":"Copied!":s==="zh"?"复制课程 ID":"Copy Course ID",children:[c===t.id?e.jsx(te,{size:12}):e.jsx(se,{size:12}),e.jsx("span",{className:"font-mono",children:c===t.id?s==="zh"?"已复制!":"Copied!":`${t.id.substring(0,8)}…`})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("button",{onClick:()=>j(t.id),className:"p-1.5 text-gray-400 hover:text-indigo-600 hover:bg-indigo-50 rounded transition-colors cursor-pointer",title:p?s==="zh"?"查看与编辑":"View & Edit":s==="zh"?"查看只读 (他人课程)":"View Read-Only",children:p?e.jsx(re,{size:15}):e.jsx(ie,{size:15})}),e.jsx("button",{onClick:()=>O(t.id),className:"p-1.5 text-gray-400 hover:text-emerald-600 hover:bg-emerald-50 rounded transition-colors cursor-pointer",title:s==="zh"?"克隆为我的备课":"Clone Course",children:e.jsx(ae,{size:14})}),p?e.jsx("button",{onClick:()=>X(t),className:"p-1.5 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded transition-colors cursor-pointer",title:s==="zh"?"删除课程":"Delete Course",children:e.jsx(A,{size:14})}):e.jsx("span",{className:"p-1.5 text-gray-300 cursor-not-allowed",title:s==="zh"?"仅创建教师或管理员可删除":"Only creator or admin can delete",children:e.jsx(A,{size:14})})]})]})]},t.id)})})})]}),a&&e.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-[2px] flex items-center justify-center z-[9999] p-4",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-2xl max-w-md w-full border border-gray-100 overflow-hidden",children:[e.jsxs("div",{className:"px-5 py-4 border-b border-gray-100 bg-red-50 flex items-center gap-2",children:[e.jsx(oe,{size:18,className:"text-red-600"}),e.jsx("h3",{className:"font-bold text-red-800 text-sm",children:s==="zh"?"确认删除课程":"Confirm Course Deletion"})]}),e.jsxs("div",{className:"p-5 space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-700",children:s==="zh"?e.jsxs(e.Fragment,{children:["确定要删除课程 ",e.jsx("span",{className:"font-bold text-red-600",children:a.title})," 吗?"]}):e.jsxs(e.Fragment,{children:["Are you sure you want to delete ",e.jsx("span",{className:"font-bold text-red-600",children:a.title}),"?"]})}),e.jsx("p",{className:"text-xs text-red-600 font-medium",children:s==="zh"?"此操作不可撤销,将删除课程的所有关联数据。":"This action is irreversible and will delete all associated data."}),J?e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500 py-2",children:[e.jsx(M,{size:14,className:"animate-spin"}),s==="zh"?"正在统计关联数据...":"Counting related data..."]}):o?e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:s==="zh"?"白板元素":"Whiteboard Elements"}),e.jsx("span",{className:"font-bold text-gray-800",children:o.whiteboardCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:s==="zh"?"排课记录":"Schedules"}),e.jsx("span",{className:"font-bold text-gray-800",children:o.scheduleCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:s==="zh"?"选课学生":"Enrollments"}),e.jsx("span",{className:"font-bold text-gray-800",children:o.enrollmentCount})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-600",children:s==="zh"?"作业任务":"Assignments"}),e.jsx("span",{className:"font-bold text-gray-800",children:o.assignmentCount})]})]}):null]}),e.jsxs("div",{className:"px-5 py-3 border-t border-gray-100 bg-gray-50 flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>{g(null),n(null)},className:"px-4 py-2 text-xs font-medium text-gray-600 hover:bg-gray-100 border border-gray-200 rounded-lg transition-colors cursor-pointer",children:s==="zh"?"取消":"Cancel"}),e.jsxs("button",{onClick:q,disabled:z,className:"px-4 py-2 text-xs font-bold text-white bg-red-600 hover:bg-red-700 rounded-lg transition-colors cursor-pointer disabled:opacity-50 flex items-center gap-1.5",children:[z&&e.jsx(M,{size:12,className:"animate-spin"}),s==="zh"?"确认删除":"Confirm Delete"]})]})]})})]})}export{be as CourseManagement};
@@ -0,0 +1,3 @@
1
+ import{j as e,r as f}from"./vendor-react-B0t7H3hh.js";import{m as D,M as P}from"./index-BQF_s4QO.js";import{B as y,f as j,w as W,n as L,r as I,t as v,N as E,z as M}from"./vendor-icons-BRmhY6fg.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-D7rGevI1.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-pptx-C5-U7ieS.js";import"./vendor-charts-qLbgF1eL.js";function Q(z){const{isCourseWizardOpen:w,setIsCourseWizardOpen:N,lang:t,wizardStep:o,setWizardStep:p,wizardIsSubmitting:x,wizardCourseTitle:g,setWizardCourseTitle:C,wizardCourseDescription:u,setWizardCourseDescription:k,wizardCourseCategory:n,setWizardCourseCategory:S,wizardCourseTimeline:a,setWizardCourseTimeline:c,wizardCourseContent:m,setWizardCourseContent:h,addToast:b,generateTemplateContent:T,handleDeployWizardCourse:A}=z;return e.jsx(e.Fragment,{children:w&&e.jsx("div",{className:"fixed inset-0 bg-gray-900/50 backdrop-blur-sm flex items-center justify-center p-4 md:p-6 z-50 overflow-y-auto text-gray-850",children:e.jsxs(D.div,{initial:{opacity:0,y:15,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},className:"bg-white border text-gray-900 border-gray-250 rounded-2xl shadow-2xl w-full max-w-4xl flex flex-col overflow-hidden max-h-[92vh] font-sans text-left",children:[e.jsxs("div",{className:"p-4 md:p-5 border-b border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 border border-indigo-100 rounded-lg text-indigo-650",children:e.jsx(y,{size:20,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-gray-850 text-base md:text-lg",children:t==="zh"?"⭐ 互动课程发布与时间轴向导":"⭐ Course Design Guide & Wizard"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:t==="zh"?"遵循系统设计法,逐步构建您的学科专属教案与课堂时间轴流程。":"Follow best practices to define curriculum content, timeline segments, and deploy."})]})]}),e.jsx("button",{onClick:()=>N(!1),className:"text-gray-400 hover:text-gray-650 font-bold p-1 rounded-lg hover:bg-gray-150 transition-all text-xl leading-none",children:"×"})]}),e.jsx("div",{className:"px-6 py-4.5 border-b border-gray-50 bg-slate-50/50 flex items-center justify-between gap-2 shrink-0 select-none",children:[{step:1,zh:"1内容选题",en:"1 Background"},{step:2,zh:"2课堂脉络",en:"2 Timeslots"},{step:3,zh:"3编写大纲",en:"3 Syllabus"},{step:4,zh:"4总览部署",en:"4 Deploy"}].map((r,i)=>{const l=o===r.step,s=o>r.step;return e.jsxs(f.Fragment,{children:[e.jsxs("div",{onClick:()=>!x&&p(r.step),className:`flex items-center gap-2 cursor-pointer transition-all ${l?"text-indigo-650 font-boldScale":s?"text-emerald-600 font-medium":"text-gray-400 hover:text-gray-600"}`,children:[e.jsx("div",{className:`w-5 h-5 rounded-full flex items-center justify-center text-xs border ${l?"bg-indigo-600 border-indigo-600 text-white shadow-xs font-bold":s?"bg-emerald-50 border-emerald-500 text-emerald-600 font-bold":"bg-white border-gray-250 text-gray-500"}`,children:s?"✓":r.step}),e.jsx("span",{className:"text-xs font-semibold hidden sm:inline",children:t==="zh"?r.zh:r.en})]}),i<3&&e.jsx("div",{className:`flex-1 h-0.5 max-w-[40px] md:max-w-none transition-all ${o>r.step?"bg-emerald-500":"bg-gray-200"}`})]},r.step)})}),e.jsxs("div",{className:"flex-grow overflow-y-auto p-5 md:p-6 space-y-5",children:[o===1&&e.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200 text-left",children:[e.jsxs("div",{className:"bg-indigo-50/70 py-3.5 px-4.5 rounded-xl border border-indigo-100 text-xs text-indigo-750 font-sans leading-relaxed flex items-start gap-2",children:[e.jsx(j,{size:16,className:"text-indigo-500 shrink-0 mt-0.5 animate-bounce"}),e.jsxs("div",{children:[e.jsx("strong",{children:t==="zh"?"设计理念:":"Instructional ConceptTip:"}),e.jsx("p",{className:"mt-0.5",children:t==="zh"?"一个高品质的课程往往始于明确的选题背景。选择适当的学科科目分类,系统不仅会按您的选择在后续步骤推荐量身定做的教案摸板,还可以一键预装适合该学科的课堂互动时间轴模板。":"Selecting a clear title and specific subject category helps pre-populate customized Markdown content outlines and specialized scheduling presets."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 font-sans",children:[e.jsxs("div",{className:"md:col-span-2 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"📍 课程/课件名称 *":"📍 Course Title *"}),e.jsx("input",{type:"text",required:!0,value:g,onChange:r=>C(r.target.value),placeholder:t==="zh"?"例:西方哲学:康德的三大批判、Python编程入门、高中物理电路并联原理":"e.g. Introduction to regressions, Western Philosophies, Lever Principles",className:"w-full px-4 py-3 border border-gray-250 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 text-sm shadow-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"🎯 课程设计简介与要点说明 (Objectives)":"🎯 Description & Lesson Objectives"}),e.jsx("textarea",{rows:4,value:u,onChange:r=>k(r.target.value),placeholder:t==="zh"?"在此处编写您的授课背景、面向学段及最关键的 2-3 个核心教学总目标。":"Write a short description stating learning outcomes and student prerequisite goals.",className:"w-full p-4 border border-gray-255 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 text-gray-800 text-sm shadow-xs resize-none"})]})]}),e.jsxs("div",{className:"col-span-1 border-l border-gray-100 md:pl-6 space-y-4 text-left",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"🎨 学部科目分类":"🎨 Subject Category"}),e.jsxs("select",{value:n,onChange:r=>{S(r.target.value)},className:"w-full bg-white border border-gray-250 text-gray-755 font-bold px-3 py-2.5 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 shadow-xs text-sm cursor-pointer",children:[e.jsx("option",{value:"Mathematics",children:t==="zh"?"📐 基础数学与几何":"📐 Mathematics"}),e.jsx("option",{value:"ComputerScience",children:t==="zh"?"💻 计算机软件与人工智能":"💻 Computer Science"}),e.jsx("option",{value:"Literature",children:t==="zh"?"✍️ 语言文字与阅读理解":"✍️ Literature & Writing"}),e.jsx("option",{value:"Physics",children:t==="zh"?"⚡ 物理实验与自然探索":"⚡ Physics & Science"}),e.jsx("option",{value:"History",children:t==="zh"?"🏛️ 历史脉络与人地分析":"🏛️ History & Humanities"}),e.jsx("option",{value:"Art",children:t==="zh"?"🎨 交互设计与先锋创意艺术":"🎨 Visual Arts & Design"}),e.jsx("option",{value:"Other",children:t==="zh"?"🔮 交叉素养与综合学习":"🔮 General & Other"})]})]}),e.jsxs("div",{className:"bg-slate-50 p-4 rounded-xl border border-gray-100 space-y-2 select-none text-left",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider block",children:t==="zh"?"科目时间轴专家建议":"SUBJECT HEURISTICS"}),e.jsxs("div",{className:"text-xs text-gray-600 leading-relaxed font-sans mt-1",children:[n==="Mathematics"&&(t==="zh"?"💡 数学:偏向理论推演。推荐 20分公式精讲 + 15分黑板实践互动,强化基础。":"💡 Math recommends: 20m Core Lecture + 15m Practice for theorem grounding."),n==="ComputerScience"&&(t==="zh"?"💡 计算机:偏重编码体验。推荐 15分白板代码推演 + 20分终端实验与分享。":"💡 CS recommends: 15m Algorithms + 20m Interactive workshops on virtual boards."),n==="Literature"&&(t==="zh"?"💡 语文文学:注重文本深度。推荐 10分范文研习 + 20分分组思辨,提升理解。":"💡 Lit recommends: 10m Reading Analysis + 20m Collaborative Discussions."),n==="Physics"&&(t==="zh"?"💡 科学类:逻辑导向。推荐 10分虚拟视频实验 + 20分机理讲解 + 10分钟随堂答卷。":"💡 Science recommends: 10m virtual showcase + 20m principles + 10m evaluation."),n==="History"&&(t==="zh"?"💡 历史人文:情景引入。推荐 15分人文画卷重塑 + 15分史实论驳辩论。":"💡 History recommends: 15m Context Mapping + 15m Interactive Debate panels."),n==="Art"&&(t==="zh"?"💡 视觉创意:自由度高。推荐 10分美术鉴赏 + 25分白板手绘画布互动体验。":"💡 Art recommends: 10m Aesthetics inspiration + 25m real-time board drawing."),n==="Other"&&(t==="zh"?"💡 其他科目:均分各小节时间,循序渐进,打造完整的教学循环闭环。":"💡 Generic: Divide evenly into sequential warm-up, core presentation and quiz.")]})]})]})]})]}),o===2&&e.jsxs("div",{className:"space-y-5 animate-in fade-in duration-200 text-left font-sans",children:[e.jsxs("div",{className:"bg-emerald-50/40 py-3.5 px-4.5 rounded-xl border border-emerald-100 text-xs text-emerald-850 leading-relaxed flex items-start gap-2 text-left",children:[e.jsx(W,{size:16,className:"text-emerald-555 shrink-0 mt-0.5 animate-pulse"}),e.jsxs("div",{children:[e.jsx("strong",{children:t==="zh"?"专家课堂时间轴预设:":"Dynamic Class Presets:"}),e.jsx("p",{className:"mt-0.5",children:t==="zh"?"好的教授节奏必须动静相宜。以下提供三种国际领先的精品课件时间节点设计,点击即可一键刷装配置。您也可以在下方自由增删和重新指定每个环节的长短!":"Curating temporal context maximizes classroom retention. Load from predefined templates or tweak the active steps on the dynamic table."})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider mb-2",children:t==="zh"?"💡 点击应用典型课堂框架模板 (Quick Apply)":"💡 Click to Auto-Apply Structure Presets"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[{id:"preset_standard",title:t==="zh"?"经典 5-20-15-5 讲授模式":"Traditional Dual-Lecture Paradigm",desc:t==="zh"?"由浅入深:先通过场景导入,后精讲,接着在白板配合大屏进行演练。":"Perfect dynamic for most standard classes.",segments:[{id:"seg-preset-1",title:"Course Orientation / 课堂导入",type:"intro",duration:"5m",color:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",notes:"Warm up topic"},{id:"seg-preset-2",title:"Subject Core Lecture / 核心理论精讲",type:"lecture",duration:"20m",color:"bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100",notes:"Main content slide"},{id:"seg-preset-3",title:"Interactive Lab Work / 随堂协同演练",type:"practice",duration:"15m",color:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",notes:"Exercises & questions"},{id:"seg-preset-4",title:"Wrap up / 课堂成果总结与答疑",type:"summary",duration:"5m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Check answer notes"}]},{id:"preset_seminar",title:t==="zh"?"主题讨论工作坊模式":"Active Discussion Workshop",desc:t==="zh"?"协同探究:教师5分钟破冰,学生15分钟小组演练,15分钟对决汇报,10分钟定级。":"Discussion and presentation heavy layout.",segments:[{id:"seg-preset-5",title:"Debate Scenario Brief / 讨论情境简述",type:"intro",duration:"5m",color:"bg-amber-50 text-amber-700 border-amber-200 hover:bg-amber-100",notes:"Define debate metrics"},{id:"seg-preset-6",title:"Cooperative Ideation / 精英白板协作设计",type:"practice",duration:"15m",color:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",notes:"Joint workspace analysis"},{id:"seg-preset-7",title:"Student Team Presentation / 各小组交互汇报",type:"lecture",duration:"15m",color:"bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100",notes:"Group screen sharing"},{id:"seg-preset-8",title:"Review & Grade Feedback / 教师深度对标点评",type:"summary",duration:"10m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Score reviews"}]},{id:"preset_flipped",title:t==="zh"?"翻转课堂高强度训练":"Targeted Problem-Solving Sprint",desc:t==="zh"?"应试/解惑突破:10分钟温习,15分钟重难盲点攻坚,15分钟专项题演习。":"Perfect for exams and targeted training courses.",segments:[{id:"seg-preset-9",title:"Blind Spot Evaluation / 温史自学效果自测",type:"intro",duration:"10m",color:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",notes:"Scan quiz"},{id:"seg-preset-10",title:"Advanced Principle Explores / 重难考点极限拆解",type:"lecture",duration:"15m",color:"bg-rose-50 text-rose-700 border-rose-200 hover:bg-rose-100",notes:"Analyse weak metrics"},{id:"seg-preset-11",title:"Mock Solving Battle / 核心精选题实操对抗",type:"practice",duration:"15m",color:"bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100",notes:"Sprint workout"},{id:"seg-preset-12",title:"Anchor Recap / 知识网架构网节点固化",type:"summary",duration:"5m",color:"bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100",notes:"Highlight checklist"}]}].map(r=>e.jsxs("button",{type:"button",onClick:()=>{c(r.segments),b(t==="zh"?"预设已刷装":"Preset Configured",t==="zh"?`已将《${r.title}》应用到您当前设计的课程中。`:`Assigned "${r.title}" timeslots.`,"success")},className:"bg-white border rounded-xl p-3 text-left transition-all hover:bg-indigo-50/20 hover:border-indigo-400 cursor-pointer active:scale-98",children:[e.jsx("div",{className:"font-bold text-gray-800 text-xs sm:text-sm",children:r.title}),e.jsx("div",{className:"text-xs text-gray-400 mt-1.5 leading-relaxed",children:r.desc})]},r.id))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2 select-none",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider",children:t==="zh"?"📌 流程时间卡编辑 (拖拽或直接对表格字段赋值)":"📌 Custom Timeslot Table (Edit fields directly)"}),e.jsxs("button",{type:"button",onClick:()=>{const r={id:`seg-w-custom-${Date.now()}`,title:t==="zh"?`自理授课阶段 ${a.length+1}`:`Interactive Step ${a.length+1}`,type:"practice",duration:"10m",color:"bg-slate-50 text-slate-700 border-slate-200 hover:bg-slate-100",notes:""};c([...a,r])},className:"flex items-center gap-1 text-xs font-bold text-indigo-600 hover:text-indigo-800 cursor-pointer",children:[e.jsx(L,{size:12})," ",t==="zh"?"增设阶段":"Append Phase"]})]}),e.jsx("div",{className:"space-y-2 border border-gray-150 rounded-xl p-3.5 bg-gray-50/50",children:a.map((r,i)=>e.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-3 bg-white border border-gray-200 rounded-lg p-2.5 shadow-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[e.jsx("span",{className:"w-5 h-5 rounded-full bg-slate-100 flex items-center justify-center text-xs text-gray-500 font-bold shrink-0",children:i+1}),e.jsx("input",{type:"text",value:r.title,onChange:l=>{const s=[...a];s[i].title=l.target.value,c(s)},className:"font-bold text-xs text-gray-800 bg-transparent border-b border-transparent hover:border-gray-200 focus:border-indigo-500 py-0.5 px-1 focus:outline-none focus:bg-gray-50/50 rounded flex-1 sm:w-56",placeholder:"Phase Title"})]}),e.jsxs("div",{className:"flex items-center gap-2.5 w-full sm:w-auto justify-end sm:ml-auto",children:[e.jsxs("div",{className:"flex items-center gap-1 bg-slate-50 border border-gray-200 rounded px-2 py-0.5 shrink-0",children:[e.jsx("span",{className:"text-xs font-bold text-gray-400",children:"时长:"}),e.jsx("input",{type:"text",value:r.duration,onChange:l=>{const s=[...a];s[i].duration=l.target.value,c(s)},className:"w-8 text-xs text-gray-800 font-extrabold bg-transparent text-center focus:outline-none"})]}),e.jsxs("select",{value:r.type,onChange:l=>{const s=l.target.value,d=[...a];d[i].type=s,s==="intro"?d[i].color="bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100":s==="lecture"?d[i].color="bg-indigo-50 text-indigo-700 border-indigo-200 hover:bg-indigo-100":s==="practice"?d[i].color="bg-green-50 text-green-700 border-green-200 hover:bg-green-100":s==="summary"?d[i].color="bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-100":d[i].color="bg-gray-50 text-gray-700 border-gray-205 hover:bg-gray-100",c(d)},className:"bg-slate-50 border border-gray-200 text-xs font-bold text-gray-600 rounded p-1 focus:outline-none cursor-pointer",children:[e.jsx("option",{value:"intro",children:t==="zh"?"温习 / 导入":"Warm-up / Intro"}),e.jsx("option",{value:"lecture",children:t==="zh"?"主体 / 精讲":"Core Lecture"}),e.jsx("option",{value:"practice",children:t==="zh"?"交互白板练习":"Practice Workshop"}),e.jsx("option",{value:"summary",children:t==="zh"?"总结 / 定级":"Wrap-up / Recap"})]}),e.jsx("button",{type:"button",onClick:()=>{if(a.length<=1){alert(t==="zh"?"请保留至少一个核心环节!":"At least one segment must exist.");return}const l=a.filter((s,d)=>d!==i);c(l)},className:"text-gray-400 hover:text-rose-600 font-bold p-1 cursor-pointer text-sm select-none",title:"Delete this segment",children:"×"})]})]},r.id))}),e.jsxs("div",{className:"mt-2 text-xs text-right text-gray-500 font-mono select-none",children:[t==="zh"?"📈 环节累加公式:":"📈 Dynamic aggregation formula: ",e.jsx("span",{className:"text-gray-800 font-semibold",children:a.map(r=>r.duration).join(" + ")})]})]})]}),o===3&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 animate-in fade-in duration-200 font-sans text-left",children:[e.jsxs("div",{className:"space-y-3 flex flex-col h-full min-h-[360px] text-left",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-2",children:[e.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase tracking-wider select-none shrink-0",children:t==="zh"?"✏️ 使用 Markdown 语法编写课时材料":"✏️ Lesson Materials (Markdown)"}),e.jsxs("button",{type:"button",onClick:()=>{const r=T(g,n);h(r),b(t==="zh"?"大纲模板生成成功":"Curriculum Loaded",t==="zh"?"针对所选择的模型和属性已一键刷装教案模板框架。":"Prepopulated Markdown structure.","success")},className:"flex items-center gap-1 text-xs bg-indigo-50 border border-indigo-100 text-indigo-755 hover:bg-indigo-100 px-3 py-1 rounded-lg transition-colors font-bold cursor-pointer",children:[e.jsx(j,{size:13,className:"text-indigo-500 animate-spin"}),t==="zh"?"✨ 一键生成专家级教学大纲模版":"✨ Autofill Outline Template"]})]}),e.jsx("textarea",{rows:14,value:m,onChange:r=>h(r.target.value),placeholder:t==="zh"?`# 西方哲学三大经典原理
2
+
3
+ 在此输入您的具体内容讲解、白板图形绘制节点、以及课后实践任务大纲...`:"# Course curriculum content",className:"w-full flex-grow p-4 bg-slate-900 text-slate-100 border border-slate-700 rounded-xl focus:outline-none focus:ring-2 focus:ring-indigo-500 font-mono text-xs shadow-inner leading-relaxed text-left"})]}),e.jsxs("div",{className:"space-y-3 flex flex-col h-full border border-gray-150 rounded-xl bg-slate-50/50 p-4 text-left",children:[e.jsxs("span",{className:"block text-xs font-bold text-gray-400 uppercase tracking-wider select-none shrink-0",children:["🖥️ ",t==="zh"?"大纲资料实时交互渲染":"Syllabus Live Context rendering"]}),e.jsx("div",{className:"flex-grow overflow-y-auto bg-white border border-gray-150 rounded-lg p-4 text-xs font-sans text-gray-700 max-h-[380px] overflow-x-hidden text-left select-text",children:m.trim()?e.jsx("div",{className:"markdown-body",children:e.jsx(P,{children:m})}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 italic py-16",children:[e.jsx(y,{size:32,className:"mb-2 opacity-20 text-indigo-500"}),e.jsx("span",{children:t==="zh"?"教案空无内容,等待输入或一键填充模板...":"Waiting for materials..."})]})})]})]}),o===4&&e.jsxs("div",{className:"space-y-6 animate-in fade-in duration-200 text-center font-sans max-w-xl mx-auto py-3",children:[e.jsx("div",{className:"inline-flex p-3 bg-emerald-50 border border-emerald-100 text-emerald-500 rounded-full",children:e.jsx(I,{size:36,className:"animate-pulse text-emerald-555"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-extrabold text-gray-800 text-base md:text-lg",children:t==="zh"?"🚀 互动课程已精心筹备成功!":"🚀 Materials Generated successfully!"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:t==="zh"?"设计与时间轴逻辑全部检验合格。请在下方核验新课卡片,确认无误一键部署入 SQLite 内核数据库。":"Curriculum parameters are ready to boot inside the Secure Host."})]}),e.jsxs("div",{className:"border border-indigo-200 rounded-2xl p-5 bg-linear-to-b from-indigo-50/20 to-white shadow-md text-left space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-indigo-50 pb-3 gap-2",children:[e.jsx("div",{className:"font-bold text-indigo-950 text-base sm:text-lg truncate",children:g||(t==="zh"?"未指定课程主题":"Blank Topic")}),e.jsx("span",{className:"inline-flex px-2 py-0.5 rounded text-xs font-extrabold bg-indigo-50 text-indigo-800 uppercase tracking-wide border border-indigo-150 shrink-0",children:n})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 block tracking-wider text-xs font-bold",children:t==="zh"?"教研环节数":"TOTAL STEPS"}),e.jsxs("span",{className:"text-gray-800 font-extrabold text-sm block mt-1",children:[a.length," ",t==="zh"?"项教学环节":"slots"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-400 block tracking-wider text-xs font-bold",children:t==="zh"?"发布载体引擎":"STORAGE MEDIUM"}),e.jsxs("div",{className:"flex items-center gap-1 text-emerald-650 font-extrabold text-sm mt-1",children:[e.jsx(v,{size:11,className:"text-emerald-500"}),e.jsx("span",{children:"SQLite DB"})]})]})]}),e.jsx("div",{className:"bg-slate-50 border border-gray-150 p-3 rounded-lg text-xs text-gray-600 line-clamp-2 italic leading-relaxed text-left",children:u||(t==="zh"?"无科目描述内容":"No description written.")}),e.jsxs("div",{className:"space-y-1.5 select-none",children:[e.jsx("span",{className:"text-xs font-extrabold text-gray-400 uppercase tracking-wider block",children:t==="zh"?"教学时间轴环流预览":"TIMELINE PROGRESS OVERVIEW"}),e.jsx("div",{className:"flex items-center gap-1 w-full overflow-x-auto py-1",children:a.map((r,i)=>e.jsxs(f.Fragment,{children:[e.jsxs("div",{className:`px-2 py-1 text-xs font-bold rounded border truncate max-w-[120px] ${r.color.split(" ")[0]}`,children:[r.title.split(" / ")[0]," (",r.duration,")"]}),i<a.length-1&&e.jsx(E,{size:11,className:"text-gray-300"})]},r.id))})]})]})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-105 bg-slate-50 flex justify-between items-center shrink-0",children:[e.jsx("span",{className:"text-xs font-bold font-mono text-gray-400 uppercase select-none",children:t==="zh"?"⚙️ SQLITE 写入预检通过":"⚙️ SQLITE VERIFICATION SUCCESS"}),e.jsxs("div",{className:"flex items-center gap-2",children:[o>1&&e.jsx("button",{type:"button",onClick:()=>p(r=>r-1),disabled:x,className:"px-4 py-2 text-xs font-semibold border border-gray-200 text-gray-700 bg-white hover:bg-gray-50 rounded-lg transition-colors cursor-pointer select-none",children:t==="zh"?"上一步":"Back"}),o<4?e.jsx("button",{type:"button",onClick:()=>{if(o===1&&!g.trim()){alert(t==="zh"?"请输入课程课题名称!":"Please type course title to proceed.");return}p(r=>r+1)},className:"px-4.5 py-2 text-xs font-bold bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg shadow-sm flex items-center gap-1 cursor-pointer select-none",children:t==="zh"?"继续前进":"Continue"}):e.jsx("button",{type:"button",onClick:A,disabled:x,className:"px-5 py-2 text-xs font-bold bg-emerald-600 hover:bg-emerald-700 text-white rounded-lg shadow-md flex items-center gap-1.5 cursor-pointer disabled:opacity-50 select-none animate-bounce",children:x?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:13,className:"animate-spin"}),e.jsx("span",{children:t==="zh"?"写入底库中...":"Deploying..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(v,{size:13}),e.jsx("span",{children:t==="zh"?"部署并激活新课程":"Deploy & Activate"})]})})]})]})]})})})}export{Q as CourseWizardModal};
@@ -0,0 +1 @@
1
+ import{r as a,j as e}from"./vendor-react-B0t7H3hh.js";import{_ as T,X as M,aF as R,ab as V,d as q,a0 as G,r as O,E as X,aG as B,s as J,T as K}from"./vendor-icons-BRmhY6fg.js";import"./vendor-utils-m0Urvtws.js";const Q="@courseware-hub/plugin",W=h=>`${Q}.${h}`;function ce({onClose:h,lang:m}){const[p,k]=a.useState([]),[_,b]=a.useState(!1),[u,z]=a.useState(""),[g,P]=a.useState(""),[y,j]=a.useState(!1),[U,f]=a.useState(null),[n,D]=a.useState(null),[N,E]=a.useState([]),[Y,Z]=a.useState(null),[c,v]=a.useState(""),[w,S]=a.useState(60),[d,C]=a.useState(""),[ee,se]=a.useState(null),[te,ae]=a.useState(""),[re,le]=a.useState(60),i=a.useCallback(async(s,r)=>{const l=await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:W(s),payload:r??{}})});if(!l.ok){const $=await l.json();throw new Error($.error||"Command failed")}return(await l.json()).result},[]),o=a.useCallback(async()=>{b(!0);try{const s=await i("courseware.query",{status:g||void 0,search:u||void 0,limit:100});k(s?.items??[])}catch(s){console.error("Fetch courseware list failed:",s)}finally{b(!1)}},[i,g,u]);a.useEffect(()=>{o()},[o]);const F=async()=>{if(!(!c.trim()||!d.trim())){j(!0);try{await i("courseware.upload",{title:c.trim(),html_content:d,pass_score:w}),v(""),C(""),S(60),await o()}catch(s){alert(s.message)}finally{j(!1)}}},L=s=>{const r=s.target.files?.[0];if(!r)return;const l=new FileReader;l.onload=x=>C(x.target?.result??""),l.readAsText(r)},H=async(s,r)=>{const l=r==="published"?"draft":"published";try{await i("courseware.publish",{id:s,status:l}),await o()}catch(x){alert(x.message)}},I=async(s,r)=>{if(confirm(m==="zh"?`确认删除课件「${r}」及其所有版本和成绩数据?`:`Delete "${r}" and all versions/scores?`))try{await i("courseware.delete",{id:s}),await o()}catch(l){alert(l.message)}},A=async s=>{try{const r=await i("courseware.get_detail",{id:s}),l=await i("courseware.query_scores",{courseware_id:s});D(r),E(l?.items??[]),f(s)}catch(r){alert(r.message)}},t=(s,r)=>m==="zh"?s:r;return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl border border-gray-200 w-[90vw] max-w-5xl h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 text-indigo-600 rounded-xl",children:e.jsx(T,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-gray-800",children:t("课件管理","Courseware Hub")}),e.jsx("p",{className:"text-xs text-gray-400",children:t("上传 HTML 课件 · 成绩采集 · 版本管理","Upload · Score Collection · Versioning")})]})]}),e.jsx("button",{onClick:h,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:e.jsx(M,{size:18,className:"text-gray-400"})})]}),U?e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[e.jsxs("button",{onClick:()=>f(null),className:"text-sm text-indigo-600 hover:underline mb-4 inline-flex items-center gap-1",children:["← ",t("返回列表","Back to list")]}),n&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100",children:[e.jsx("h3",{className:"font-bold text-gray-800 mb-3",children:n.title}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("版本","Version"),":"]})," ",e.jsx("span",{className:"font-mono text-gray-700",children:n.version})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("状态","Status"),":"]})," ",e.jsx("span",{className:`font-bold ${n.status==="published"?"text-green-600":"text-amber-600"}`,children:n.status})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("及格线","Pass Score"),":"]})," ",e.jsx("span",{className:"font-mono",children:n.pass_score})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("提交数","Submissions"),":"]})," ",e.jsx("span",{className:"font-mono",children:n.stats?.submissions??0})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("平均分","Avg Score"),":"]})," ",e.jsx("span",{className:"font-mono text-indigo-600 font-bold",children:n.stats?.avg_score??"-"})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("通过率","Pass Rate"),":"]})," ",e.jsxs("span",{className:"font-mono",children:[n.stats?.pass_rate??"-","%"]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-gray-700 mb-3",children:t("成绩列表","Score List")}),N.length===0?e.jsx("p",{className:"text-sm text-gray-400 italic",children:t("暂无成绩记录","No scores yet")}):e.jsx("div",{className:"overflow-x-auto border border-gray-200 rounded-xl",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2 text-left",children:t("学生","Student")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("分数","Score")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("用时(秒)","Time(s)")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("提交时间","Submitted")})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:N.map(s=>e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"px-4 py-2 font-medium text-gray-700",children:s.student_name||s.student_id}),e.jsxs("td",{className:`px-4 py-2 text-right font-mono font-bold ${s.score>=(n?.pass_score??60)?"text-green-600":"text-red-500"}`,children:[s.score,"/",s.total]}),e.jsx("td",{className:"px-4 py-2 text-right text-gray-500",children:s.time_spent}),e.jsx("td",{className:"px-4 py-2 text-right text-gray-400 text-xs",children:new Date(s.submitted_at).toLocaleString()})]},s.id))})]})})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"px-6 py-3 border-b border-gray-100 flex items-center gap-3 shrink-0 flex-wrap",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx(R,{size:14,className:"absolute left-3 top-2.5 text-gray-400"}),e.jsx("input",{value:u,onChange:s=>z(s.target.value),placeholder:t("搜索课件...","Search courseware..."),className:"w-full pl-9 pr-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-1 focus:ring-indigo-500 outline-none"})]}),e.jsxs("select",{value:g,onChange:s=>P(s.target.value),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 outline-none focus:ring-1 focus:ring-indigo-500 bg-white",children:[e.jsx("option",{value:"",children:t("全部状态","All Status")}),e.jsx("option",{value:"published",children:t("已发布","Published")}),e.jsx("option",{value:"draft",children:t("草稿","Draft")}),e.jsx("option",{value:"archived",children:t("已归档","Archived")})]}),e.jsx("button",{onClick:o,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",title:t("刷新","Refresh"),children:e.jsx(V,{size:16,className:"text-gray-400"})})]}),e.jsx("div",{className:"px-6 py-4 border-b border-gray-100 bg-indigo-50/30 shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("span",{className:"text-sm font-bold text-gray-600 shrink-0",children:[t("上传课件","Upload"),":"]}),e.jsx("input",{value:c,onChange:s=>v(s.target.value),placeholder:t("课件标题","Title"),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 w-40 outline-none focus:ring-1 focus:ring-indigo-500"}),e.jsx("input",{type:"number",value:w,onChange:s=>S(Number(s.target.value)),placeholder:t("及格线","Pass"),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 w-20 outline-none focus:ring-1 focus:ring-indigo-500"}),e.jsxs("label",{className:"text-sm px-3 py-2 border border-dashed border-gray-300 rounded-lg cursor-pointer hover:border-indigo-400 hover:bg-white transition-colors text-gray-500",children:[e.jsx(q,{size:14,className:"inline mr-1"}),d?t("已选择文件","File selected"):t("选择 HTML","Select HTML"),e.jsx("input",{type:"file",accept:".html,.htm",onChange:L,className:"hidden"})]}),e.jsx("button",{onClick:F,disabled:y||!c.trim()||!d.trim(),className:"px-4 py-2 bg-indigo-600 text-white text-sm font-bold rounded-lg hover:bg-indigo-700 disabled:opacity-40 transition-colors",children:y?t("上传中...","Uploading..."):t("上传","Upload")})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:_?e.jsx("div",{className:"text-center py-12 text-gray-400",children:t("加载中...","Loading...")}):p.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(T,{size:40,className:"mx-auto mb-3 opacity-30"}),e.jsx("p",{children:t("暂无课件,请上传您的第一个 HTML 课件","No courseware yet. Upload your first HTML courseware.")})]}):e.jsx("div",{className:"grid gap-4",children:p.map(s=>e.jsx("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:border-indigo-200 transition-colors shadow-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:"font-bold text-gray-800 truncate",children:s.title}),e.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full font-bold ${s.status==="published"?"bg-green-50 text-green-650 border border-green-200":s.status==="archived"?"bg-gray-50 text-gray-500 border border-gray-200":"bg-amber-50 text-amber-650 border border-amber-200"}`,children:s.status==="published"?t("已发布","Published"):s.status==="archived"?t("已归档","Archived"):t("草稿","Draft")}),e.jsxs("span",{className:"text-xs text-gray-400 font-mono",children:["v",s.version]})]}),s.description&&e.jsx("p",{className:"text-xs text-gray-400 line-clamp-2 mb-2",children:s.description}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(G,{size:12}),t("提交","Subs"),": ",s.stats?.submissions??0]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{size:12}),t("均分","Avg"),": ",s.stats?.avg_score??"-"]}),s.security_warnings?.length>0&&e.jsxs("span",{className:"text-amber-500 flex items-center gap-1",title:s.security_warnings.join(", "),children:["⚠ ",s.security_warnings.length]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx("button",{onClick:()=>A(s.id),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors",title:t("详情","Details"),children:e.jsx(X,{size:15,className:"text-gray-400"})}),e.jsx("button",{onClick:()=>H(s.id,s.status),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors",title:s.status==="published"?t("下架","Unpublish"):t("发布","Publish"),children:s.status==="published"?e.jsx(B,{size:15,className:"text-amber-500"}):e.jsx(J,{size:15,className:"text-green-500"})}),e.jsx("button",{onClick:()=>I(s.id,s.title),className:"p-1.5 hover:bg-red-50 rounded-lg transition-colors",title:t("删除","Delete"),children:e.jsx(K,{size:15,className:"text-red-400"})})]})]})},s.id))})})]})]})})}export{ce as CoursewareHubPanel};
@@ -0,0 +1,8 @@
1
+ import{r as c,j as e}from"./vendor-react-B0t7H3hh.js";import{A as xe,m as K,E as me}from"./index-BQF_s4QO.js";import{aK as ue,X as re,ai as U,a5 as he,B as W,aL as ge,r as pe,U as H,f as le,_ as fe,z as be,aM as ie,n as je,w as oe,ax as de,ab as Ne,ah as ve,Z as ye,aN as we,a4 as Se,aO as ke,g as Ce,a2 as ze,a0 as V,G as Pe,aP as Me,u as De,F as Le,aC as Te,aQ as $e,b as X,J,e as Ae}from"./vendor-icons-BRmhY6fg.js";import{u as Ie,C as Ee,T as Y}from"./ClassroomCountdownWidget-CHUvYSrT.js";import{a as Z,A as Fe,C as Oe,X as ee,Y as se,T as te,b as _e,e as ae,B as Be,f as Re,g as qe}from"./vendor-charts-qLbgF1eL.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-D7rGevI1.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-pptx-C5-U7ieS.js";function Ge({classes:s,lessons:i,lang:C,onScheduleClass:m,onGenerateAssignment:h,onCreateLesson:w}){const[l,j]=c.useState(!1),[u,v]=c.useState("menu"),[y,z]=c.useState(""),[P,S]=c.useState(""),[$,A]=c.useState(""),[D,M]=c.useState(""),[x,I]=c.useState(""),[E,b]=c.useState(""),[L,N]=c.useState(""),[_,T]=c.useState(!1),[R,O]=c.useState(!1),[k,r]=c.useState(null),t={zh:{quickActions:"快捷操作指令",quickDesc:"无需切换页面,在此直接向教育总线或班级下发运行调度命令。",scheduleClass:"排课计划调度",scheduleDesc:"为班级分配课程段并指定授课时间",generateAssignment:"生成 AI 测验任务",generateDesc:"利用代理模型为班级定制专属能力题目",createLesson:"注册教学课件",createDesc:"发布新的富文本 Markdown 教材大纲",back:"返回上级",confirm:"确认并下发指令",classSelect:"选择目标班级",lessonSelect:"选择关联课件",dateSelect:"授课日期选择",assignmentTopic:"测验主题方向 / 核心知识点",assignmentTopicPlaceholder:"例: 一元二次方程,光合作用,牛顿运动定律等...",lessonTitle:"课件名称(大纲标题)",lessonTitlePlaceholder:"例: 量子力学初步 / 物理实验基础",lessonContent:"详细授课内容 (Markdown 支持)",successScheduled:"排课成功!总线已捕获日程数据。",successAssignment:"AI 测验任务成功生成,稍后同步。",successLesson:"新课件发布成功!画板白板可直接拖拽加载。",emptyClasses:"未检测到活跃班级",emptyLessons:"未检测到可用课件",loadingBus:"内核微服务运行中...",genericError:"网络或核指令总线调用失败,请重试"},en:{quickActions:"Quick Actions",quickDesc:"Deploy scheduler and class orchestration bus commands instantly from here.",scheduleClass:"Schedule Lesson Period",scheduleDesc:"Assign a lesson package and scheduled date to an active class",generateAssignment:"Generate AI Assignment",generateDesc:"Deploy agent workflows to design tailored student test cases",createLesson:"Register Lesson Curriculum",createDesc:"Publish new rich Markdown-based whiteboard syllabus",back:"Back",confirm:"Execute Command",classSelect:"Select Class",lessonSelect:"Select Lesson Template",dateSelect:"Choose Scheduled Date",assignmentTopic:"Assignment Topic / Target Knowledge",assignmentTopicPlaceholder:"e.g., Quadratic equations, Photosynthesis, Newtonian gravity...",lessonTitle:"Lesson Curriculum Title",lessonTitlePlaceholder:"e.g., Intro to Quantum Mechanics",lessonContent:"Whiteboard Curriculum Content (Markdown)",successScheduled:"Success! Dynamic class schedule updated.",successAssignment:"Success! AI is compiling custom quiz structures.",successLesson:"Success! Ready to orchestrate inside classroom sandbox.",emptyClasses:"No classes discovered",emptyLessons:"No lessons discovered",loadingBus:"Interfacing core services...",genericError:"System bus execute command failure, please retry"}}[C],g=()=>{z(""),S(""),A(""),M(""),I(""),b(""),N(""),r(null),O(!1),T(!1)},a=()=>{switch(u){case"schedule":return t.successScheduled;case"assignment":return t.successAssignment;case"lesson":return t.successLesson;default:return""}},o=n=>{g(),v(n),s.length>0&&(z(s[0].id),M(s[0].id)),i.length>0&&S(i[0].id),n==="lesson"&&N(`# 新课件名称
2
+
3
+ ## 教学目标
4
+ - 掌握核心考点
5
+ - 熟练完成基础物理实验
6
+
7
+ ## 课堂探究
8
+ 这里写课本的主要讲授要点。`)},f=async n=>{n.preventDefault(),T(!0),r(null);try{let d=!1;if(u==="schedule"){if(!y||!P||!$){r("Please complete all form fields."),T(!1);return}d=await m(y,P,$)}else if(u==="assignment"){if(!D||!x.trim()){r("Please specify target class and a valid topic."),T(!1);return}d=await h(D,x.trim())}else if(u==="lesson"){if(!E.trim()||!L.trim()){r("Title and Content can not be empty."),T(!1);return}d=await w(E.trim(),L.trim())}d?(O(!0),setTimeout(()=>{O(!1),v("menu")},2200)):r(t.genericError)}catch(d){r(d.message||t.genericError)}finally{T(!1)}};return e.jsxs("div",{id:"quick-actions-fab-container",className:"absolute bottom-8 right-8 z-40 flex flex-col items-end",children:[e.jsx(xe,{children:l&&e.jsxs(K.div,{initial:{opacity:0,y:15,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:15,scale:.95},transition:{duration:.18},className:"mb-4 w-[360px] sm:w-[420px] bg-white border border-gray-200 rounded-2xl shadow-xl overflow-hidden flex flex-col focus:outline-none",id:"quick-actions-popup-card",children:[e.jsxs("div",{className:"bg-indigo-600 px-5 py-4 text-white flex items-center justify-between shadow-inner",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ue,{size:18,className:"animate-pulse"}),e.jsx("h3",{className:"font-bold text-sm tracking-wide",children:t.quickActions})]}),e.jsx("button",{onClick:()=>{j(!1),v("menu")},className:"text-white/80 hover:text-white hover:bg-white/15 p-1 rounded-full transition-all focus:outline-none",title:"Close Portal",children:e.jsx(re,{size:16})})]}),e.jsxs("div",{className:"p-5 max-h-[480px] overflow-y-auto bg-gray-50/50",children:[u==="menu"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-xs text-gray-500 leading-relaxed font-medium bg-indigo-50/50 border border-indigo-100 p-2.5 rounded-lg mb-4",children:t.quickDesc}),e.jsxs("div",{onClick:()=>o("schedule"),className:"flex items-start gap-3.5 p-3.5 bg-white border border-gray-200 hover:border-indigo-400 hover:shadow-md rounded-xl cursor-pointer transition-all hover:scale-101 group",id:"action-schedule-class",children:[e.jsx("div",{className:"p-2.5 bg-indigo-50 text-indigo-600 rounded-lg group-hover:bg-indigo-600 group-hover:text-white transition-colors duration-200",children:e.jsx(U,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-xs font-bold text-gray-800 flex items-center gap-1 group-hover:text-indigo-600 transition-colors uppercase tracking-wider",children:t.scheduleClass}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 leading-relaxed",children:t.scheduleDesc})]})]}),e.jsxs("div",{onClick:()=>o("assignment"),className:"flex items-start gap-3.5 p-3.5 bg-white border border-gray-200 hover:border-purple-400 hover:shadow-md rounded-xl cursor-pointer transition-all hover:scale-101 group",id:"action-generate-assignment",children:[e.jsx("div",{className:"p-2.5 bg-purple-50 text-purple-600 rounded-lg group-hover:bg-purple-600 group-hover:text-white transition-colors duration-200",children:e.jsx(he,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-xs font-bold text-gray-800 flex items-center gap-1 group-hover:text-purple-600 transition-colors uppercase tracking-wider",children:t.generateAssignment}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 leading-relaxed",children:t.generateDesc})]})]}),e.jsxs("div",{onClick:()=>o("lesson"),className:"flex items-start gap-3.5 p-3.5 bg-white border border-gray-200 hover:border-emerald-400 hover:shadow-md rounded-xl cursor-pointer transition-all hover:scale-101 group",id:"action-create-lesson",children:[e.jsx("div",{className:"p-2.5 bg-emerald-50 text-emerald-600 rounded-lg group-hover:bg-emerald-600 group-hover:text-white transition-colors duration-200",children:e.jsx(W,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-xs font-bold text-gray-800 flex items-center gap-1 group-hover:text-emerald-600 transition-colors uppercase tracking-wider",children:t.createLesson}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 leading-relaxed",children:t.createDesc})]})]})]}),u!=="menu"&&e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>v("menu"),className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-indigo-600 font-semibold mb-4 cursor-pointer focus:outline-none",id:"action-back-button",children:[e.jsx(ge,{size:14}),e.jsx("span",{children:t.back})]}),R?e.jsxs(K.div,{initial:{scale:.95},animate:{scale:1},className:"flex flex-col items-center justify-center py-10 text-center",children:[e.jsx(pe,{size:48,className:"text-green-500 animate-bounce mb-3"}),e.jsx("h4",{className:"font-bold text-green-800 text-sm",children:a()}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Returning to action console..."})]}):e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[k&&e.jsxs("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg text-red-600 text-xs font-semibold",children:["⚠️ ",k]}),u==="schedule"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(H,{size:12})," ",t.classSelect]}),s.length===0?e.jsx("p",{className:"text-xs italic text-red-500",children:t.emptyClasses}):e.jsx("select",{value:y,onChange:n=>z(n.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",children:s.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(W,{size:12})," ",t.lessonSelect]}),i.length===0?e.jsx("p",{className:"text-xs italic text-red-500",children:t.emptyLessons}):e.jsx("select",{value:P,onChange:n=>S(n.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",children:i.map(n=>e.jsx("option",{value:n.id,children:n.title},n.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(U,{size:12})," ",t.dateSelect]}),e.jsx("input",{type:"date",value:$,onChange:n=>A(n.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",required:!0})]})]}),u==="assignment"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(H,{size:12})," ",t.classSelect]}),s.length===0?e.jsx("p",{className:"text-xs italic text-red-500",children:t.emptyClasses}):e.jsx("select",{value:D,onChange:n=>M(n.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",children:s.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(le,{size:12})," ",t.assignmentTopic]}),e.jsx("input",{type:"text",value:x,onChange:n=>I(n.target.value),placeholder:t.assignmentTopicPlaceholder,className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",required:!0})]})]}),u==="lesson"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(fe,{size:12})," ",t.lessonTitle]}),e.jsx("input",{type:"text",value:E,onChange:n=>b(n.target.value),placeholder:t.lessonTitlePlaceholder,className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",required:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(W,{size:12})," ",t.lessonContent]}),e.jsx("textarea",{value:L,onChange:n=>N(n.target.value),rows:5,className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 font-mono text-gray-700",required:!0})]})]}),e.jsx("button",{type:"submit",disabled:_||u==="schedule"&&(s.length===0||i.length===0)||u==="assignment"&&s.length===0,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs py-2.5 px-4 rounded-xl flex items-center justify-center gap-2 cursor-pointer transition-all shadow-md active:scale-98 disabled:opacity-50",children:_?e.jsxs(e.Fragment,{children:[e.jsx(be,{size:14,className:"animate-spin"}),e.jsx("span",{children:t.loadingBus})]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{size:13}),e.jsx("span",{children:t.confirm})]})})]})]})]})]})}),e.jsxs("button",{onClick:()=>{j(!l),v("menu")},className:"w-14 h-14 bg-indigo-600 hover:bg-indigo-700 text-white rounded-full flex items-center justify-center shadow-lg hover:shadow-indigo-200 hover:shadow-2xl transition-all duration-250 cursor-pointer active:scale-95 focus:outline-none relative group",title:"Trigger Education OS Quick Scheduler Command Panel",id:"quick-actions-fab-button",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-purple-400 opacity-20 group-hover:animate-ping"}),e.jsx(K.div,{animate:{rotate:l?135:0},transition:{duration:.2},className:"flex items-center justify-center text-white",children:e.jsx(je,{size:24,strokeWidth:2.8})})]})]})}function ne({lang:s="zh",lessons:i=[],classes:C=[],schedules:m=[],students:h=[],addToast:w}){const[l,j]=c.useState(""),[u,v]=c.useState(15),[y,z]=c.useState(!1),[P,S]=c.useState(!1),[$,A]=c.useState(!1),[D,M]=c.useState([]),[x,I]=c.useState({currentEngagement:78,moodStatus:"OPTIMAL",moodLabel:s==="zh"?"课堂节奏良好 · 专注度高":"Optimal Flow · High Focus",moodEmoji:"🌟",totalInteractions:24,interactionFrequencyPerMin:"3.2",pulseDistribution:{clearCount:18,confusedCount:4,tooFastCount:2,total:24,clearPercent:75,confusedPercent:17,tooFastPercent:8}}),[E,b]=c.useState([]),{on:L}=Ie();c.useEffect(()=>{if(!l&&i.length>0){const r=m.find(t=>t.status!=="cancelled");r?.lesson_id?j(r.lesson_id):j(i[0].id)}},[i,m,l]);const N=c.useCallback(async()=>{if(l){S(!0);try{const r=await fetch(`/api/classroom/sessions/${l}/mood-tracker?minutes=${u}`);if(r.ok){const t=await r.json();t.success&&t.timeline&&(I(t.metrics),b(t.timeline))}else _(u)}catch{_(u)}finally{S(!1)}}},[l,u]),_=c.useCallback(r=>{const t=[],g=Date.now();for(let a=r-1;a>=0;a--){const o=g-a*60*1e3,f=new Date(o),n=`${f.getHours().toString().padStart(2,"0")}:${f.getMinutes().toString().padStart(2,"0")}`,d=72+Math.sin(a*.5)*12,p=Math.max(0,Math.round(2+Math.cos(a*.8)*3));t.push({time:n,timestamp:o,engagement:Math.min(100,Math.max(30,Math.round(d))),energy:Math.min(100,Math.max(20,Math.round(55+p*9))),interactions:p,clear:Math.round(p*.7),confused:Math.round(p*.2),tooFast:Math.round(p*.1)})}b(t)},[]);c.useEffect(()=>{N()},[N]),c.useEffect(()=>{const r=L("classroom:pacing_updated",a=>{if(a.lessonId===l||!a.lessonId){N();const o=new Date,f=`${o.getHours().toString().padStart(2,"0")}:${o.getMinutes().toString().padStart(2,"0")}:${o.getSeconds().toString().padStart(2,"0")}`;M(n=>[{id:`pulse_${Date.now()}`,text:s==="zh"?"收到学生节奏脉搏反馈":"Student submitted pacing pulse",time:f,type:"clear"},...n.slice(0,5)])}}),t=L("classroom:quick_poll_updated",a=>{if(a.lessonId===l||!a.lessonId){N();const o=new Date,f=`${o.getHours().toString().padStart(2,"0")}:${o.getMinutes().toString().padStart(2,"0")}:${o.getSeconds().toString().padStart(2,"0")}`;M(n=>[{id:`poll_${Date.now()}`,text:`${a.latestVoter||(s==="zh"?"学生":"Student")} ${s==="zh"?"参与了随堂投票":"voted in poll"}`,time:f,type:"poll"},...n.slice(0,5)])}}),g=L("classroom:buzzer_winner",a=>{if(a.lessonId===l||!a.lessonId){N();const o=new Date,f=`${o.getHours().toString().padStart(2,"0")}:${o.getMinutes().toString().padStart(2,"0")}:${o.getSeconds().toString().padStart(2,"0")}`;M(n=>[{id:`buzzer_${Date.now()}`,text:`⚡ ${a.winnerStudentName||"Student"} ${s==="zh"?"抢答命中":"buzzed in"} (${a.responseTimeMs}ms)`,time:f,type:"fast"},...n.slice(0,5)])}});return()=>{r?.(),t?.(),g?.()}},[L,l,N,s]),c.useEffect(()=>{if(!y)return;const r=setInterval(()=>{b(t=>{if(t.length===0)return t;const g=Date.now(),a=new Date(g),o=`${a.getHours().toString().padStart(2,"0")}:${a.getMinutes().toString().padStart(2,"0")}`,f=t[t.length-1],n=Math.round((Math.random()-.45)*6),d=Math.min(98,Math.max(45,f.engagement+n)),p=Math.floor(Math.random()*5),B=Math.round(p*.75),F=Math.round(p*.2),q=Math.max(0,p-B-F),G={time:o,timestamp:g,engagement:d,energy:Math.min(100,Math.max(30,50+p*12)),interactions:p,clear:B,confused:F,tooFast:q};return[...t.slice(1),G]}),I(t=>{const g=Math.round((Math.random()-.45)*3),a=Math.min(96,Math.max(50,t.currentEngagement+g));return{...t,currentEngagement:a,totalInteractions:t.totalInteractions+1}})},4e3);return()=>clearInterval(r)},[y]);const T=async()=>{if(l){A(!0);try{(await fetch(`/api/classroom/sessions/${l}/pulse-check`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:s==="zh"?"当前讲解节奏如何?请按下脉搏按钮反馈":"How is current pacing? Send your pulse",durationSec:30})})).ok?w?.(s==="zh"?"脉搏检测已下发":"Pulse Check Dispatched",s==="zh"?"已向全体听课学生弹出 30s 课堂节奏自检晴雨表":"30-second pulse check sent to students","success"):w?.(s==="zh"?"提示":"Notice",s==="zh"?"脉搏指令已广播至本地课堂":"Pulse check broadcasted locally","info")}catch{w?.(s==="zh"?"脉搏指令广播":"Pulse Broadcasted",s==="zh"?"已通过 WebSocket 广播脉搏信号":"Broadcasted pulse signal via WebSocket","info")}finally{A(!1)}}},R=c.useMemo(()=>{const r=x.pulseDistribution;return[{name:s==="zh"?"听懂了 (Clear)":"Clear",percent:r.clearPercent,count:r.clearCount,color:"#10b981"},{name:s==="zh"?"有疑问 (Confused)":"Confused",percent:r.confusedPercent,count:r.confusedCount,color:"#f59e0b"},{name:s==="zh"?"讲太快 (Too Fast)":"Too Fast",percent:r.tooFastPercent,count:r.tooFastCount,color:"#ef4444"}]},[x.pulseDistribution,s]),O=i.find(r=>r.id===l),k=c.useMemo(()=>{const{currentEngagement:r,pulseDistribution:t}=x;return t.confusedPercent>25?{type:"warning",text:s==="zh"?"⚠️ 超过 25% 学生反馈理解受阻,建议暂停并使用白板重绘核心公式或做针对性互动提问。":"⚠️ >25% students confused. Pause and re-explain key concept on whiteboard."}:t.tooFastPercent>20?{type:"caution",text:s==="zh"?"⚡ 约 20% 学生跟不上当前语速或换页节奏,建议稍加减速,并留出 15 秒消化提问时间。":"⚡ Pacing too fast. Slow down and give 15s pause for note-taking."}:r>=80?{type:"success",text:s==="zh"?"🌟 课堂进入高专注黄金区间(心流状态)!建议趁热打铁,推送随堂探究或随堂测验。":"🌟 Optimal Flow detected! High focus. Great moment to launch interactive quiz."}:{type:"info",text:s==="zh"?"💡 专注度平稳,可穿插抢答(Buzzer)或快速单选投票以进一步激活课堂互动。":"💡 Steady attention. Consider triggering a Buzzer or Quick Poll to boost energy."}},[x,s]);return e.jsxs("div",{id:"classroom-mood-tracker-container",className:"bg-white border border-slate-200/80 rounded-2xl p-5 shadow-sm flex flex-col gap-5 transition-all duration-300",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row items-start lg:items-center justify-between gap-4 border-b border-slate-100 pb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-tr from-indigo-500 to-teal-400 text-white flex items-center justify-center shadow-xs shrink-0",children:e.jsx(oe,{size:20,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"text-xs font-black uppercase tracking-wider text-indigo-700 bg-indigo-50 border border-indigo-100/60 px-2.5 py-0.5 rounded-full flex items-center gap-1.5",children:[e.jsx(de,{size:12,className:"text-rose-500 animate-ping"}),e.jsx("span",{children:s==="zh"?"实时课堂专注度与情绪晴雨表":"REAL-TIME CLASSROOM MOOD"})]}),e.jsxs("span",{className:"text-xs font-bold px-2 py-0.5 rounded-full bg-slate-100 text-slate-700 flex items-center gap-1",children:[e.jsx("span",{children:x.moodEmoji}),e.jsx("span",{children:x.moodLabel})]})]}),e.jsx("h2",{className:"text-base font-extrabold text-slate-800 tracking-tight mt-1 flex items-center gap-2",children:e.jsx("span",{children:O?O.title:s==="zh"?"活跃课堂":"Active Lesson"})})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap w-full lg:w-auto justify-end",children:[e.jsx("select",{id:"mood-tracker-lesson-select",value:l,onChange:r=>j(r.target.value),className:"text-xs font-bold bg-slate-50 border border-slate-200 rounded-xl px-2.5 py-2 text-slate-700 focus:ring-2 focus:ring-indigo-500 outline-none cursor-pointer",children:i.map(r=>e.jsxs("option",{value:r.id,children:["📖 ",r.title]},r.id))}),e.jsx("div",{className:"flex items-center bg-slate-100 p-0.5 rounded-xl border border-slate-200/60 text-xs font-bold text-slate-600",children:[5,15,30].map(r=>e.jsxs("button",{type:"button",onClick:()=>v(r),className:`px-2.5 py-1.5 rounded-lg transition-all cursor-pointer ${u===r?"bg-white text-indigo-700 shadow-2xs":"hover:text-slate-900"}`,children:[r,"m"]},r))}),e.jsxs("button",{id:"mood-tracker-sim-btn",type:"button",onClick:()=>z(!y),className:`px-3 py-2 text-xs font-bold rounded-xl border transition-all cursor-pointer flex items-center gap-1.5 shadow-2xs ${y?"bg-amber-500/10 text-amber-700 border-amber-500/30 ring-2 ring-amber-500/20":"bg-slate-50 text-slate-600 border-slate-200 hover:bg-slate-100"}`,title:s==="zh"?"开启/关闭实时模拟数据流 (在暂无学生连入时快速预览曲线波动)":"Toggle simulated live telemetry flow",children:[e.jsx(le,{size:13,className:y?"text-amber-600 animate-spin":"text-slate-400"}),e.jsx("span",{children:y?s==="zh"?"实时模拟中":"Simulating":s==="zh"?"模拟数据流":"Simulate"})]}),e.jsxs("button",{id:"mood-tracker-trigger-pulse-btn",type:"button",onClick:T,disabled:$,className:"px-3.5 py-2 bg-gradient-to-r from-indigo-600 to-teal-600 hover:from-indigo-700 hover:to-teal-700 text-white rounded-xl text-xs font-extrabold flex items-center gap-1.5 shadow-xs transition-all active:scale-95 cursor-pointer disabled:opacity-50",children:[e.jsx(ie,{size:13}),e.jsx("span",{children:s==="zh"?"发起30s即时脉搏检":"Instant Pulse Check"})]}),e.jsx("button",{type:"button",onClick:N,disabled:P,className:"p-2 text-slate-500 hover:text-indigo-600 hover:bg-slate-100 rounded-xl transition-colors cursor-pointer",title:s==="zh"?"刷新数据":"Refresh",children:e.jsx(Ne,{size:14,className:P?"animate-spin text-indigo-600":""})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3.5",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50/50 to-teal-50/30 border border-indigo-100/70 rounded-xl p-3.5 flex flex-col justify-between shadow-3xs",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-extrabold text-indigo-700 uppercase tracking-wider flex items-center gap-1",children:[e.jsx(ve,{size:13}),e.jsx("span",{children:s==="zh"?"综合专注指数":"Engagement Index"})]}),e.jsx("span",{className:"text-xs font-bold text-emerald-600 bg-emerald-100/60 px-1.5 py-0.5 rounded-md",children:x.currentEngagement>=70?"Optimal":"Standard"})]}),e.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-3xl font-black text-slate-850 tracking-tight font-mono",children:[x.currentEngagement,"%"]}),e.jsx("span",{className:"text-xs text-slate-450 font-medium",children:"/ 100"})]}),e.jsx("div",{className:"w-full bg-slate-200/60 rounded-full h-1.5 mt-2 overflow-hidden",children:e.jsx("div",{className:"bg-gradient-to-r from-indigo-500 to-teal-400 h-1.5 rounded-full transition-all duration-500",style:{width:`${x.currentEngagement}%`}})})]}),e.jsxs("div",{className:"bg-gradient-to-br from-amber-50/50 to-orange-50/30 border border-amber-100/70 rounded-xl p-3.5 flex flex-col justify-between shadow-3xs",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-extrabold text-amber-700 uppercase tracking-wider flex items-center gap-1",children:[e.jsx(ye,{size:13}),e.jsx("span",{children:s==="zh"?"互动触发频度":"Interaction Rate"})]}),e.jsxs("span",{className:"text-xs font-bold text-amber-700 bg-amber-100/60 px-1.5 py-0.5 rounded-md",children:[x.totalInteractions," ",s==="zh"?"次":"acts"]})]}),e.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[e.jsx("span",{className:"text-3xl font-black text-slate-850 tracking-tight font-mono",children:x.interactionFrequencyPerMin}),e.jsx("span",{className:"text-xs text-slate-450 font-medium",children:"req / min"})]}),e.jsx("p",{className:"text-2xs text-slate-455 mt-2 truncate",children:s==="zh"?"包含投票、抢答与节奏反馈":"Polls, Buzzers & Pacing"})]}),e.jsxs("div",{className:"bg-gradient-to-br from-emerald-50/50 to-green-50/30 border border-emerald-100/70 rounded-xl p-3.5 flex flex-col justify-between shadow-3xs",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-extrabold text-emerald-700 uppercase tracking-wider flex items-center gap-1",children:[e.jsx(we,{size:13}),e.jsx("span",{children:s==="zh"?"听懂顺畅率":"Pulse Clarity"})]}),e.jsxs("span",{className:"text-xs font-bold text-emerald-700 bg-emerald-100/60 px-1.5 py-0.5 rounded-md",children:[x.pulseDistribution.clearCount," ",s==="zh"?"人次":"clear"]})]}),e.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-3xl font-black text-slate-850 tracking-tight font-mono text-emerald-600",children:[x.pulseDistribution.clearPercent,"%"]}),e.jsx("span",{className:"text-xs text-slate-450 font-medium",children:s==="zh"?"理解无障碍":"comprehension"})]}),e.jsx("div",{className:"w-full bg-slate-200/60 rounded-full h-1.5 mt-2 overflow-hidden",children:e.jsx("div",{className:"bg-emerald-500 h-1.5 rounded-full transition-all duration-500",style:{width:`${x.pulseDistribution.clearPercent}%`}})})]}),e.jsxs("div",{className:"bg-gradient-to-br from-rose-50/50 to-pink-50/30 border border-rose-100/70 rounded-xl p-3.5 flex flex-col justify-between shadow-3xs",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-extrabold text-rose-700 uppercase tracking-wider flex items-center gap-1",children:[e.jsx(Se,{size:13}),e.jsx("span",{children:s==="zh"?"疑问/过快预警":"Confusion Signals"})]}),e.jsxs("span",{className:"text-xs font-bold text-rose-700 bg-rose-100/60 px-1.5 py-0.5 rounded-md",children:[x.pulseDistribution.confusedCount+x.pulseDistribution.tooFastCount," ",s==="zh"?"信号":"signals"]})]}),e.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-3xl font-black text-slate-850 tracking-tight font-mono text-rose-600",children:[x.pulseDistribution.confusedPercent+x.pulseDistribution.tooFastPercent,"%"]}),e.jsx("span",{className:"text-xs text-slate-450 font-medium",children:s==="zh"?"需重点关注":"need attention"})]}),e.jsxs("p",{className:"text-2xs text-rose-600/80 mt-2 truncate font-semibold",children:[x.pulseDistribution.confusedCount," ",s==="zh"?"存疑":"confused"," ·"," ",x.pulseDistribution.tooFastCount," ",s==="zh"?"偏快":"fast"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-5 items-stretch",children:[e.jsxs("div",{className:"lg:col-span-8 bg-slate-50/60 border border-slate-200/70 rounded-2xl p-4 flex flex-col min-h-[300px]",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"text-xs font-black text-slate-800 uppercase tracking-wider flex items-center gap-1.5",children:[e.jsx(ke,{size:14,className:"text-indigo-600"}),e.jsx("span",{children:s==="zh"?"课堂专注度与能量动态走势":"Engagement & Energy Dynamics"})]}),e.jsx("p",{className:"text-xs text-slate-450 mt-0.5",children:s==="zh"?`以分钟为切片的动态能量波(基准线 70% 为最佳心流区间,过去 ${u} 分钟)`:"1-minute interval dynamic waveform (70% optimal flow baseline)"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-2xs font-bold",children:[e.jsxs("span",{className:"flex items-center gap-1 text-teal-700",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-teal-500 inline-block"}),s==="zh"?"专注度 (Engagement %)":"Engagement %"]}),e.jsxs("span",{className:"flex items-center gap-1 text-indigo-700",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-indigo-500 inline-block"}),s==="zh"?"能量波 (Energy Wave)":"Energy Wave"]})]})]}),e.jsx("div",{className:"flex-1 w-full h-[230px] min-h-[220px]",children:e.jsx(Z,{width:"100%",height:"100%",children:e.jsxs(Fe,{data:E,margin:{top:10,right:10,left:-20,bottom:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"engagementGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#14b8a6",stopOpacity:.4}),e.jsx("stop",{offset:"95%",stopColor:"#14b8a6",stopOpacity:0})]}),e.jsxs("linearGradient",{id:"energyGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#6366f1",stopOpacity:.3}),e.jsx("stop",{offset:"95%",stopColor:"#6366f1",stopOpacity:0})]})]}),e.jsx(Oe,{strokeDasharray:"3 3",vertical:!1,stroke:"#e2e8f0"}),e.jsx(ee,{dataKey:"time",tick:{fontSize:11,fill:"#64748b"},stroke:"#cbd5e1",tickLine:!1}),e.jsx(se,{domain:[20,100],tick:{fontSize:11,fill:"#64748b"},stroke:"#cbd5e1",tickLine:!1}),e.jsx(te,{content:({active:r,payload:t})=>{if(r&&t&&t.length){const g=t[0].payload;return e.jsxs("div",{className:"bg-slate-900 text-white rounded-xl p-3 text-xs shadow-xl border border-slate-750 flex flex-col gap-1 min-w-[170px]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-slate-700 pb-1 font-mono text-slate-300",children:[e.jsxs("span",{children:["⏱️ ",g.time]}),e.jsxs("span",{className:"text-emerald-400 font-bold",children:[g.engagement,"% 专注"]})]}),e.jsxs("div",{className:"flex items-center justify-between mt-1 text-slate-200",children:[e.jsx("span",{children:"⚡ 课堂能量波:"}),e.jsxs("span",{className:"font-bold text-indigo-400",children:[g.energy,"%"]})]}),e.jsxs("div",{className:"flex items-center justify-between text-slate-300",children:[e.jsx("span",{children:"🎯 互动操作次数:"}),e.jsxs("span",{className:"font-bold",children:[g.interactions," 次"]})]}),e.jsxs("div",{className:"border-t border-slate-800 pt-1 mt-1 flex justify-between text-2xs text-slate-400",children:[e.jsxs("span",{className:"text-emerald-400",children:["听懂: ",g.clear]}),e.jsxs("span",{className:"text-amber-400",children:["存疑: ",g.confused]}),e.jsxs("span",{className:"text-rose-400",children:["过快: ",g.tooFast]})]})]})}return null}}),e.jsx(_e,{y:70,stroke:"#10b981",strokeDasharray:"4 4",label:{value:s==="zh"?"黄金心流区间 70%":"Optimal Flow 70%",fill:"#059669",fontSize:10,position:"insideTopLeft"}}),e.jsx(ae,{type:"monotone",dataKey:"engagement",name:"Engagement",stroke:"#0d9488",strokeWidth:2.5,fillOpacity:1,fill:"url(#engagementGradient)"}),e.jsx(ae,{type:"monotone",dataKey:"energy",name:"Energy",stroke:"#6366f1",strokeWidth:2,fillOpacity:1,fill:"url(#energyGradient)"})]})})})]}),e.jsxs("div",{className:"lg:col-span-4 bg-slate-50/60 border border-slate-200/70 rounded-2xl p-4 flex flex-col justify-between min-h-[300px]",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("span",{className:"text-xs font-black text-slate-800 uppercase tracking-wider flex items-center gap-1.5",children:[e.jsx(Ce,{size:14,className:"text-teal-600"}),e.jsx("span",{children:s==="zh"?"学生脉搏反馈占比":"Pulse Distribution"})]}),e.jsxs("span",{className:"text-xs text-slate-500 font-bold",children:[x.pulseDistribution.total," ",s==="zh"?"总票数":"total"]})]}),e.jsx("p",{className:"text-xs text-slate-450 mb-3",children:s==="zh"?"30秒极速自检晴雨表反馈结构":"Direct student pacing signal distribution"}),e.jsx("div",{className:"h-[120px] w-full",children:e.jsx(Z,{width:"100%",height:"100%",children:e.jsxs(Be,{data:R,layout:"vertical",margin:{top:0,right:30,left:10,bottom:0},children:[e.jsx(ee,{type:"number",domain:[0,100],hide:!0}),e.jsx(se,{type:"category",dataKey:"name",tick:{fontSize:11,fill:"#334155",fontWeight:600},width:85,axisLine:!1,tickLine:!1}),e.jsx(te,{formatter:(r,t,g)=>[`${r}% (${g.payload.count}人次)`,"占比"]}),e.jsx(Re,{dataKey:"percent",radius:[0,8,8,0],barSize:18,children:R.map((r,t)=>e.jsx(qe,{fill:r.color},`cell-${t}`))})]})})})]}),e.jsxs("div",{className:"mt-3 border-t border-slate-200/70 pt-3",children:[e.jsx("span",{className:"text-2xs font-bold uppercase tracking-wider text-slate-450 block mb-1.5",children:s==="zh"?"最新动态流水":"Latest Live Signals"}),D.length===0?e.jsx("div",{className:"text-2xs text-slate-400 py-1 italic",children:s==="zh"?"等待学生端点击晴雨表或参与抢答投票...":"Listening for live student signals or polls..."}):e.jsx("div",{className:"space-y-1.5 max-h-[70px] overflow-y-auto pr-1",children:D.map(r=>e.jsxs("div",{className:"flex items-center justify-between text-2xs py-1 px-2 bg-white rounded-lg border border-slate-200/60 shadow-3xs",children:[e.jsx("span",{className:"font-semibold text-slate-700 truncate max-w-[160px]",children:r.text}),e.jsx("span",{className:"font-mono text-slate-400 shrink-0",children:r.time})]},r.id))})]})]})]}),e.jsxs("div",{className:`p-3.5 rounded-xl border flex items-center gap-3 transition-all ${k.type==="warning"?"bg-amber-500/10 border-amber-500/30 text-amber-900":k.type==="caution"?"bg-rose-500/10 border-rose-500/30 text-rose-900":"bg-emerald-500/10 border-emerald-500/30 text-emerald-900"}`,children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-white/80 flex items-center justify-center shrink-0 shadow-3xs",children:e.jsx(ze,{size:18,className:k.type==="warning"?"text-amber-600":k.type==="caution"?"text-rose-600":"text-emerald-600"})}),e.jsxs("div",{className:"flex-1 text-xs",children:[e.jsx("span",{className:"font-bold mr-1.5",children:s==="zh"?"AI 教学节奏诊断建议:":"Teaching Pace Advice:"}),e.jsx("span",{children:k.text})]})]})]})}function We({classDashboardMap:s,classes:i,lang:C}){const m=C==="zh",h=c.useMemo(()=>{const l=Object.keys(s);if(l.length===0)return null;let j=0,u=0,v=0,y=0,z=0,P=0;for(const D of l){const M=s[D];if(!M)continue;const x=M.performance??[],I=M.rollcallStats??[];for(const b of x)b.score!=null&&!isNaN(Number(b.score))&&(j+=Number(b.score),u++);const E=new Map;for(const b of x)(b.submission_status==="submitted"||b.score!=null)&&E.set(b.student_id,!0);v+=I.length||0,y+=E.size;for(const b of I)z+=b.count??0,P++}const S=u>0?Math.round(j/u):null,$=v>0?Math.round(y/v*100):null,A=P>0?(z/P).toFixed(1):null;return{avgGrade:S,attendanceRate:$,participationScore:A,classCount:l.length}},[s]);if(!h)return e.jsxs("div",{className:"bg-surface border border-theme rounded-2xl p-5 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(V,{size:16,className:"text-primary-theme"}),e.jsx("h3",{className:"text-sm font-black text-main",children:m?"班级综合数据概览":"Class Summary Stats"})]}),e.jsx("p",{className:"text-xs text-muted text-center py-6",children:m?"暂无班级数据,展开班级卡片后将自动加载":"No class data yet — expand a class card to load data"})]});const w=[{icon:Pe,label:m?"平均成绩":"Average Grade",value:h.avgGrade!=null?`${h.avgGrade}`:"—",suffix:h.avgGrade!=null?m?"分":"pts":"",hint:m?"基于已评分作业":"Based on graded assignments",tone:"text-emerald-700 bg-emerald-50 border-emerald-200/80 dark:bg-emerald-950/40 dark:border-emerald-800/70 dark:text-emerald-300",iconBg:"bg-emerald-100 dark:bg-emerald-900/50"},{icon:H,label:m?"出勤提交率":"Submission Rate",value:h.attendanceRate!=null?`${h.attendanceRate}`:"—",suffix:h.attendanceRate!=null?"%":"",hint:m?"至少提交过一次作业的学生占比":"Students with at least one submission",tone:"text-blue-700 bg-blue-50 border-blue-200/80 dark:bg-blue-950/40 dark:border-blue-800/70 dark:text-blue-300",iconBg:"bg-blue-100 dark:bg-blue-900/50"},{icon:de,label:m?"课堂参与频次":"Participation Freq.",value:h.participationScore??"—",suffix:h.participationScore!=null?m?"次/人":"/student":"",hint:m?"平均点名回答次数":"Average rollcall picks per student",tone:"text-amber-700 bg-amber-50 border-amber-200/80 dark:bg-amber-950/40 dark:border-amber-800/70 dark:text-amber-300",iconBg:"bg-amber-100 dark:bg-amber-900/50"}];return e.jsxs("div",{className:"bg-surface border border-theme rounded-2xl p-5 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{size:16,className:"text-primary-theme"}),e.jsx("h3",{className:"text-sm font-black text-main",children:m?"班级综合数据概览":"Class Summary Stats"})]}),e.jsx("span",{className:"text-2xs font-semibold text-muted px-2 py-0.5 rounded-lg bg-surface-secondary border border-theme",children:m?`已加载 ${h.classCount} 个班级`:`${h.classCount} class(es) loaded`})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:w.map(l=>{const j=l.icon;return e.jsxs("div",{className:"rounded-xl border border-theme bg-surface-secondary p-4 flex items-start gap-3",children:[e.jsx("div",{className:`w-9 h-9 rounded-lg ${l.iconBg} border border-theme flex items-center justify-center shrink-0`,children:e.jsx(j,{size:16,className:l.tone.split(" ")[0]})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-2xs text-muted font-medium truncate",children:l.label}),e.jsxs("div",{className:"flex items-baseline gap-1 mt-0.5",children:[e.jsx("span",{className:`text-lg font-black font-mono leading-none ${l.tone.split(" ")[0]}`,children:l.value}),l.suffix&&e.jsx("span",{className:"text-2xs text-muted font-medium",children:l.suffix})]}),e.jsx("div",{className:"text-2xs text-subtle mt-1 truncate",children:l.hint})]})]},l.label)})})]})}function es(s){const{lang:i,t:C,lessons:m,classes:h,students:w,todaySchedules:l,approvals:j,processes:u,isApprovalsCollapsed:v,setIsApprovalsCollapsed:y,isProcessesCollapsed:z,setIsProcessesCollapsed:P,scoreOverrides:S,setScoreOverrides:$,handleApprove:A,handleReject:D,showLogs:M,setShowLogs:x,processLogsContent:I,showProcessLogs:E,fetchProcessLogs:b,setShowProcessLogs:L,addToast:N,handleQuickScheduleClass:_,handleQuickGenerateAssignment:T,handleQuickCreateLesson:R,classDashboardMap:O}=s,[k,r]=c.useState("overview"),[t,g]=c.useState(null);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-y-auto pr-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-1 border-b border-theme/50",children:[e.jsxs("div",{className:"flex items-center gap-1.5 bg-surface-secondary p-1 rounded-xl border border-theme w-fit",children:[e.jsxs("button",{id:"teacher-dashboard-overview-tab","data-testid":"teacher-dashboard-overview-tab",onClick:()=>r("overview"),className:`px-3.5 py-1.5 rounded-lg text-xs font-bold flex items-center gap-2 transition-all cursor-pointer ${k==="overview"?"bg-surface text-primary-theme shadow-xs":"text-muted hover:text-main"}`,children:[e.jsx(Me,{size:14}),e.jsx("span",{children:i==="zh"?"综合总览":"Overview"})]}),e.jsxs("button",{id:"teacher-dashboard-classroom-tab","data-testid":"teacher-dashboard-classroom-tab",onClick:()=>r("classroom"),className:`px-3.5 py-1.5 rounded-lg text-xs font-bold flex items-center gap-2 transition-all cursor-pointer ${k==="classroom"?"bg-surface text-primary-theme shadow-xs":"text-muted hover:text-main"}`,children:[e.jsx(De,{size:14}),e.jsx("span",{children:i==="zh"?"课堂互动 (Classroom)":"Classroom"}),e.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-500 animate-pulse"})]})]}),e.jsx("div",{className:"flex items-center gap-2 text-xs text-muted",children:e.jsxs("span",{className:"font-medium",children:[i==="zh"?"当前视图:":"View:"," ",e.jsx("span",{className:"text-main font-bold",children:k==="overview"?i==="zh"?"日常综合总览":"Overview":i==="zh"?"课堂随堂优秀榜与态势追踪":"Classroom Top Performers & Flow"})]})})]}),k==="classroom"?e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(We,{classDashboardMap:O,classes:h,lang:i}),e.jsxs("div",{className:"bg-surface border border-theme rounded-2xl p-5 shadow-sm",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-3",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-black text-main flex items-center gap-2",children:[e.jsx(Le,{size:16,className:"text-primary-theme"}),e.jsx("span",{children:i==="zh"?"课堂全班倒计时调度与广播":"Classroom Countdown Dispatcher"})]}),e.jsx("p",{className:"text-xs text-muted",children:i==="zh"?"实时向所有学生端同步广播任务倒计时,支持随堂测验、分组探究与限时答题":"Broadcast real-time countdown to connected students with presets and third-party plugin extensions"})]}),m.length>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("select",{value:t||m[0]?.id||"",onChange:a=>g(a.target.value),className:"px-3 py-1.5 bg-surface-secondary border border-theme rounded-xl text-xs font-semibold text-main outline-none focus:ring-2 focus:ring-primary-theme cursor-pointer",children:m.map(a=>e.jsx("option",{value:a.id,children:a.title},a.id))})})]}),e.jsx(Ee,{lessonId:t||m[0]?.id||null,lang:i,compact:!1,onlineStudentCount:w.length})]}),e.jsx(Y,{lang:i,lessons:m,classes:h,schedules:l,students:w,addToast:N}),e.jsx(ne,{lang:i,lessons:m,classes:h,schedules:l,students:w,addToast:N})]}):e.jsxs(e.Fragment,{children:[(()=>{const a=d=>{if(d.status==="cancelled"||d.status==="holiday")return!1;if(!d.time_slot)return!0;try{const p=d.time_slot.split("-");if(p.length<2)return!0;const B=p[1].trim(),[F,q]=B.split(":").map(Number),G=new Date,Q=G.getHours(),ce=G.getMinutes();return!(Q>F||Q===F&&ce>=q)}catch{return!0}},o=l.filter(a),f=l.length-o.length;l.filter(d=>d.status==="cancelled"||d.status==="holiday");const n=o[0];return e.jsxs("div",{className:"bg-white border border-slate-200/80 rounded-2xl p-5 text-slate-800 shadow-sm flex flex-col md:flex-row justify-between items-stretch gap-6 transition-all duration-300",children:[e.jsx("div",{className:"flex-1 flex flex-col justify-between bg-slate-50/50 rounded-xl p-4.5 border border-slate-200/60 min-h-[160px]",children:n?e.jsxs("div",{className:"flex-1 flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"bg-amber-400 text-slate-950 text-xs font-extrabold px-2.5 py-0.5 rounded-full uppercase tracking-wider animate-pulse shadow-xs",children:i==="zh"?"下一堂面授课":"NEXT CLASS"}),e.jsx("span",{className:"font-mono text-xs text-indigo-700 font-bold bg-indigo-50 px-2 py-0.5 rounded-md border border-indigo-100/30",children:n.time_slot})]}),e.jsx("h3",{className:"text-lg md:text-xl font-extrabold tracking-tight mt-3 text-slate-800 line-clamp-2",title:n.lesson_title,children:n.lesson_title}),e.jsxs("p",{className:"text-xs text-slate-500 mt-2 font-medium",children:["📍 ",n.class_name," ",n.classroom&&` | 教室: ${n.classroom}`," ",n.teacher_name&&` | 教师: ${n.teacher_name}`]})]}),n.notes&&e.jsxs("div",{className:"mt-3 text-xs italic text-indigo-700 bg-indigo-50/60 p-2 rounded-lg border border-indigo-100/40 truncate",title:n.notes,children:["* ",n.notes]})]}):e.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center text-center py-6 select-none",children:[e.jsx("span",{className:"text-3xl animate-bounce",children:"☕"}),e.jsx("h3",{className:"text-base font-extrabold text-slate-850 mt-2",children:i==="zh"?"今日课程已全部结束":"All Classes Finished"}),e.jsx("p",{className:"text-xs text-slate-455 mt-1 max-w-[280px]",children:i==="zh"?"接下来暂无排定课次,您可以休息调整。":"No remaining schedules today. Take a rest!"})]})}),e.jsxs("div",{className:"w-full md:w-[300px] lg:w-[350px] flex flex-col gap-3",children:[e.jsxs("div",{className:"flex justify-between items-center border-b border-slate-200/80 pb-2",children:[e.jsxs("span",{className:"text-xs uppercase font-extrabold tracking-wider text-indigo-600 flex items-center gap-1.5",children:["📅 ",i==="zh"?"今日面授排课流":"TODAY'S SCHEDULES"]}),e.jsx("span",{className:"text-xs text-slate-500 font-medium",children:i==="zh"?`共 ${l.length} 节 | 已下课 ${f} 节`:`Total ${l.length} | Done ${f}`})]}),l.length===0?e.jsxs("div",{className:"flex-1 flex items-center justify-center text-xs font-bold text-slate-450 py-6",children:["☕ ",i==="zh"?"今日暂无排定课次":"No schedules configured."]}):e.jsx("div",{className:"space-y-2 max-h-[150px] overflow-y-auto pr-1",children:l.map(d=>{const p=n&&d.id===n.id,B=o.some(G=>G.id===d.id)&&!p,F=d.status==="cancelled"||d.status==="holiday",q=!p&&!B&&!F;return e.jsxs("div",{className:`flex items-center justify-between text-xs py-1 border-b border-slate-100 last:border-b-0 ${q?"opacity-50":F?"opacity-35 line-through":""}`,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"font-mono text-xs text-slate-500 shrink-0",children:d.time_slot}),e.jsx("span",{className:`font-bold truncate max-w-[120px] lg:max-w-[150px] ${p?"text-indigo-650":"text-slate-700"}`,title:d.lesson_title,children:d.lesson_title}),e.jsxs("span",{className:"text-xs text-slate-455 truncate max-w-[60px] lg:max-w-[80px]",children:["(",d.class_name,")"]})]}),e.jsxs("div",{className:"shrink-0 ml-2",children:[p&&e.jsx("span",{className:"bg-amber-400 text-slate-950 font-extrabold text-xs px-1.5 py-0.5 rounded uppercase scale-90 inline-block animate-pulse shadow-xs",children:"进行"}),q&&e.jsx("span",{className:"bg-slate-100 text-slate-500 text-xs px-1.5 py-0.5 rounded font-bold",children:"已完"}),B&&e.jsx("span",{className:"bg-indigo-50 text-indigo-700 text-xs px-1.5 py-0.5 rounded font-medium border border-indigo-100/50",children:"待上"}),F&&e.jsx("span",{className:"bg-rose-50 text-rose-600 text-xs px-1.5 py-0.5 rounded font-bold border border-rose-100/50",children:"停课"})]})]},d.id)})})]})]})})(),e.jsx(me,{slot:"teacher.dashboard.widget"}),e.jsx(Y,{lang:i,lessons:m,classes:h,schedules:l,students:w,addToast:N}),e.jsx(ne,{lang:i,lessons:m,classes:h,schedules:l,students:w,addToast:N}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50/60 to-indigo-100/10 border border-indigo-100/60 rounded-2xl p-5 shadow-xs flex items-center justify-between hover:shadow-sm hover:-translate-y-0.5 transition-all duration-300",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-bold text-indigo-655 uppercase tracking-wider",children:i==="zh"?"课程数量":"Total Courses"}),e.jsx("span",{className:"text-3xl font-extrabold text-slate-800 tracking-tight leading-none mt-1",children:m.length})]}),e.jsx("div",{className:"p-3 bg-indigo-500/10 text-indigo-600 rounded-xl",children:e.jsx(W,{size:24})})]}),e.jsxs("div",{className:"bg-gradient-to-br from-pink-50/60 to-pink-100/10 border border-pink-100/60 rounded-2xl p-5 shadow-xs flex items-center justify-between hover:shadow-sm hover:-translate-y-0.5 transition-all duration-300",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-bold text-pink-600 uppercase tracking-wider",children:i==="zh"?"班级数量":"Total Classes"}),e.jsx("span",{className:"text-3xl font-extrabold text-slate-800 tracking-tight leading-none mt-1",children:h.length})]}),e.jsx("div",{className:"p-3 bg-pink-500/10 text-pink-600 rounded-xl",children:e.jsx(Te,{size:24})})]}),e.jsxs("div",{className:"bg-gradient-to-br from-emerald-50/60 to-emerald-100/10 border border-emerald-100/60 rounded-2xl p-5 shadow-xs flex items-center justify-between hover:shadow-sm hover:-translate-y-0.5 transition-all duration-300",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-bold text-emerald-650 uppercase tracking-wider",children:i==="zh"?"学生数量":"Total Students"}),e.jsx("span",{className:"text-3xl font-extrabold text-slate-800 tracking-tight leading-none mt-1",children:w.length})]}),e.jsx("div",{className:"p-3 bg-emerald-500/10 text-emerald-600 rounded-xl",children:e.jsx(H,{size:24})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 items-start",children:[e.jsxs("div",{className:"bg-white border border-rose-100 rounded-2xl shadow-sm flex flex-col transition-all duration-300",children:[e.jsxs("div",{onClick:()=>y(!v),className:"p-4 border-b border-rose-50 flex items-center justify-between cursor-pointer select-none hover:bg-rose-50/20 rounded-t-2xl transition-colors",children:[e.jsxs("h3",{className:"font-extrabold text-sm md:text-base text-rose-700 flex items-center gap-2",children:[e.jsx($e,{size:18}),C.approvals,j.length>0&&e.jsx("span",{className:"bg-rose-100 text-rose-700 text-xs px-2 py-0.5 rounded-full font-bold ml-1",children:j.length})]}),e.jsx("div",{className:"text-rose-400 hover:text-rose-600 transition-colors",children:v?e.jsx(X,{size:18}):e.jsx(J,{size:18})})]}),!v&&e.jsx("div",{className:"flex-1 overflow-y-auto p-3 max-h-[350px]",children:j.length===0?e.jsx("div",{className:"text-center p-8 text-xs md:text-sm text-slate-400 font-medium",children:C.noApprovals}):j.map(a=>{let o={};try{o=JSON.parse(a.payload||"{}")}catch{}const f=a.command_type==="ai.apply_grade",n=S[a.id]!==void 0?S[a.id]:o.score||0;return e.jsxs("div",{className:"w-full p-4 rounded-xl text-sm bg-slate-55 border border-slate-100 mb-3 shadow-3xs flex flex-col gap-3 hover:border-rose-150 transition-colors",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-extrabold text-slate-800 mb-1",children:a.command_type==="ai.apply_grade"?"🎓 Evaluate Submission":a.command_type}),e.jsx("div",{className:"text-xs text-slate-500 font-mono mb-2 line-clamp-2 bg-white border border-slate-100 p-2 rounded-lg",title:a.payload,children:f?`Feedback: ${o.feedback}`:a.payload})]}),f&&e.jsxs("div",{className:"bg-white border border-slate-150 p-2 rounded-xl flex items-center justify-between gap-3",children:[e.jsx("label",{className:"text-xs font-bold text-slate-700",children:"Modify Score:"}),e.jsx("input",{type:"number",className:"w-20 border border-slate-200 rounded-lg px-2 py-1 text-xs focus:ring-2 focus:ring-indigo-500 outline-none transition-all",value:n,onChange:d=>$(p=>({...p,[a.id]:parseInt(d.target.value)||0}))})]}),e.jsxs("div",{className:"flex gap-2 justify-end mt-1",children:[e.jsxs("button",{onClick:()=>A(a.id,f&&S[a.id]!==void 0?{score:S[a.id]}:void 0),className:"p-1.5 px-3.5 bg-rose-600 hover:bg-rose-700 text-white rounded-lg font-bold text-xs flex items-center gap-1.5 shadow-sm transition-all animate-none",children:[e.jsx(Ae,{size:14})," ",C.approve]}),e.jsxs("button",{onClick:()=>D(a.id),className:"p-1.5 px-3.5 bg-slate-100 hover:bg-slate-200 text-slate-750 rounded-lg font-bold text-xs flex items-center gap-1.5 shadow-3xs transition-all",children:[e.jsx(re,{size:14})," ",C.reject]})]})]},a.id)})})]}),e.jsxs("div",{className:"bg-white border border-slate-200/60 rounded-2xl shadow-sm flex flex-col transition-all duration-300",children:[e.jsxs("div",{onClick:()=>P(!z),className:"p-4 border-b border-slate-100 flex items-center justify-between cursor-pointer select-none hover:bg-slate-50/20 rounded-t-2xl transition-colors",children:[e.jsxs("h3",{className:"font-extrabold text-sm md:text-base text-slate-700 flex items-center gap-2",children:[e.jsx(oe,{size:18,className:"text-indigo-500"}),C.processes,u.length>0&&e.jsx("span",{className:"bg-indigo-50 text-indigo-700 text-xs px-2 py-0.5 rounded-full font-bold ml-1",children:u.length})]}),e.jsx("div",{className:"text-slate-400 hover:text-slate-650 transition-colors",children:z?e.jsx(X,{size:18}):e.jsx(J,{size:18})})]}),!z&&e.jsx("div",{className:"flex-1 overflow-y-auto p-3 max-h-[350px]",children:u.length===0?e.jsx("div",{className:"text-center p-8 text-xs md:text-sm text-slate-400 font-medium",children:C.noProcesses}):u.map(a=>e.jsxs("div",{className:"w-full p-4 rounded-xl text-sm bg-slate-50 border border-slate-100 mb-3 shadow-3xs flex flex-col gap-2.5 hover:border-indigo-150 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"font-extrabold text-slate-800 truncate",title:a.name,children:a.name}),e.jsx("span",{className:`text-xs uppercase px-2 py-0.5 rounded-full font-bold ${a.status==="running"?"bg-blue-100 text-blue-700":a.status==="completed"?"bg-emerald-100 text-emerald-700":a.status==="failed"?"bg-rose-100 text-rose-700":"bg-slate-200 text-slate-700"}`,children:a.status})]}),e.jsxs("div",{className:"flex justify-between items-center mt-1",children:[e.jsxs("span",{className:"text-xs text-slate-400 font-mono",children:["PID: ",a.id]}),e.jsx("button",{onClick:()=>L(a.id),className:"text-xs font-bold text-indigo-650 hover:text-indigo-850 transition-colors",children:C.processLogs})]})]},a.id))})]})]})]})]}),e.jsx(Ge,{classes:h,lessons:m,lang:i,onScheduleClass:_,onGenerateAssignment:async(a,o)=>!!await T(a,o,o),onCreateLesson:async(a,o)=>!!await R(a,o)})]})}export{es as Dashboard};
@@ -1 +1 @@
1
- import{j as e}from"./vendor-react-B0t7H3hh.js";import{m as z}from"./index-C7jMgry5.js";import{as as k,at as C,ag as S,v as $,D as q}from"./vendor-icons-30iiuCQb.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-Bw0ZQZtM.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-pptx-C5-U7ieS.js";import"./vendor-charts-U9fLlNC_.js";function F({isExportWeightModalOpen:f,setIsExportWeightModalOpen:x,lang:s,quizzesWeight:g,setQuizzesWeight:h,assignmentsWeight:m,setAssignmentsWeight:b,handleQuizzesWeightChange:p,handleAssignmentsWeightChange:j,customCategoryOverrides:u,setCustomCategoryOverrides:y,classDashboardMap:i,exportClassId:r,exportClassName:N,csvPreviewData:n,handleExportGrades:v}){return f?e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-sm flex items-center justify-center p-6 z-50",children:e.jsxs(z.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-2xl flex flex-col overflow-hidden max-h-[85vh]",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{className:"text-indigo-600 font-sans",size:20}),e.jsx("h2",{className:"font-bold text-gray-800 text-lg font-sans",children:s==="zh"?"导出成绩权重设置":"Grade Export & Weighting Settings"})]}),e.jsx("button",{onClick:()=>x(!1),className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors text-lg",children:"×"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[e.jsx("div",{className:"bg-indigo-50 border border-indigo-150 rounded-xl p-4 text-indigo-800 text-xs font-sans leading-relaxed",children:s==="zh"?"您可以自定义测验与作业在期末成绩(平均分)中的计算权重。系统已根据测验名和内容自动对课程内容进行分类,您可以在下方手动微调分类。":"Customize the calculation weight of quizzes and assignments in the calculated average score. The system automatically classifies items, but you can manually override categorized groups below."}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center gap-2 font-sans",children:[e.jsx(C,{size:16,className:"text-indigo-500 font-sans"}),s==="zh"?"定义成绩占比权重":"Define Weighting Percentages"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 bg-gray-50 p-4 rounded-xl border border-gray-100 font-sans",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-700",children:s==="zh"?"测验权重 (Quizzes)":"Quizzes Weight"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded border border-indigo-100",children:[g,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"100",value:g,onChange:t=>p(Number(t.target.value)),className:"w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-indigo-600"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-700",children:s==="zh"?"作业权重 (Assignments)":"Assignments Weight"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded border border-indigo-100",children:[m,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"100",value:m,onChange:t=>j(Number(t.target.value)),className:"w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-indigo-600"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{h(50),b(50)},className:"text-xs text-gray-500 hover:text-gray-700 bg-white border border-gray-200 hover:bg-gray-50 font-bold px-2.5 py-1 rounded transition-colors cursor-pointer",children:s==="zh"?"均衡配比 50/50":"Balance 50/50"}),e.jsx("button",{type:"button",onClick:()=>{h(40),b(60)},className:"text-xs text-gray-500 hover:text-gray-700 bg-white border border-gray-200 hover:bg-gray-50 font-bold px-2.5 py-1 rounded transition-colors cursor-pointer",children:s==="zh"?"推荐配比 40/60":"Recommend 40/60"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center justify-between font-sans",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(S,{size:16,className:"text-indigo-500"}),s==="zh"?"期末考核项目微调":"Item Categorization Overrides"]}),e.jsx("span",{className:"text-xs text-gray-400 font-medium font-sans",children:s==="zh"?`共 ${i[r]?.assignments?.length||0} 项`:`${i[r]?.assignments?.length||0} items total`})]}),e.jsxs("div",{className:"border border-gray-150 rounded-xl overflow-hidden divide-y divide-gray-100 max-h-60 overflow-y-auto bg-white shadow-inner",children:[(i[r]?.assignments||[]).map(t=>{const d=t.content&&t.content.startsWith('{"quizType":"mcq_learning_objectives"'),l=t.title&&(t.title.toLowerCase().includes("quiz")||t.title.toLowerCase().includes("test")||t.title.includes("测验")||t.title.includes("测试")),o=d||l?"quiz":"assignment",a=u[t.id]||o;return e.jsxs("div",{className:"p-3 flex items-center justify-between gap-4 font-sans hover:bg-gray-50/50 transition-colors",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-semibold text-xs text-gray-800 truncate",title:t.title,children:t.title}),e.jsx("div",{className:"text-xs text-gray-400 truncate mt-0.5",children:t.description||(s==="zh"?"无描述信息":"No description provided")})]}),e.jsxs("div",{className:"flex border border-gray-200 rounded-lg p-0.5 bg-gray-50 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>y(c=>({...c,[t.id]:"quiz"})),className:`px-2.5 py-1 text-xs font-bold rounded-md transition-all cursor-pointer ${a==="quiz"?"bg-indigo-600 text-white shadow":"text-gray-500 hover:text-gray-800 hover:bg-gray-100"}`,children:s==="zh"?"测验":"Quiz"}),e.jsx("button",{type:"button",onClick:()=>y(c=>({...c,[t.id]:"assignment"})),className:`px-2.5 py-1 text-xs font-bold rounded-md transition-all cursor-pointer ${a==="assignment"?"bg-emerald-600 text-white shadow":"text-gray-500 hover:text-gray-800 hover:bg-gray-100"}`,children:s==="zh"?"作业":"Assignment"})]})]},t.id)}),(!i[r]?.assignments||i[r].assignments.length===0)&&e.jsx("div",{className:"p-8 text-center text-xs text-gray-400 italic",children:s==="zh"?"此班级暂未创建任何考核项目":"No graded items exist in this class."})]})]}),n&&n.rows.length>0&&e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center justify-between font-sans",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx($,{size:16,className:"text-emerald-500"}),s==="zh"?"CSV 实时成绩表预览 (前5行数据)":"Live CSV Grade Preview (First 5 Rows)"]}),e.jsx("span",{className:"text-xs bg-emerald-50 text-emerald-700 border border-emerald-100 font-bold px-2 py-0.5 rounded shadow-xs font-sans",children:s==="zh"?`展示 5 / ${n.totalStudents} 名学生`:`Showing 5 of ${n.totalStudents} students`})]}),e.jsx("div",{className:"border border-gray-150 rounded-xl overflow-hidden bg-white shadow-xs max-w-full",children:e.jsx("div",{className:"overflow-x-auto max-h-56 overflow-y-auto",children:e.jsxs("table",{className:"w-full border-collapse text-left",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-gray-50 border-b border-gray-150 sticky top-0 z-10",children:n.headers.map((t,d)=>{const l=t.includes("Average")||t.includes("Avg")||t.includes("Score"),o=t.includes("Weighted");return e.jsx("th",{className:`p-2.5 text-xs font-bold tracking-wider uppercase border-r border-gray-150 whitespace-nowrap font-sans font-semibold ${o?"text-indigo-700 bg-indigo-50/70 border-indigo-150 font-bold":l?"text-emerald-700 bg-emerald-50/70":"text-gray-500"}`,children:t},d)})})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:n.rows.map((t,d)=>e.jsx("tr",{className:"hover:bg-gray-50/50 transition-colors font-mono text-xs",children:t.map((l,o)=>{const a=n.headers[o]||"",c=a.includes("Weighted"),w=a.includes("Average")||a.includes("Avg")||a.includes("Score");return e.jsx("td",{className:`p-2 border-r border-gray-100 font-mono text-xs text-gray-700 whitespace-nowrap text-center ${c?"bg-indigo-50/30 font-bold text-indigo-700 border-indigo-100":w?"bg-emerald-50/10 font-semibold text-emerald-800":o<2?"text-left font-sans font-medium":""}`,children:l},o)})},d))})]})})}),e.jsx("p",{className:"text-xs text-gray-400 font-sans italic",children:s==="zh"?"* 改变上方权重占比或调整项目分类时,此预览与计算结果会立即实时刷新。":"* Calculations and layout values in this preview refresh dynamically as you tweak sliders and overrides."})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 bg-gray-50/85 flex justify-end gap-2.5 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>x(!1),className:"px-4 py-2 text-xs font-semibold border border-gray-300 text-gray-700 bg-white rounded-lg hover:bg-gray-100 transition-colors cursor-pointer",children:s==="zh"?"取消":"Cancel"}),e.jsxs("button",{type:"button",disabled:!i[r]?.assignments||i[r].assignments.length===0,onClick:()=>{v(r,N,g,m,u),x(!1)},className:"px-4 py-2 text-xs font-bold bg-indigo-600 text-white border border-indigo-700 rounded-lg hover:bg-indigo-700 hover:shadow shadow-sm transition-all flex items-center gap-1.5 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(q,{size:14}),s==="zh"?"导出 CSV 成绩表":"Export Grade Sheet"]})]})]})}):null}export{F as ExportWeightModal};
1
+ import{j as e}from"./vendor-react-B0t7H3hh.js";import{m as z}from"./index-BQF_s4QO.js";import{aD as k,aE as C,an as S,v as $,D as q}from"./vendor-icons-BRmhY6fg.js";import"./vendor-utils-m0Urvtws.js";import"./vendor-pdf-D7rGevI1.js";import"./vendor-motion-BFAPOs-b.js";import"./vendor-pptx-C5-U7ieS.js";import"./vendor-charts-qLbgF1eL.js";function F({isExportWeightModalOpen:f,setIsExportWeightModalOpen:x,lang:s,quizzesWeight:g,setQuizzesWeight:h,assignmentsWeight:m,setAssignmentsWeight:b,handleQuizzesWeightChange:p,handleAssignmentsWeightChange:j,customCategoryOverrides:u,setCustomCategoryOverrides:y,classDashboardMap:i,exportClassId:r,exportClassName:N,csvPreviewData:n,handleExportGrades:v}){return f?e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-sm flex items-center justify-center p-6 z-50",children:e.jsxs(z.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-2xl flex flex-col overflow-hidden max-h-[85vh]",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{className:"text-indigo-600 font-sans",size:20}),e.jsx("h2",{className:"font-bold text-gray-800 text-lg font-sans",children:s==="zh"?"导出成绩权重设置":"Grade Export & Weighting Settings"})]}),e.jsx("button",{onClick:()=>x(!1),className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors text-lg",children:"×"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[e.jsx("div",{className:"bg-indigo-50 border border-indigo-150 rounded-xl p-4 text-indigo-800 text-xs font-sans leading-relaxed",children:s==="zh"?"您可以自定义测验与作业在期末成绩(平均分)中的计算权重。系统已根据测验名和内容自动对课程内容进行分类,您可以在下方手动微调分类。":"Customize the calculation weight of quizzes and assignments in the calculated average score. The system automatically classifies items, but you can manually override categorized groups below."}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center gap-2 font-sans",children:[e.jsx(C,{size:16,className:"text-indigo-500 font-sans"}),s==="zh"?"定义成绩占比权重":"Define Weighting Percentages"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 bg-gray-50 p-4 rounded-xl border border-gray-100 font-sans",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-700",children:s==="zh"?"测验权重 (Quizzes)":"Quizzes Weight"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded border border-indigo-100",children:[g,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"100",value:g,onChange:t=>p(Number(t.target.value)),className:"w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-indigo-600"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-700",children:s==="zh"?"作业权重 (Assignments)":"Assignments Weight"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded border border-indigo-100",children:[m,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"100",value:m,onChange:t=>j(Number(t.target.value)),className:"w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-indigo-600"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{h(50),b(50)},className:"text-xs text-gray-500 hover:text-gray-700 bg-white border border-gray-200 hover:bg-gray-50 font-bold px-2.5 py-1 rounded transition-colors cursor-pointer",children:s==="zh"?"均衡配比 50/50":"Balance 50/50"}),e.jsx("button",{type:"button",onClick:()=>{h(40),b(60)},className:"text-xs text-gray-500 hover:text-gray-700 bg-white border border-gray-200 hover:bg-gray-50 font-bold px-2.5 py-1 rounded transition-colors cursor-pointer",children:s==="zh"?"推荐配比 40/60":"Recommend 40/60"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center justify-between font-sans",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(S,{size:16,className:"text-indigo-500"}),s==="zh"?"期末考核项目微调":"Item Categorization Overrides"]}),e.jsx("span",{className:"text-xs text-gray-400 font-medium font-sans",children:s==="zh"?`共 ${i[r]?.assignments?.length||0} 项`:`${i[r]?.assignments?.length||0} items total`})]}),e.jsxs("div",{className:"border border-gray-150 rounded-xl overflow-hidden divide-y divide-gray-100 max-h-60 overflow-y-auto bg-white shadow-inner",children:[(i[r]?.assignments||[]).map(t=>{const d=t.content&&t.content.startsWith('{"quizType":"mcq_learning_objectives"'),l=t.title&&(t.title.toLowerCase().includes("quiz")||t.title.toLowerCase().includes("test")||t.title.includes("测验")||t.title.includes("测试")),o=d||l?"quiz":"assignment",a=u[t.id]||o;return e.jsxs("div",{className:"p-3 flex items-center justify-between gap-4 font-sans hover:bg-gray-50/50 transition-colors",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-semibold text-xs text-gray-800 truncate",title:t.title,children:t.title}),e.jsx("div",{className:"text-xs text-gray-400 truncate mt-0.5",children:t.description||(s==="zh"?"无描述信息":"No description provided")})]}),e.jsxs("div",{className:"flex border border-gray-200 rounded-lg p-0.5 bg-gray-50 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>y(c=>({...c,[t.id]:"quiz"})),className:`px-2.5 py-1 text-xs font-bold rounded-md transition-all cursor-pointer ${a==="quiz"?"bg-indigo-600 text-white shadow":"text-gray-500 hover:text-gray-800 hover:bg-gray-100"}`,children:s==="zh"?"测验":"Quiz"}),e.jsx("button",{type:"button",onClick:()=>y(c=>({...c,[t.id]:"assignment"})),className:`px-2.5 py-1 text-xs font-bold rounded-md transition-all cursor-pointer ${a==="assignment"?"bg-emerald-600 text-white shadow":"text-gray-500 hover:text-gray-800 hover:bg-gray-100"}`,children:s==="zh"?"作业":"Assignment"})]})]},t.id)}),(!i[r]?.assignments||i[r].assignments.length===0)&&e.jsx("div",{className:"p-8 text-center text-xs text-gray-400 italic",children:s==="zh"?"此班级暂未创建任何考核项目":"No graded items exist in this class."})]})]}),n&&n.rows.length>0&&e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center justify-between font-sans",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx($,{size:16,className:"text-emerald-500"}),s==="zh"?"CSV 实时成绩表预览 (前5行数据)":"Live CSV Grade Preview (First 5 Rows)"]}),e.jsx("span",{className:"text-xs bg-emerald-50 text-emerald-700 border border-emerald-100 font-bold px-2 py-0.5 rounded shadow-xs font-sans",children:s==="zh"?`展示 5 / ${n.totalStudents} 名学生`:`Showing 5 of ${n.totalStudents} students`})]}),e.jsx("div",{className:"border border-gray-150 rounded-xl overflow-hidden bg-white shadow-xs max-w-full",children:e.jsx("div",{className:"overflow-x-auto max-h-56 overflow-y-auto",children:e.jsxs("table",{className:"w-full border-collapse text-left",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-gray-50 border-b border-gray-150 sticky top-0 z-10",children:n.headers.map((t,d)=>{const l=t.includes("Average")||t.includes("Avg")||t.includes("Score"),o=t.includes("Weighted");return e.jsx("th",{className:`p-2.5 text-xs font-bold tracking-wider uppercase border-r border-gray-150 whitespace-nowrap font-sans font-semibold ${o?"text-indigo-700 bg-indigo-50/70 border-indigo-150 font-bold":l?"text-emerald-700 bg-emerald-50/70":"text-gray-500"}`,children:t},d)})})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:n.rows.map((t,d)=>e.jsx("tr",{className:"hover:bg-gray-50/50 transition-colors font-mono text-xs",children:t.map((l,o)=>{const a=n.headers[o]||"",c=a.includes("Weighted"),w=a.includes("Average")||a.includes("Avg")||a.includes("Score");return e.jsx("td",{className:`p-2 border-r border-gray-100 font-mono text-xs text-gray-700 whitespace-nowrap text-center ${c?"bg-indigo-50/30 font-bold text-indigo-700 border-indigo-100":w?"bg-emerald-50/10 font-semibold text-emerald-800":o<2?"text-left font-sans font-medium":""}`,children:l},o)})},d))})]})})}),e.jsx("p",{className:"text-xs text-gray-400 font-sans italic",children:s==="zh"?"* 改变上方权重占比或调整项目分类时,此预览与计算结果会立即实时刷新。":"* Calculations and layout values in this preview refresh dynamically as you tweak sliders and overrides."})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 bg-gray-50/85 flex justify-end gap-2.5 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>x(!1),className:"px-4 py-2 text-xs font-semibold border border-gray-300 text-gray-700 bg-white rounded-lg hover:bg-gray-100 transition-colors cursor-pointer",children:s==="zh"?"取消":"Cancel"}),e.jsxs("button",{type:"button",disabled:!i[r]?.assignments||i[r].assignments.length===0,onClick:()=>{v(r,N,g,m,u),x(!1)},className:"px-4 py-2 text-xs font-bold bg-indigo-600 text-white border border-indigo-700 rounded-lg hover:bg-indigo-700 hover:shadow shadow-sm transition-all flex items-center gap-1.5 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(q,{size:14}),s==="zh"?"导出 CSV 成绩表":"Export Grade Sheet"]})]})]})}):null}export{F as ExportWeightModal};
@@ -0,0 +1 @@
1
+ import{r,j as e}from"./vendor-react-B0t7H3hh.js";import{f as b,X as R,W,aw as T,N as B}from"./vendor-icons-BRmhY6fg.js";import"./vendor-utils-m0Urvtws.js";function A({isOpen:x,onClose:l,lang:s,onSeedSuccess:z,onJumpTab:N}){const[n,h]=r.useState(0),[v,w]=r.useState(!1),[F,y]=r.useState(null),[I,S]=r.useState(null),[k,p]=r.useState({display:"none"}),[C,m]=r.useState({display:"none"}),L=r.useRef(null),d=[{targetId:"",title:s==="zh"?"欢迎来到 OpenLearn Next V2 平台!":"Welcome to OpenLearn Next V2!",content:s==="zh"?"本平台为数字课堂提供智能白板与教学插件生态托管。下面我们将通过 4 步带您快速完成初始化并体验一堂数字互动课程。":"Welcome! This platform provides interactive whiteboards and educational plugin hosting. Let's set up your first class in 4 quick steps."},{targetId:"nav_btn_admin_directory",title:s==="zh"?"第 1 步:一键初始化示例课程":"Step 1: Initialize Example Class",content:s==="zh"?"在开始授课前,我们需要一个授课班级。请点击下方的按钮,系统将自动在数据库中为您建立示例班级、添加 5 名演示学生(小明、小红等),并自动排定一节今日的白板创意编程示范课!":"Before teaching, we need a classroom session. Click the button below to seed a demo class, add 5 sample students (Xiao Ming, Xiao Hong, etc.), and schedule today's creative programming class!",actionable:!0},{targetId:"navigation_sidebar",title:s==="zh"?"第 2 步:了解系统导航菜单":"Step 2: Tour System Navigation",content:s==="zh"?"初始化成功后,您可以在「系统导航」的「班级管理」中查看学生名册及座位表,或在「课程管理」中编辑白板教案。在「插件中心」中,您还可以安装/停用丰富的第三方小工具。":'After setup, explore the sidebar! Use "Classes & Students" to manage student profiles, "Courses" to edit whiteboards, and "Plugins" to manage tools.'},{targetId:"nav_btn_live_class",title:s==="zh"?"第 3 步:进入互动课堂开启体验":"Step 3: Launch Live Classroom",content:s==="zh"?"一切就绪!点击下方的「一键开课并进入课堂」,系统将为您自动进入示范课堂并展开互动白板。您可以在白板上下发测验、进行实时统计,学生端也将实时接收广播。":'All set! Click "Launch Classroom" to enter the live room. You can draw on the whiteboard, push quizzes, and view live stats, while student clients auto-sync.'}],E=async()=>{w(!0);try{const i=await fetch("/api/admin/seed-demo",{method:"POST"});if(i.ok){const t=await i.json();t.success&&(S({classId:t.classId,className:"人工智能与创意编程示范班"}),z({classId:t.classId,scheduleId:t.scheduleId,lessonId:t.lessonId}),setTimeout(()=>{h(2)},1500))}else{const t=await i.json().catch(()=>({error:"未知错误"}));y(s==="zh"?`初始化失败:${t.error||"请检查服务器日志"}`:`Failed: ${t.error||"Check server logs"}`)}}catch(i){console.error("Failed to seed demo data:",i),y(s==="zh"?`网络错误:${i.message||"请检查服务器是否运行"}`:`Network error: ${i.message||"Check if server is running"}`)}finally{w(!1)}},_=()=>{localStorage.setItem("edu_os_tour_completed","true"),N("live_class"),l()};if(r.useEffect(()=>{if(!x)return;const i=d[n];if(!i||!i.targetId){p({display:"none"}),m({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e4,width:"420px",maxWidth:"90vw"});return}const t=()=>{const j=document.getElementById(i.targetId);if(!j){p({display:"none"}),m({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e4,width:"420px",maxWidth:"90vw"});return}const o=j.getBoundingClientRect(),c=6;p({display:"block",position:"fixed",top:`${o.top-c}px`,left:`${o.left-c}px`,width:`${o.width+c*2}px`,height:`${o.height+c*2}px`,boxShadow:"0 0 0 9999px rgba(15, 23, 42, 0.65)",border:"2px dashed #6366f1",borderRadius:"12px",zIndex:9999,pointerEvents:"none",transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"});const u=360;let f=o.left+o.width+16,g=o.top;f+u>window.innerWidth&&(f=Math.max(16,o.left-u-16)),g+240>window.innerHeight&&(g=Math.max(16,window.innerHeight-250)),m({display:"block",position:"fixed",top:`${g}px`,left:`${f}px`,width:`${u}px`,zIndex:1e4,transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"})};t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0);const $=setInterval(t,300);return()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0),clearInterval($)}},[x,n]),!x)return null;const a=d[n];return e.jsxs("div",{className:"fixed inset-0 overflow-hidden select-none",style:{zIndex:9998},children:[a&&!a.targetId&&e.jsx("div",{className:"fixed inset-0 bg-slate-900/65 backdrop-blur-2xs transition-opacity",onClick:l}),e.jsx("div",{style:k}),e.jsxs("div",{ref:L,style:C,className:"bg-white rounded-2xl border border-slate-150/60 shadow-2xl p-5 md:p-6 text-gray-900 font-sans flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsxs("h3",{className:"font-extrabold text-sm md:text-base text-gray-900 flex items-center gap-1.5 leading-tight",children:[e.jsx(b,{size:16,className:"text-indigo-500 animate-pulse shrink-0"}),a.title]}),e.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 rounded-lg p-0.5 transition-colors cursor-pointer",children:e.jsx(R,{size:16})})]}),e.jsx("p",{className:"text-xs md:text-sm text-gray-600 leading-relaxed font-medium mb-5 whitespace-pre-wrap",children:a.content}),a.actionable&&e.jsx("div",{className:"bg-slate-50 border border-slate-200/80 rounded-xl p-3.5 mb-5 flex flex-col items-center justify-center",children:I?e.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 text-xs font-bold animate-bounce",children:[e.jsx(W,{size:12,className:"fill-emerald-600"}),s==="zh"?"示范课程与学生名册初始化成功!":"Demo classes successfully initialized!"]}):e.jsx("button",{onClick:E,disabled:v,className:"w-full flex items-center justify-center gap-1.5 py-2.5 px-4 bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs md:text-sm rounded-lg hover:shadow-md transition-all cursor-pointer disabled:bg-indigo-400",children:v?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),s==="zh"?"正在创建数据库记录...":"Initializing DB records..."]}):e.jsxs(e.Fragment,{children:[e.jsx(b,{size:14,className:"animate-pulse"}),s==="zh"?"一键初始化示范数据":"Initialize Example Data"]})})})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-slate-100 pt-4 shrink-0",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:d.map((i,t)=>e.jsx("div",{className:`h-1.5 rounded-full transition-all duration-300 ${t===n?"w-4 bg-indigo-600":"w-1.5 bg-slate-200"}`},t))}),e.jsxs("div",{className:"flex items-center gap-2",children:[n>0?e.jsxs("button",{onClick:()=>h(i=>i-1),className:"flex items-center gap-1 px-3 py-1.5 border border-slate-200 rounded-lg text-xs font-semibold text-slate-600 hover:bg-slate-50 transition-colors cursor-pointer",children:[e.jsx(T,{size:12}),s==="zh"?"上一步":"Back"]}):e.jsx("button",{onClick:l,className:"px-3 py-1.5 border border-slate-200 rounded-lg text-xs font-semibold text-slate-500 hover:bg-slate-50 transition-colors cursor-pointer",children:s==="zh"?"跳过向导":"Skip Tour"}),n<d.length-1?e.jsxs("button",{onClick:()=>h(i=>i+1),className:"flex items-center gap-1 px-3 py-1.5 bg-slate-900 text-white rounded-lg text-xs font-semibold hover:bg-slate-800 transition-colors cursor-pointer",children:[s==="zh"?"下一步":"Next",e.jsx(B,{size:12})]}):e.jsxs("button",{onClick:_,className:"flex items-center gap-1 px-4 py-1.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-xs font-bold shadow-sm transition-colors cursor-pointer",children:[s==="zh"?"结束引导并开课":"Launch Classroom",e.jsx(b,{size:12})]})]})]})]})]})}export{A as HelpTour};