github-actions[bot] commited on
Commit
2f06545
Β·
1 Parent(s): 09e9311

πŸš€ Auto-deploy frontend from GitHub (fa7b72a)

Browse files
This view is limited to 50 files because it contains too many changes. Β  See raw diff
Files changed (50) hide show
  1. assets/{AIChatPage-Ks78ql27.js β†’ AIChatPage-CI1qQgCG.js} +2 -2
  2. assets/{AdminDashboard-BCV7cX28.js β†’ AdminDashboard-B2eiYi-q.js} +1 -1
  3. assets/{AssessmentPage-CluT59xB.js β†’ AssessmentPage-YsCyxvJJ.js} +1 -1
  4. assets/{AvatarShop-Cc7V2NMs.js β†’ AvatarShop-BeFk31yM.js} +1 -1
  5. assets/{ChatMarkdown-B5QlckxZ.js β†’ ChatMarkdown-fgwaycBR.js} +1 -1
  6. assets/{CompetencyRadarChart-Br1qCKfl.js β†’ CompetencyRadarChart-CBuH8ru8.js} +1 -1
  7. assets/{ConfirmModal-B7469iTj.js β†’ ConfirmModal-6cgkqXAT.js} +1 -1
  8. assets/{FloatingAITutor-C_4EP63I.js β†’ FloatingAITutor-BIdguqCV.js} +2 -2
  9. assets/{GradesPage-CmSMzBLK.js β†’ GradesPage-Y0HsmLPP.js} +1 -1
  10. assets/{HeroBanner-LXU_ph73.js β†’ HeroBanner-CKiXGluA.js} +1 -1
  11. assets/{InitialAssessmentModal-8dYkJoWr.js β†’ InitialAssessmentModal-CknVaqMx.js} +1 -1
  12. assets/{LeaderboardPage-D1oaPEZD.js β†’ LeaderboardPage-D9eaC9ey.js} +1 -1
  13. assets/{LearningPath-D68qmUJi.js β†’ LearningPath-BBE0vZ0S.js} +1 -1
  14. assets/{LoginPage-Bo_tg2xo.js β†’ LoginPage-DLaoyzV8.js} +1 -1
  15. assets/{LogoutActionButton-Cb7v3MhK.js β†’ LogoutActionButton-lUNItet6.js} +1 -1
  16. assets/{ModuleFolderCard-CITAgDA0.js β†’ ModuleFolderCard-DKBrO5a8.js} +1 -1
  17. assets/{ModulesPage-yaDxw1Cj.js β†’ ModulesPage-cZJm_yoJ.js} +1 -1
  18. assets/{ProfileModal-BYEUqArA.js β†’ ProfileModal-Gwxh5tYO.js} +1 -1
  19. assets/{ProfilePictureUploader-viKg_Exm.js β†’ ProfilePictureUploader-CX_IZAwE.js} +1 -1
  20. assets/{QuizBattlePage-Bsec_0MM.js β†’ QuizBattlePage-Bwu0snEF.js} +1 -1
  21. assets/{RewardsModal-DTzrRjNP.js β†’ RewardsModal-CPyFRkMy.js} +1 -1
  22. assets/{RightSidebar-BDjjmpc8.js β†’ RightSidebar-CmYzVUKQ.js} +1 -1
  23. assets/{ScientificCalculator-CLmkIayw.js β†’ ScientificCalculator-DRuSfTXj.js} +1 -1
  24. assets/SettingsModal-BVXFPk7A.js +0 -11
  25. assets/SettingsModal-BbkSqdYG.js +16 -0
  26. assets/{Sidebar-C2ctPQQf.js β†’ Sidebar-2LZAqf7E.js} +1 -1
  27. assets/{SupplementalBanner-bYee7ru9.js β†’ SupplementalBanner-DFkcXPOZ.js} +1 -1
  28. assets/{SupplementalPillCarousel-Bvno07XP.js β†’ SupplementalPillCarousel-BqNTelmK.js} +1 -1
  29. assets/{TeacherDashboard-CzDqNb42.js β†’ TeacherDashboard-CZdYfdg9.js} +0 -0
  30. assets/{XPNotification-DZv3ypM9.js β†’ XPNotification-DRsFdUWw.js} +1 -1
  31. assets/{automationService-BxQhaGqB.js β†’ automationService-7m3RFJA3.js} +1 -1
  32. assets/{bell-DsHB20Hc.js β†’ bell-clcSMJn6.js} +1 -1
  33. assets/{button-De2q2xHf.js β†’ button-DCfeFHoH.js} +1 -1
  34. assets/{card-DXoGKpl1.js β†’ card-D4dmQVNb.js} +1 -1
  35. assets/{chart-column-CmH46HAG.js β†’ chart-column-B3jJOD5i.js} +1 -1
  36. assets/{chatService-D-gdHYgQ.js β†’ chatService-DwVkLoat.js} +1 -1
  37. assets/{check-DSwzaW4Y.js β†’ check-BLSo9L0H.js} +1 -1
  38. assets/{check-check-CS5aviKH.js β†’ check-check-B_HghS1Z.js} +1 -1
  39. assets/{chevron-left-CZaM7nZW.js β†’ chevron-left-BWpgclqc.js} +1 -1
  40. assets/{chevron-right-CoVWpXdD.js β†’ chevron-right-COqGruhh.js} +1 -1
  41. assets/{chevron-up-Byo9SJJ4.js β†’ chevron-up-Cdvz2TMJ.js} +1 -1
  42. assets/{circle-alert-DgDGv7k5.js β†’ circle-alert-CP9K3300.js} +1 -1
  43. assets/{circle-check-CVJuYLp6.js β†’ circle-check-C0FPGTrp.js} +1 -1
  44. assets/{circle-check-big-CNGbqkWz.js β†’ circle-check-big-m1SvzGFL.js} +1 -1
  45. assets/{circle-help-hn0lWYq9.js β†’ circle-help-B8apTIdU.js} +1 -1
  46. assets/{clipboard-check-BEObtDZM.js β†’ clipboard-check-DqBu2Pqb.js} +1 -1
  47. assets/{clock-BodmJJnp.js β†’ clock-D1Ecvltm.js} +1 -1
  48. assets/{diagnosticService-BIetid_s.js β†’ diagnosticService-BDYTUoqk.js} +2 -2
  49. assets/{dialog-CCp2tnRr.js β†’ dialog-CHtYkwVl.js} +1 -1
  50. assets/{download-C-V0pYsk.js β†’ download-DX_YebqQ.js} +1 -1
assets/{AIChatPage-Ks78ql27.js β†’ AIChatPage-CI1qQgCG.js} RENAMED
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cb8VeSuW.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CH1lNiRF.js","assets/vendor-firebase-core-CO26nNq6.js","assets/vendor-firebase-auth-BLpRW_zO.js","assets/vendor-firebase-storage-B3igpVVS.js","assets/vendor-firebase-analytics-CTiUNb0-.js","assets/vendor-radix-BorKzPz9.js","assets/vendor-charts-D8hf8tI0.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-Aaqs1LGb.css"])))=>i.map(i=>d[i]);
2
- import{ay as D,u as F,_ as $,j as S,m as C,D as z}from"./index-Cb8VeSuW.js";import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{B as O}from"./button-De2q2xHf.js";import{I}from"./input-w3MoyecB.js";import H from"./ChatMarkdown-B5QlckxZ.js";import{P as Y}from"./plus-uFWGSQCY.js";import{S as G}from"./search-CMbwAzt9.js";import{T as Q}from"./trash-2-DB-oXtbr.js";import{S as V}from"./send-CMJOaNp6.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";function W(r){return r?r instanceof Date?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof r=="object"&&"toDate"in r?r.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(r):""}const xe=()=>{const{sessions:r,activeSessionId:o,isLoading:l,loadingSessionId:A,setActiveSessionId:d,createNewSession:b,sendMessage:L,deleteSession:T,getActiveSession:_}=D(),{userProfile:c}=F(),[x,P]=a.useState(""),[n,g]=a.useState(""),[y,j]=a.useState(!1),m=a.useRef(null),h=a.useRef(!0),u=a.useRef(!1),i=_(),f=i?.messages||[],M=f.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),v=l&&o===A&&!M,w=(t="auto")=>{const s=m.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},E=()=>{const t=m.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},R=()=>{h.current=E()};a.useEffect(()=>{$(async()=>{const{warmupBackend:t}=await import("./index-Cb8VeSuW.js").then(s=>s.aV);return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),a.useEffect(()=>{if(!h.current)return;const t=window.requestAnimationFrame(()=>w("auto"));return()=>window.cancelAnimationFrame(t)},[f,v]),a.useEffect(()=>{h.current=!0,w("auto")},[o]);const N=async()=>{if(!(!n.trim()||l||y||u.current)){u.current=!0,j(!0);try{let t=o;t||(t=b(),d(t));const s=n.trim();g(""),await L(t,s)}finally{u.current=!1,j(!1)}}},k=()=>{const t=b();d(t)},B=(t,s)=>{s.stopPropagation(),T(t)},p=r.filter(t=>t.title.toLowerCase().includes(x.toLowerCase())||t.preview.toLowerCase().includes(x.toLowerCase()));return e.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex gap-4 px-4 sm:px-6 xl:px-10 py-6",children:[e.jsxs("div",{className:"w-80 min-h-0 flex flex-col bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-2xl flex items-center justify-center",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-10 h-10 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold font-display text-[#0a1628]",children:"L.O.L.I."}),e.jsx("p",{className:"text-[10px] text-[#5a6578]",children:"Your AI Math Tutor"})]})]}),e.jsxs("button",{onClick:k,className:"w-full bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-4 py-3 rounded-xl text-sm font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-2",children:[e.jsx(Y,{size:18}),"New Chat"]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(G,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(I,{type:"text",placeholder:"Search conversations...",value:x,onChange:t=>P(t.target.value),className:"w-full pl-9 pr-3 py-2 text-xs rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:e.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[p.length," Conversations"]})}),e.jsx(S,{children:p.map(t=>e.jsxs(C.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>d(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${o===t.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${o===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>B(t.id,s),className:"absolute top-2 right-2 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-red-100 text-slate-500 hover:text-red-600 transition-all",children:e.jsx(Q,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:t.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:t.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${o===t.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[t.messageCount," msgs"]})]})]},t.id))}),p.length===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-16 h-16 object-contain mx-auto mb-2 opacity-60 drop-shadow-sm grayscale contrast-50"}),e.jsx("p",{className:"text-sm text-slate-500",children:"No conversations found"}),e.jsx("p",{className:"text-xs text-slate-500/60 mt-1",children:"Start a new chat!"})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] overflow-hidden",children:o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold font-display text-[#0a1628]",children:i?.title}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:i?.date})]}),e.jsx("div",{className:"flex items-center gap-2",children:i?.topics.map((t,s)=>e.jsx("span",{className:"px-3 py-1 bg-sky-50 text-sky-600 text-xs font-bold rounded-lg",children:t},s))})]}),e.jsxs("div",{ref:m,onScroll:R,className:"flex-1 overflow-y-auto overscroll-contain p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(S,{children:f.map(t=>e.jsxs(C.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex items-end gap-2 ${t.sender==="user"?"justify-end":"justify-start"}`,children:[t.sender!=="user"&&e.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-r from-sky-600 to-sky-500 flex items-center justify-center flex-shrink-0 mb-1",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI",className:"w-5 h-5 object-contain"})}),e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${t.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.text}):e.jsx(H,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:W(t.timestamp)})]}),t.sender==="user"&&e.jsx(z,{src:c?.photo,name:c?.name,gender:c?.gender,className:"w-7 h-7 flex-shrink-0 mb-1",fallbackClassName:"text-[10px]"})]},t.id))}),v&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-md border border-[#dde3eb] rounded-2xl px-5 py-3 max-w-[70%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})})]}),e.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(I,{type:"text",value:n,onChange:t=>g(t.target.value),onKeyPress:t=>t.key==="Enter"&&N(),placeholder:"Ask me anything about math...",className:"flex-1 px-5 py-3 rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100 text-sm"}),e.jsx(O,{onClick:N,disabled:!n.trim()||l||y,className:"px-6 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg",children:e.jsx(V,{size:18})})]})})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8 text-center",children:[e.jsx("div",{className:"w-24 h-24 bg-gradient-to-r from-sky-100 to-cyan-100 rounded-3xl flex items-center justify-center mb-6",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-20 h-20 object-contain drop-shadow-lg"})}),e.jsx("h2",{className:"text-2xl font-bold font-display text-[#0a1628] mb-1",children:"Welcome to L.O.L.I."}),e.jsx("p",{className:"text-sky-600 text-sm font-bold tracking-wide uppercase mb-4",children:"Logical Operations & Learning Intelligence"}),e.jsx("p",{className:"text-[#5a6578] mb-6 max-w-md",children:"Your personal AI math tutor is here to help! Start a new conversation or select one from the sidebar."}),e.jsx("button",{onClick:k,className:"px-6 py-3 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl font-bold shadow-lg hover:shadow-xl transition-all",children:"Start Your First Chat"}),e.jsx("div",{className:"mt-8 grid grid-cols-3 gap-4 max-w-2xl",children:["Algebra","Geometry","Calculus"].map(t=>e.jsxs("div",{className:"p-4 bg-[#edf1f7] rounded-xl border border-[#dde3eb]",children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628]",children:t}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:["Get help with ",t.toLowerCase()]})]},t))})]})})]})};export{xe as default};
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BaOs5Ayg.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CH1lNiRF.js","assets/vendor-firebase-core-CO26nNq6.js","assets/vendor-firebase-auth-BLpRW_zO.js","assets/vendor-firebase-storage-B3igpVVS.js","assets/vendor-firebase-analytics-CTiUNb0-.js","assets/vendor-radix-BorKzPz9.js","assets/vendor-charts-D8hf8tI0.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-DdX2rVyy.css"])))=>i.map(i=>d[i]);
2
+ import{ay as D,u as F,_ as $,j as S,m as C,D as z}from"./index-BaOs5Ayg.js";import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{B as O}from"./button-DCfeFHoH.js";import{I}from"./input-D28h_UTJ.js";import H from"./ChatMarkdown-fgwaycBR.js";import{P as Y}from"./plus-DkG35AoH.js";import{S as G}from"./search-Bq99THgc.js";import{T as Q}from"./trash-2-HTnKafZd.js";import{S as W}from"./send-CwwDU3uJ.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";function q(r){return r?r instanceof Date?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof r=="object"&&"toDate"in r?r.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(r):""}const xe=()=>{const{sessions:r,activeSessionId:o,isLoading:l,loadingSessionId:A,setActiveSessionId:d,createNewSession:b,sendMessage:L,deleteSession:T,getActiveSession:_}=D(),{userProfile:c}=F(),[x,P]=a.useState(""),[n,g]=a.useState(""),[y,j]=a.useState(!1),m=a.useRef(null),h=a.useRef(!0),u=a.useRef(!1),i=_(),f=i?.messages||[],M=f.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),v=l&&o===A&&!M,w=(t="auto")=>{const s=m.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},E=()=>{const t=m.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},R=()=>{h.current=E()};a.useEffect(()=>{$(async()=>{const{warmupBackend:t}=await import("./index-BaOs5Ayg.js").then(s=>s.b2);return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),a.useEffect(()=>{if(!h.current)return;const t=window.requestAnimationFrame(()=>w("auto"));return()=>window.cancelAnimationFrame(t)},[f,v]),a.useEffect(()=>{h.current=!0,w("auto")},[o]);const N=async()=>{if(!(!n.trim()||l||y||u.current)){u.current=!0,j(!0);try{let t=o;t||(t=b(),d(t));const s=n.trim();g(""),await L(t,s)}finally{u.current=!1,j(!1)}}},k=()=>{const t=b();d(t)},B=(t,s)=>{s.stopPropagation(),T(t)},p=r.filter(t=>t.title.toLowerCase().includes(x.toLowerCase())||t.preview.toLowerCase().includes(x.toLowerCase()));return e.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex gap-4 px-4 sm:px-6 xl:px-10 py-6",children:[e.jsxs("div",{className:"w-80 min-h-0 flex flex-col bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-2xl flex items-center justify-center",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-10 h-10 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold font-display text-[#0a1628]",children:"L.O.L.I."}),e.jsx("p",{className:"text-[10px] text-[#5a6578]",children:"Your AI Math Tutor"})]})]}),e.jsxs("button",{onClick:k,className:"w-full bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-4 py-3 rounded-xl text-sm font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-2",children:[e.jsx(Y,{size:18}),"New Chat"]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(G,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(I,{type:"text",placeholder:"Search conversations...",value:x,onChange:t=>P(t.target.value),className:"w-full pl-9 pr-3 py-2 text-xs rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:e.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[p.length," Conversations"]})}),e.jsx(S,{children:p.map(t=>e.jsxs(C.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>d(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${o===t.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${o===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>B(t.id,s),className:"absolute top-2 right-2 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-red-100 text-slate-500 hover:text-red-600 transition-all",children:e.jsx(Q,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:t.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:t.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${o===t.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[t.messageCount," msgs"]})]})]},t.id))}),p.length===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-16 h-16 object-contain mx-auto mb-2 opacity-60 drop-shadow-sm grayscale contrast-50"}),e.jsx("p",{className:"text-sm text-slate-500",children:"No conversations found"}),e.jsx("p",{className:"text-xs text-slate-500/60 mt-1",children:"Start a new chat!"})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-[#f7f9fc] rounded-3xl border border-[#dde3eb] overflow-hidden",children:o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold font-display text-[#0a1628]",children:i?.title}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:i?.date})]}),e.jsx("div",{className:"flex items-center gap-2",children:i?.topics.map((t,s)=>e.jsx("span",{className:"px-3 py-1 bg-sky-50 text-sky-600 text-xs font-bold rounded-lg",children:t},s))})]}),e.jsxs("div",{ref:m,onScroll:R,className:"flex-1 overflow-y-auto overscroll-contain p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(S,{children:f.map(t=>e.jsxs(C.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex items-end gap-2 ${t.sender==="user"?"justify-end":"justify-start"}`,children:[t.sender!=="user"&&e.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-r from-sky-600 to-sky-500 flex items-center justify-center flex-shrink-0 mb-1",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI",className:"w-5 h-5 object-contain"})}),e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${t.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.text}):e.jsx(H,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:q(t.timestamp)})]}),t.sender==="user"&&e.jsx(z,{src:c?.photo,name:c?.name,gender:c?.gender,className:"w-7 h-7 flex-shrink-0 mb-1",fallbackClassName:"text-[10px]"})]},t.id))}),v&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-md border border-[#dde3eb] rounded-2xl px-5 py-3 max-w-[70%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})})]}),e.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(I,{type:"text",value:n,onChange:t=>g(t.target.value),onKeyPress:t=>t.key==="Enter"&&N(),placeholder:"Ask me anything about math...",className:"flex-1 px-5 py-3 rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100 text-sm"}),e.jsx(O,{onClick:N,disabled:!n.trim()||l||y,className:"px-6 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg",children:e.jsx(W,{size:18})})]})})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-8 text-center",children:[e.jsx("div",{className:"w-24 h-24 bg-gradient-to-r from-sky-100 to-cyan-100 rounded-3xl flex items-center justify-center mb-6",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-20 h-20 object-contain drop-shadow-lg"})}),e.jsx("h2",{className:"text-2xl font-bold font-display text-[#0a1628] mb-1",children:"Welcome to L.O.L.I."}),e.jsx("p",{className:"text-sky-600 text-sm font-bold tracking-wide uppercase mb-4",children:"Logical Operations & Learning Intelligence"}),e.jsx("p",{className:"text-[#5a6578] mb-6 max-w-md",children:"Your personal AI math tutor is here to help! Start a new conversation or select one from the sidebar."}),e.jsx("button",{onClick:k,className:"px-6 py-3 bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white rounded-xl font-bold shadow-lg hover:shadow-xl transition-all",children:"Start Your First Chat"}),e.jsx("div",{className:"mt-8 grid grid-cols-3 gap-4 max-w-2xl",children:["Algebra","Geometry","Calculus"].map(t=>e.jsxs("div",{className:"p-4 bg-[#edf1f7] rounded-xl border border-[#dde3eb]",children:[e.jsx("p",{className:"text-sm font-bold text-[#0a1628]",children:t}),e.jsxs("p",{className:"text-xs text-[#5a6578] mt-1",children:["Get help with ",t.toLowerCase()]})]},t))})]})})]})};export{xe as default};
assets/{AdminDashboard-BCV7cX28.js β†’ AdminDashboard-B2eiYi-q.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as i,d as Jt,j as e}from"./vendor-react-B4AQeu28.js";import Fs from"./Sidebar-C2ctPQQf.js";import vs from"./ConfirmModal-B7469iTj.js";import{e as ce,h as ye,t as z,l as _,R as Ie,p as me,f as X,F as Zt,H as Yt,I as ea,k as ct,u as Re,m as U,z as Ns,L as ot,S as Ke,Z as mt,i as sa,J as Bs,K as qs,N as Os,U as Je,G as ks,y as xt,A as Ze,O as ut,B as ta,a as je,T as ht,o as aa,M as ra,D as ia}from"./index-Cb8VeSuW.js";import{B as M}from"./button-De2q2xHf.js";import{S as re,a as ie,b as le,c as ne,d as P}from"./select-CqJdJ0KN.js";import{I as R}from"./input-w3MoyecB.js";import{S as Xe}from"./subjects-Bnu0lJdU.js";import{U as fs}from"./upload-D5cppfxb.js";import{F as Ye,I as we,D as qe,T as la,a as na,b as Gs,c as De,d as da,e as Te,f as ca}from"./table-CQN68i0p.js";import{C as Hs,L as oa}from"./lightbulb-BjBRtEjU.js";import{C as es}from"./chart-column-CmH46HAG.js";import{C as ss}from"./circle-check-big-CNGbqkWz.js";import{D as gt,a as pt,b as ft,c as bt,d as jt,e as ma}from"./dialog-CCp2tnRr.js";import{getDocs as de,collection as se,query as ts,orderBy as vt,limit as ys,where as ws,addDoc as xa,serverTimestamp as Nt,doc as Cs,getDoc as yt,setDoc as ua,onSnapshot as ha}from"./vendor-firebase-firestore-CH1lNiRF.js";import{C as Se}from"./circle-alert-DgDGv7k5.js";import{S as wt}from"./search-CMbwAzt9.js";import{E as as,a as _s}from"./eye-DBkZRvYD.js";import{S as be}from"./switch-KjWJg4zs.js";import{S as St,M as ga}from"./LogoutActionButton-Cb7v3MhK.js";import{B as pa}from"./bell-DsHB20Hc.js";import{C as fa,b as ba}from"./vendor-radix-BorKzPz9.js";import{C as ja}from"./check-DSwzaW4Y.js";import{P as va}from"./plus-uFWGSQCY.js";import{C as Na}from"./check-check-CS5aviKH.js";import{M as ya}from"./mail-D1Sfp9RA.js";import{D as kt}from"./download-C-V0pYsk.js";import{T as Qs}from"./trash-2-DB-oXtbr.js";import{C as Ct}from"./clock-BodmJJnp.js";import{F as wa}from"./funnel-D-s_ygM_.js";import{S as Z}from"./skeleton-Bue6-H9w.js";import{u as Sa,t as ka,a as Ca}from"./useSubjectAvailability-d2Fw9DS6.js";import{S as Aa}from"./save-CpWDoSfX.js";import{u as za}from"./useQuery-PwtHq3dz.js";import{a as Pa}from"./chevron-up-Byo9SJJ4.js";import{M as Da}from"./minus-CMQilTBg.js";import"./tooltip-BY91VKdD.js";import"./x-CTLBAl-n.js";import"./chevron-right-CoVWpXdD.js";import"./chevron-left-CZaM7nZW.js";import"./shirt-CrJtkYx3.js";import"./log-out-CM6AS10M.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{r as i,d as Jt,j as e}from"./vendor-react-B4AQeu28.js";import Fs from"./Sidebar-2LZAqf7E.js";import vs from"./ConfirmModal-6cgkqXAT.js";import{e as ce,h as ye,t as z,l as _,R as Ie,p as me,f as X,F as Zt,H as Yt,I as ea,k as ct,u as Re,m as U,z as Ns,L as ot,S as Ke,Z as mt,i as sa,J as Bs,K as qs,N as Os,U as Je,G as ks,y as xt,A as Ze,O as ut,B as ta,a as je,T as ht,o as aa,M as ra,D as ia}from"./index-BaOs5Ayg.js";import{B as M}from"./button-DCfeFHoH.js";import{S as re,a as ie,b as le,c as ne,d as P}from"./select-DIjxRWza.js";import{I as R}from"./input-D28h_UTJ.js";import{S as Xe}from"./subjects-BFghB0SQ.js";import{U as fs}from"./upload-DayXhGwD.js";import{F as Ye,I as we,D as qe,T as la,a as na,b as Gs,c as De,d as da,e as Te,f as ca}from"./table-xeOJ8ZAA.js";import{C as Hs,L as oa}from"./lightbulb-Ce2KQzGM.js";import{C as es}from"./chart-column-B3jJOD5i.js";import{C as ss}from"./circle-check-big-m1SvzGFL.js";import{D as gt,a as pt,b as ft,c as bt,d as jt,e as ma}from"./dialog-CHtYkwVl.js";import{getDocs as de,collection as se,query as ts,orderBy as vt,limit as ys,where as ws,addDoc as xa,serverTimestamp as Nt,doc as Cs,getDoc as yt,setDoc as ua,onSnapshot as ha}from"./vendor-firebase-firestore-CH1lNiRF.js";import{C as Se}from"./circle-alert-CP9K3300.js";import{S as wt}from"./search-Bq99THgc.js";import{E as as,a as _s}from"./eye-Ig3S6mOs.js";import{S as be}from"./switch-CblAJO7o.js";import{S as St,M as ga}from"./LogoutActionButton-lUNItet6.js";import{B as pa}from"./bell-clcSMJn6.js";import{C as fa,b as ba}from"./vendor-radix-BorKzPz9.js";import{C as ja}from"./check-BLSo9L0H.js";import{P as va}from"./plus-DkG35AoH.js";import{C as Na}from"./check-check-B_HghS1Z.js";import{M as ya}from"./mail-BbG1phxL.js";import{D as kt}from"./download-DX_YebqQ.js";import{T as Qs}from"./trash-2-HTnKafZd.js";import{C as Ct}from"./clock-D1Ecvltm.js";import{F as wa}from"./funnel-BT77sgnz.js";import{S as Z}from"./skeleton-Bo6ISWhm.js";import{u as Sa,t as ka,a as Ca}from"./useSubjectAvailability-Bvu3fXaT.js";import{S as Aa}from"./save-CQIJrhLf.js";import{u as za}from"./useQuery-BnRttv09.js";import{a as Pa}from"./chevron-up-Cdvz2TMJ.js";import{M as Da}from"./minus-DfrEv-SC.js";import"./tooltip-ChRIOid3.js";import"./x-TNvtuOD9.js";import"./chevron-right-COqGruhh.js";import"./chevron-left-BWpgclqc.js";import"./shirt-S3NBuaPm.js";import"./log-out-BenDMDly.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{AssessmentPage-CluT59xB.js β†’ AssessmentPage-YsCyxvJJ.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as n,j as e}from"./vendor-react-B4AQeu28.js";import{B as P}from"./button-De2q2xHf.js";import{s as Q}from"./diagnosticService-BIetid_s.js";import{e as Y,m as a,Z as J,j as O,T as U,x as Z,y as G}from"./index-Cb8VeSuW.js";import{M as H}from"./maximize-2-DkEKBrNU.js";import{X as W}from"./x-CTLBAl-n.js";import{C as X}from"./clock-BodmJJnp.js";import{C as K}from"./circle-check-big-CNGbqkWz.js";import{C as V}from"./chevron-right-CoVWpXdD.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{r as n,j as e}from"./vendor-react-B4AQeu28.js";import{B as P}from"./button-DCfeFHoH.js";import{s as Q}from"./diagnosticService-BDYTUoqk.js";import{e as Y,m as a,Z as J,j as O,T as U,x as Z,y as G}from"./index-BaOs5Ayg.js";import{M as H}from"./maximize-2-EHa6JURc.js";import{X as W}from"./x-TNvtuOD9.js";import{C as X}from"./clock-D1Ecvltm.js";import{C as K}from"./circle-check-big-m1SvzGFL.js";import{C as V}from"./chevron-right-COqGruhh.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{AvatarShop-Cc7V2NMs.js β†’ AvatarShop-BeFk31yM.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{f as se,L as ae,h as re,g as oe}from"./vendor-radix-BorKzPz9.js";import{e as S,u as le,L as w,W as R,m as y,j as ie,t as c,aG as ne,aH as ce}from"./index-Cb8VeSuW.js";import{u as de}from"./useFeatureAccess-RwJxbRkp.js";import{T as me,a as ue,b as xe}from"./tooltip-BY91VKdD.js";import{C as pe}from"./CompositeAvatar-Col05lJc.js";import{M as j}from"./avatarData-BuQSOXo3.js";import{S as O}from"./save-CpWDoSfX.js";import{S as V}from"./sparkles-v8V3LFaV.js";import{S as fe}from"./shirt-CrJtkYx3.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{f as se,L as ae,h as re,g as oe}from"./vendor-radix-BorKzPz9.js";import{e as S,u as le,L as w,W as R,m as y,j as ie,t as c,aG as ne,aH as ce}from"./index-BaOs5Ayg.js";import{u as de}from"./useFeatureAccess-BSpfx3vY.js";import{T as me,a as ue,b as xe}from"./tooltip-ChRIOid3.js";import{C as pe}from"./CompositeAvatar-Col05lJc.js";import{M as j}from"./avatarData-BuQSOXo3.js";import{S as O}from"./save-CQIJrhLf.js";import{S as V}from"./sparkles-By-vFjpv.js";import{S as fe}from"./shirt-S3NBuaPm.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{ChatMarkdown-B5QlckxZ.js β†’ ChatMarkdown-fgwaycBR.js} RENAMED
@@ -1,2 +1,2 @@
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-react-B4AQeu28.js","assets/vendor-markdown-CfVKi3_s.css"])))=>i.map(i=>d[i]);
2
- import{aT as d,_ as c}from"./index-Cb8VeSuW.js";import{r as m,j as r}from"./vendor-react-B4AQeu28.js";import{M as h,r as x,a as y}from"./vendor-markdown-yqZQ_iQm.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";let s=null;const p=()=>(s||(s=c(()=>import("./vendor-markdown-yqZQ_iQm.js").then(l=>l.k),__vite__mapDeps([0,1,2]))),s),M=({children:l})=>{if(m.useEffect(()=>{p()},[]),!l||typeof l!="string")return null;const t=d(l);return r.jsx("div",{className:"chat-markdown",children:r.jsx(h,{remarkPlugins:[y],rehypePlugins:[x],components:{a:({href:e,children:a})=>r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:a}),code:e=>{const{inline:a,className:o,children:n,...i}=e;return r.jsx("code",{className:`${a?"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 text-sm":"block bg-gray-100 dark:bg-gray-900 rounded p-3 overflow-x-auto my-2"} ${o||""}`,...i,children:n})},blockquote:({children:e})=>r.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-600 dark:text-gray-400 my-2",children:e}),h1:({children:e})=>r.jsx("h1",{className:"text-2xl font-bold my-2",children:e}),h2:({children:e})=>r.jsx("h2",{className:"text-xl font-bold my-2",children:e}),h3:({children:e})=>r.jsx("h3",{className:"text-lg font-bold my-2",children:e}),h4:({children:e})=>r.jsx("h4",{className:"text-base font-bold my-2",children:e}),h5:({children:e})=>r.jsx("h5",{className:"text-sm font-bold my-2",children:e}),h6:({children:e})=>r.jsx("h6",{className:"text-xs font-bold my-2",children:e}),ul:({children:e})=>r.jsx("ul",{className:"list-disc list-inside my-2",children:e}),ol:({children:e})=>r.jsx("ol",{className:"list-decimal list-inside my-2",children:e}),li:({children:e})=>r.jsx("li",{className:"ml-2",children:e}),hr:()=>r.jsx("hr",{className:"my-4 border-t border-gray-300 dark:border-gray-600"}),p:({children:e})=>r.jsx("p",{className:"my-1",children:e})},children:t})})};export{M as default};
 
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-react-B4AQeu28.js","assets/vendor-markdown-CfVKi3_s.css"])))=>i.map(i=>d[i]);
2
+ import{b0 as d,_ as c}from"./index-BaOs5Ayg.js";import{r as m,j as r}from"./vendor-react-B4AQeu28.js";import{M as h,r as x,a as y}from"./vendor-markdown-yqZQ_iQm.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";let a=null;const p=()=>(a||(a=c(()=>import("./vendor-markdown-yqZQ_iQm.js").then(l=>l.k),__vite__mapDeps([0,1,2]))),a),M=({children:l})=>{if(m.useEffect(()=>{p()},[]),!l||typeof l!="string")return null;const t=d(l);return r.jsx("div",{className:"chat-markdown",children:r.jsx(h,{remarkPlugins:[y],rehypePlugins:[x],components:{a:({href:e,children:s})=>r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:s}),code:e=>{const{inline:s,className:o,children:n,...i}=e;return r.jsx("code",{className:`${s?"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 text-sm":"block bg-gray-100 dark:bg-gray-900 rounded p-3 overflow-x-auto my-2"} ${o||""}`,...i,children:n})},blockquote:({children:e})=>r.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-600 dark:text-gray-400 my-2",children:e}),h1:({children:e})=>r.jsx("h1",{className:"text-2xl font-bold my-2",children:e}),h2:({children:e})=>r.jsx("h2",{className:"text-xl font-bold my-2",children:e}),h3:({children:e})=>r.jsx("h3",{className:"text-lg font-bold my-2",children:e}),h4:({children:e})=>r.jsx("h4",{className:"text-base font-bold my-2",children:e}),h5:({children:e})=>r.jsx("h5",{className:"text-sm font-bold my-2",children:e}),h6:({children:e})=>r.jsx("h6",{className:"text-xs font-bold my-2",children:e}),ul:({children:e})=>r.jsx("ul",{className:"list-disc list-inside my-2",children:e}),ol:({children:e})=>r.jsx("ol",{className:"list-decimal list-inside my-2",children:e}),li:({children:e})=>r.jsx("li",{className:"ml-2",children:e}),hr:()=>r.jsx("hr",{className:"my-4 border-t border-gray-300 dark:border-gray-600"}),p:({children:e})=>r.jsx("p",{className:"my-1",children:e})},children:t})})};export{M as default};
assets/{CompetencyRadarChart-Br1qCKfl.js β†’ CompetencyRadarChart-CBuH8ru8.js} RENAMED
@@ -1 +1 @@
1
- import{r as g,j as t}from"./vendor-react-B4AQeu28.js";import{f as A,a4 as I,u as B,m as L,B as O,a as W}from"./index-Cb8VeSuW.js";import{collection as E,getDocs as R,query as H,orderBy as K,limit as U,Timestamp as G,getDoc as Y,doc as $}from"./vendor-firebase-firestore-CH1lNiRF.js";import{g as J,s as V}from"./subjects-Bnu0lJdU.js";import{S as X}from"./sparkles-v8V3LFaV.js";import{R as Z,f as ee,P as te,g as se,h as ne,i as ae,T as oe}from"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-CmH46HAG.js";const P=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];async function re(a){try{const r=E(A,"users",a,"quizResults"),u=H(r,K("timestamp","desc"),U(500)),d=await R(u);return d.empty?F(a):d.docs.map(s=>{const e=s.data();return{quizId:s.id,moduleId:e.moduleId||"",subjectId:e.subjectId||"",score:typeof e.score=="number"?e.score:0,totalQuestions:e.totalQuestions||0,correctAnswers:e.correctAnswers||0,questionType:e.questionType||"multiple_choice",timestamp:e.timestamp instanceof G||e.timestamp?.toDate?e.timestamp.toDate():new Date,timeSpent:e.timeSpent||0}})}catch(r){return console.error("[competencyService] fetchQuizResults failed, falling back:",r),F(a)}}async function F(a){const r=await Y($(A,"progress",a));return r.exists()?(r.data().quizAttempts||[]).map((s,e)=>({quizId:String(s.quizId||`attempt-${e}`),moduleId:String(s.moduleId||s.quizId||""),subjectId:String(s.subjectId||""),score:typeof s.score=="number"?s.score:0,totalQuestions:s.totalQuestions||0,correctAnswers:typeof s.correctAnswers=="number"?s.correctAnswers:0,questionType:s.questionType||"multiple_choice",timestamp:s.completedAt?new Date(s.completedAt):new Date,timeSpent:s.timeSpent||0})):[]}async function ie(a){try{const r=E(A,"users",a,"moduleProgress"),u=await R(r);if(u.empty)return{};const d={};return u.forEach(s=>{const e=s.data();d[s.id]={moduleId:s.id,subjectId:e.subjectId||"",sessionsCompleted:e.sessionsCompleted||0,lastActive:e.lastActive?e.lastActive instanceof G?e.lastActive.toDate():new Date(e.lastActive):new Date,moduleTitle:e.moduleTitle||s.id,lessonsCompleted:e.lessonsCompleted||[],quizzesCompleted:e.quizzesCompleted||[]}}),d}catch(r){return console.error("[competencyService] fetchModuleProgress failed:",r),{}}}function _(a,r,u,d){const s=r.filter(m=>m.moduleId===a),e=s.length>0?s.reduce((m,b)=>m+b.score,0)/s.length:0,h=["identification","multiple_choice"],p=s.filter(m=>h.includes(m.questionType)),i=p.length>0?p.reduce((m,b)=>m+b.score,0)/p.length:e*.9,o=["word_problem","equation_based","enumeration"],l=s.filter(m=>o.includes(m.questionType)),n=l.length>0?l.reduce((m,b)=>m+b.score,0)/l.length:e*.85,f=u,c=f?.lessonsCompleted?.length||0,k=f?.quizzesCompleted?.length||0,S=f?.sessionsCompleted||0,y=d.find(m=>m.id===a),x=y?.lessons?.length||1,N=y?.quizzes?.length||1,C=Math.min(100,c/x*100),M=Math.min(100,k/N*100),v=Math.min(100,(C+M+S*5)/2.5);if(s.length<2){const m=v>50?60+v*.3:v*.8;return{overallMastery:e,conceptGrasp:i,application:n,engagement:v,consistency:Math.min(100,m)}}const w=s.map(m=>m.score),z=w.reduce((m,b)=>m+b,0)/w.length,D=w.reduce((m,b)=>m+Math.pow(b-z,2),0)/w.length,j=Math.sqrt(D)/Math.max(z,1),q=Math.max(0,Math.min(100,(1-j)*100));return{overallMastery:Math.round(e),conceptGrasp:Math.round(i),application:Math.round(n),engagement:Math.round(v),consistency:Math.round(q)}}async function le(a){try{const r=E(A,"users",a,"competencyMatrix"),u=await R(r);if(u.empty)return{};const d={};return u.forEach(s=>{const e=s.data();d[s.id]={moduleId:s.id,moduleName:e.moduleName||s.id,overallMastery:e.overallMastery??0,conceptGrasp:e.conceptGrasp??0,application:e.application??0,engagement:e.engagement??0,consistency:e.consistency??0,computedAt:e.computedAt?.toDate?.()||new Date}}),d}catch(r){return console.error("[competencyService] fetchCachedCompetencyMatrix failed:",r),{}}}const Q=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}];function ce(a){const[r,u]=g.useState([]),[d,s]=g.useState([]),[e,h]=g.useState("N/A"),[p,i]=g.useState(!0),[o,l]=g.useState(null),[n,f]=g.useState(!1),c=g.useRef(0),k=g.useCallback(async(y,x)=>{if(x!==c.current)return;const C=J(null)[0]??"gen-math",M=V.find(j=>j.id===C)?.modules||[],v=M.map((j,q)=>({id:j.id,name:j.title.length>15?j.title.substring(0,15).trim()+"...":j.title,color:P[q%P.length]})),w=await le(a);if(x!==c.current)return;if(Object.keys(w).length>0){de(w,v,u,h),f(!1),i(!1);return}const z=await re(a),D=await ie(a);if(x!==c.current)return;const T=z.length>0;f(!T),ue(z,D,v,M,u,h),i(!1)},[a]),S=g.useCallback(async()=>{if(!a){i(!1);return}const y=++c.current;i(!0),l(null);try{const x=await new Promise(N=>{const C=I(a,M=>{C(),N(M)})});if(y!==c.current)return;await k(x,y)}catch(x){console.error("[useCompetencyMatrix] Failed to load:",x),y===c.current&&(l("Failed to load competency data. Please try again."),i(!1))}},[a,k]);return g.useEffect(()=>{if(!a)return;const y=I(a,x=>{const N=++c.current;k(x,N)});return()=>y()},[a,k]),{data:r,modulesList:d,topModule:e,loading:p,error:o,isEmpty:n,refresh:S}}function de(a,r,u,d){let s=-1,e="N/A";const h=Q.map(p=>{const i={metric:p.label,fullMark:100};return r.forEach(o=>{const l=a[o.id];l&&(p.key==="progress"?i[o.id]=l.overallMastery:p.key==="concept"?i[o.id]=l.conceptGrasp:p.key==="application"?i[o.id]=l.application:p.key==="engagement"?i[o.id]=l.engagement:p.key==="consistency"&&(i[o.id]=l.consistency))}),i});r.forEach(p=>{const i=a[p.id];if(i){const o=(i.overallMastery+i.conceptGrasp+i.application+i.engagement+i.consistency)/5;o>s&&(s=o,e=p.name)}}),d(e),u(h)}function ue(a,r,u,d,s,e){let h=-1,p="N/A";const i=Q.map(o=>{const l={metric:o.label,fullMark:100};return d.forEach(n=>{const f=r[n.id],c=_(n.id,a,f??{moduleId:n.id,sessionsCompleted:0,moduleTitle:n.title,lessonsCompleted:[],quizzesCompleted:[]},d);o.key==="progress"?l[n.id]=c.overallMastery:o.key==="concept"?l[n.id]=c.conceptGrasp:o.key==="application"?l[n.id]=c.application:o.key==="engagement"?l[n.id]=c.engagement:o.key==="consistency"&&(l[n.id]=c.consistency)}),l});d.forEach(o=>{const l=r[o.id],n=_(o.id,a,l??{moduleId:o.id,sessionsCompleted:0,moduleTitle:o.title,lessonsCompleted:[],quizzesCompleted:[]},d),f=(n.overallMastery+n.conceptGrasp+n.application+n.engagement+n.consistency)/5;f>h&&(h=f,p=u.find(c=>c.id===o.id)?.name||"N/A")}),e(p),s(i)}const Me=()=>{const{userProfile:a}=B(),{data:r,modulesList:u,topModule:d,loading:s,error:e,isEmpty:h,refresh:p}=ce(a?.uid??""),[i,o]=g.useState(!1),l=()=>{p()};return t.jsxs(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"relative overflow-hidden bg-white/80 backdrop-blur-xl border border-white/50 shadow-[0_8px_30px_rgb(0,0,0,0.04)] rounded-[2rem] p-6 lg:p-8 isolate group",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-violet-400/5 rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"}),t.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-rose-400/5 rounded-full blur-3xl translate-y-1/3 -translate-x-1/3"}),t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 relative z-10 gap-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx("span",{className:"p-2 bg-violet-100 text-violet-600 rounded-xl",children:t.jsx(O,{size:20,className:"stroke-[2.5]"})}),t.jsx("h3",{className:"text-xl font-display font-extrabold text-[#0a1628] tracking-tight",children:"Competency Matrix"})]}),t.jsx("p",{className:"text-sm text-[#5a6578] font-body ml-12",children:"Your realtime performance across modules"})]}),!s&&!h&&!e&&t.jsxs("div",{className:"flex items-center gap-3 bg-slate-50 border border-slate-100 px-4 py-2 rounded-2xl ml-12 sm:ml-0",children:[t.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-white shadow-sm border border-slate-100",children:t.jsx(X,{size:14,className:"text-amber-500"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:"Top Module"}),t.jsx("p",{className:"text-sm font-bold text-slate-700",children:d})]})]}),!s&&t.jsx("button",{onClick:l,className:"sm:ml-auto text-xs font-semibold text-slate-400 hover:text-violet-600 transition-colors px-2 py-1 rounded-lg hover:bg-violet-50",title:"Refresh competency data",children:"Refresh"})]}),t.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 border-4 border-violet-200 border-t-violet-500 rounded-full animate-spin"}),t.jsx("p",{className:"text-sm text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):h||e?t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-4",children:[t.jsx("div",{className:"w-16 h-16 rounded-2xl bg-slate-100 flex items-center justify-center",children:t.jsx(W,{size:28,className:"text-slate-400"})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-semibold text-slate-600 mb-1",children:e?"Unable to load competency data":"No activity yet"}),t.jsx("p",{className:"text-xs text-slate-400 max-w-[260px]",children:e||"Complete quizzes and lessons to see your competency matrix here."})]}),e&&t.jsx("button",{onClick:l,className:"px-4 py-2 text-xs font-semibold bg-violet-100 text-violet-700 rounded-xl hover:bg-violet-200 transition-colors",children:"Try Again"})]}):t.jsx(Z,{width:"100%",height:"100%",children:t.jsxs(ee,{cx:"50%",cy:"50%",outerRadius:i?"75%":"70%",data:r,children:[t.jsx(te,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),t.jsx(se,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600,fontFamily:"Inter, sans-serif"}}),t.jsx(ne,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),u.map(n=>t.jsx(ae,{name:n.name,dataKey:n.id,stroke:n.color,strokeWidth:2,fill:n.color,fillOpacity:.35,dot:{r:3,fill:"#fff",stroke:n.color,strokeWidth:2},activeDot:{r:5,fill:n.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},n.id)),t.jsx(oe,{cursor:!1,content:({active:n,payload:f})=>n&&f&&f.length?t.jsxs("div",{className:"bg-white/95 backdrop-blur shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)] border border-slate-100 rounded-xl p-4",children:[t.jsx("p",{className:"font-display font-bold text-slate-800 text-sm mb-3",children:f[0].payload.metric}),t.jsx("div",{className:"flex flex-col gap-2",children:f.map(c=>t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c.stroke}}),t.jsx("span",{className:"text-xs font-bold text-slate-600 uppercase tracking-wide truncate max-w-[120px]",title:String(c.name),children:String(c.name)})]}),t.jsxs("span",{className:"text-sm font-black",style:{color:c.stroke},children:[Math.round(c.value),"%"]})]},c.name))})]}):null})]})})}),!s&&!h&&!e&&u.length>0&&t.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 md:gap-5 mt-[5px] z-10 relative",children:u.map(n=>t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:n.color}}),t.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-widest",children:n.name.length>15?n.name.substring(0,12)+"...":n.name})]},n.id))})]})};export{Me as CompetencyRadarChart};
 
1
+ import{r as g,j as t}from"./vendor-react-B4AQeu28.js";import{f as A,a4 as I,u as B,m as L,B as O,a as W}from"./index-BaOs5Ayg.js";import{collection as E,getDocs as R,query as H,orderBy as K,limit as U,Timestamp as G,getDoc as Y,doc as $}from"./vendor-firebase-firestore-CH1lNiRF.js";import{g as J,s as V}from"./subjects-BFghB0SQ.js";import{S as X}from"./sparkles-By-vFjpv.js";import{R as Z,f as ee,P as te,g as se,h as ne,i as ae,T as oe}from"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-B3jJOD5i.js";const P=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];async function re(a){try{const r=E(A,"users",a,"quizResults"),u=H(r,K("timestamp","desc"),U(500)),d=await R(u);return d.empty?F(a):d.docs.map(s=>{const e=s.data();return{quizId:s.id,moduleId:e.moduleId||"",subjectId:e.subjectId||"",score:typeof e.score=="number"?e.score:0,totalQuestions:e.totalQuestions||0,correctAnswers:e.correctAnswers||0,questionType:e.questionType||"multiple_choice",timestamp:e.timestamp instanceof G||e.timestamp?.toDate?e.timestamp.toDate():new Date,timeSpent:e.timeSpent||0}})}catch(r){return console.error("[competencyService] fetchQuizResults failed, falling back:",r),F(a)}}async function F(a){const r=await Y($(A,"progress",a));return r.exists()?(r.data().quizAttempts||[]).map((s,e)=>({quizId:String(s.quizId||`attempt-${e}`),moduleId:String(s.moduleId||s.quizId||""),subjectId:String(s.subjectId||""),score:typeof s.score=="number"?s.score:0,totalQuestions:s.totalQuestions||0,correctAnswers:typeof s.correctAnswers=="number"?s.correctAnswers:0,questionType:s.questionType||"multiple_choice",timestamp:s.completedAt?new Date(s.completedAt):new Date,timeSpent:s.timeSpent||0})):[]}async function ie(a){try{const r=E(A,"users",a,"moduleProgress"),u=await R(r);if(u.empty)return{};const d={};return u.forEach(s=>{const e=s.data();d[s.id]={moduleId:s.id,subjectId:e.subjectId||"",sessionsCompleted:e.sessionsCompleted||0,lastActive:e.lastActive?e.lastActive instanceof G?e.lastActive.toDate():new Date(e.lastActive):new Date,moduleTitle:e.moduleTitle||s.id,lessonsCompleted:e.lessonsCompleted||[],quizzesCompleted:e.quizzesCompleted||[]}}),d}catch(r){return console.error("[competencyService] fetchModuleProgress failed:",r),{}}}function _(a,r,u,d){const s=r.filter(m=>m.moduleId===a),e=s.length>0?s.reduce((m,b)=>m+b.score,0)/s.length:0,h=["identification","multiple_choice"],p=s.filter(m=>h.includes(m.questionType)),i=p.length>0?p.reduce((m,b)=>m+b.score,0)/p.length:e*.9,o=["word_problem","equation_based","enumeration"],l=s.filter(m=>o.includes(m.questionType)),n=l.length>0?l.reduce((m,b)=>m+b.score,0)/l.length:e*.85,f=u,c=f?.lessonsCompleted?.length||0,k=f?.quizzesCompleted?.length||0,S=f?.sessionsCompleted||0,y=d.find(m=>m.id===a),x=y?.lessons?.length||1,N=y?.quizzes?.length||1,C=Math.min(100,c/x*100),M=Math.min(100,k/N*100),v=Math.min(100,(C+M+S*5)/2.5);if(s.length<2){const m=v>50?60+v*.3:v*.8;return{overallMastery:e,conceptGrasp:i,application:n,engagement:v,consistency:Math.min(100,m)}}const w=s.map(m=>m.score),z=w.reduce((m,b)=>m+b,0)/w.length,D=w.reduce((m,b)=>m+Math.pow(b-z,2),0)/w.length,j=Math.sqrt(D)/Math.max(z,1),q=Math.max(0,Math.min(100,(1-j)*100));return{overallMastery:Math.round(e),conceptGrasp:Math.round(i),application:Math.round(n),engagement:Math.round(v),consistency:Math.round(q)}}async function le(a){try{const r=E(A,"users",a,"competencyMatrix"),u=await R(r);if(u.empty)return{};const d={};return u.forEach(s=>{const e=s.data();d[s.id]={moduleId:s.id,moduleName:e.moduleName||s.id,overallMastery:e.overallMastery??0,conceptGrasp:e.conceptGrasp??0,application:e.application??0,engagement:e.engagement??0,consistency:e.consistency??0,computedAt:e.computedAt?.toDate?.()||new Date}}),d}catch(r){return console.error("[competencyService] fetchCachedCompetencyMatrix failed:",r),{}}}const Q=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}];function ce(a){const[r,u]=g.useState([]),[d,s]=g.useState([]),[e,h]=g.useState("N/A"),[p,i]=g.useState(!0),[o,l]=g.useState(null),[n,f]=g.useState(!1),c=g.useRef(0),k=g.useCallback(async(y,x)=>{if(x!==c.current)return;const C=J(null)[0]??"gen-math",M=V.find(j=>j.id===C)?.modules||[],v=M.map((j,q)=>({id:j.id,name:j.title.length>15?j.title.substring(0,15).trim()+"...":j.title,color:P[q%P.length]})),w=await le(a);if(x!==c.current)return;if(Object.keys(w).length>0){de(w,v,u,h),f(!1),i(!1);return}const z=await re(a),D=await ie(a);if(x!==c.current)return;const T=z.length>0;f(!T),ue(z,D,v,M,u,h),i(!1)},[a]),S=g.useCallback(async()=>{if(!a){i(!1);return}const y=++c.current;i(!0),l(null);try{const x=await new Promise(N=>{const C=I(a,M=>{C(),N(M)})});if(y!==c.current)return;await k(x,y)}catch(x){console.error("[useCompetencyMatrix] Failed to load:",x),y===c.current&&(l("Failed to load competency data. Please try again."),i(!1))}},[a,k]);return g.useEffect(()=>{if(!a)return;const y=I(a,x=>{const N=++c.current;k(x,N)});return()=>y()},[a,k]),{data:r,modulesList:d,topModule:e,loading:p,error:o,isEmpty:n,refresh:S}}function de(a,r,u,d){let s=-1,e="N/A";const h=Q.map(p=>{const i={metric:p.label,fullMark:100};return r.forEach(o=>{const l=a[o.id];l&&(p.key==="progress"?i[o.id]=l.overallMastery:p.key==="concept"?i[o.id]=l.conceptGrasp:p.key==="application"?i[o.id]=l.application:p.key==="engagement"?i[o.id]=l.engagement:p.key==="consistency"&&(i[o.id]=l.consistency))}),i});r.forEach(p=>{const i=a[p.id];if(i){const o=(i.overallMastery+i.conceptGrasp+i.application+i.engagement+i.consistency)/5;o>s&&(s=o,e=p.name)}}),d(e),u(h)}function ue(a,r,u,d,s,e){let h=-1,p="N/A";const i=Q.map(o=>{const l={metric:o.label,fullMark:100};return d.forEach(n=>{const f=r[n.id],c=_(n.id,a,f??{moduleId:n.id,sessionsCompleted:0,moduleTitle:n.title,lessonsCompleted:[],quizzesCompleted:[]},d);o.key==="progress"?l[n.id]=c.overallMastery:o.key==="concept"?l[n.id]=c.conceptGrasp:o.key==="application"?l[n.id]=c.application:o.key==="engagement"?l[n.id]=c.engagement:o.key==="consistency"&&(l[n.id]=c.consistency)}),l});d.forEach(o=>{const l=r[o.id],n=_(o.id,a,l??{moduleId:o.id,sessionsCompleted:0,moduleTitle:o.title,lessonsCompleted:[],quizzesCompleted:[]},d),f=(n.overallMastery+n.conceptGrasp+n.application+n.engagement+n.consistency)/5;f>h&&(h=f,p=u.find(c=>c.id===o.id)?.name||"N/A")}),e(p),s(i)}const Me=()=>{const{userProfile:a}=B(),{data:r,modulesList:u,topModule:d,loading:s,error:e,isEmpty:h,refresh:p}=ce(a?.uid??""),[i,o]=g.useState(!1),l=()=>{p()};return t.jsxs(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"relative overflow-hidden bg-white/80 backdrop-blur-xl border border-white/50 shadow-[0_8px_30px_rgb(0,0,0,0.04)] rounded-[2rem] p-6 lg:p-8 isolate group",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-violet-400/5 rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"}),t.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-rose-400/5 rounded-full blur-3xl translate-y-1/3 -translate-x-1/3"}),t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 relative z-10 gap-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx("span",{className:"p-2 bg-violet-100 text-violet-600 rounded-xl",children:t.jsx(O,{size:20,className:"stroke-[2.5]"})}),t.jsx("h3",{className:"text-xl font-display font-extrabold text-[#0a1628] tracking-tight",children:"Competency Matrix"})]}),t.jsx("p",{className:"text-sm text-[#5a6578] font-body ml-12",children:"Your realtime performance across modules"})]}),!s&&!h&&!e&&t.jsxs("div",{className:"flex items-center gap-3 bg-slate-50 border border-slate-100 px-4 py-2 rounded-2xl ml-12 sm:ml-0",children:[t.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-white shadow-sm border border-slate-100",children:t.jsx(X,{size:14,className:"text-amber-500"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:"Top Module"}),t.jsx("p",{className:"text-sm font-bold text-slate-700",children:d})]})]}),!s&&t.jsx("button",{onClick:l,className:"sm:ml-auto text-xs font-semibold text-slate-400 hover:text-violet-600 transition-colors px-2 py-1 rounded-lg hover:bg-violet-50",title:"Refresh competency data",children:"Refresh"})]}),t.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 border-4 border-violet-200 border-t-violet-500 rounded-full animate-spin"}),t.jsx("p",{className:"text-sm text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):h||e?t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-4",children:[t.jsx("div",{className:"w-16 h-16 rounded-2xl bg-slate-100 flex items-center justify-center",children:t.jsx(W,{size:28,className:"text-slate-400"})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-sm font-semibold text-slate-600 mb-1",children:e?"Unable to load competency data":"No activity yet"}),t.jsx("p",{className:"text-xs text-slate-400 max-w-[260px]",children:e||"Complete quizzes and lessons to see your competency matrix here."})]}),e&&t.jsx("button",{onClick:l,className:"px-4 py-2 text-xs font-semibold bg-violet-100 text-violet-700 rounded-xl hover:bg-violet-200 transition-colors",children:"Try Again"})]}):t.jsx(Z,{width:"100%",height:"100%",children:t.jsxs(ee,{cx:"50%",cy:"50%",outerRadius:i?"75%":"70%",data:r,children:[t.jsx(te,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),t.jsx(se,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600,fontFamily:"Inter, sans-serif"}}),t.jsx(ne,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),u.map(n=>t.jsx(ae,{name:n.name,dataKey:n.id,stroke:n.color,strokeWidth:2,fill:n.color,fillOpacity:.35,dot:{r:3,fill:"#fff",stroke:n.color,strokeWidth:2},activeDot:{r:5,fill:n.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},n.id)),t.jsx(oe,{cursor:!1,content:({active:n,payload:f})=>n&&f&&f.length?t.jsxs("div",{className:"bg-white/95 backdrop-blur shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)] border border-slate-100 rounded-xl p-4",children:[t.jsx("p",{className:"font-display font-bold text-slate-800 text-sm mb-3",children:f[0].payload.metric}),t.jsx("div",{className:"flex flex-col gap-2",children:f.map(c=>t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c.stroke}}),t.jsx("span",{className:"text-xs font-bold text-slate-600 uppercase tracking-wide truncate max-w-[120px]",title:String(c.name),children:String(c.name)})]}),t.jsxs("span",{className:"text-sm font-black",style:{color:c.stroke},children:[Math.round(c.value),"%"]})]},c.name))})]}):null})]})})}),!s&&!h&&!e&&u.length>0&&t.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 md:gap-5 mt-[5px] z-10 relative",children:u.map(n=>t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:n.color}}),t.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-widest",children:n.name.length>15?n.name.substring(0,12)+"...":n.name})]},n.id))})]})};export{Me as CompetencyRadarChart};
assets/{ConfirmModal-B7469iTj.js β†’ ConfirmModal-6cgkqXAT.js} RENAMED
@@ -1 +1 @@
1
- import{j as e}from"./vendor-react-B4AQeu28.js";import{B as i}from"./button-De2q2xHf.js";import{j as f,m as r,p as h}from"./index-Cb8VeSuW.js";import{X as j}from"./x-CTLBAl-n.js";import{T as y}from"./trash-2-DB-oXtbr.js";import{L as w}from"./log-out-CM6AS10M.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";const O=({isOpen:s,onClose:t,onConfirm:n,title:a,message:l,confirmText:c="Confirm",cancelText:d="Cancel",type:m="warning",icon:x="warning",zIndexClass:g="z-50"})=>{const b=()=>{switch(x){case"logout":return e.jsx(w,{size:32});case"delete":return e.jsx(y,{size:32});case"warning":default:return e.jsx(h,{size:32})}},o=(()=>{switch(m){case"danger":return{iconBg:"bg-red-100",iconColor:"text-red-600",buttonBg:"bg-red-600 hover:bg-red-700",buttonText:"text-white"};case"warning":return{iconBg:"bg-rose-100",iconColor:"text-rose-600",buttonBg:"bg-rose-600 hover:bg-rose-700",buttonText:"text-white"};case"info":default:return{iconBg:"bg-sky-100",iconColor:"text-sky-600",buttonBg:"bg-sky-600 hover:bg-sky-700",buttonText:"text-white"}}})(),p=async()=>{try{await n(),t()}catch{}};return e.jsx(f,{children:s&&e.jsx(e.Fragment,{children:e.jsx(r.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`fixed inset-0 bg-black/50 backdrop-blur-sm ${g} flex items-center justify-center p-4`,children:e.jsxs(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:25,stiffness:300},onClick:u=>u.stopPropagation(),className:"bg-[#f7f9fc] rounded-3xl shadow-2xl max-w-md w-full overflow-hidden border border-[#dde3eb]",children:[e.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-xl transition-colors z-10",children:e.jsx(j,{size:20})}),e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(r.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",damping:15},className:`w-20 h-20 ${o.iconBg} rounded-full flex items-center justify-center mx-auto mb-6 ${o.iconColor}`,children:b()}),e.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628] mb-3",children:a}),e.jsx("p",{className:"text-[#5a6578] mb-8 leading-relaxed",children:l}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(i,{onClick:t,variant:"outline",size:"lg",className:"flex-1 h-12 rounded-xl border-[#dde3eb] hover:border-[#d1cec6] hover:bg-[#edf1f7] font-bold",children:d}),e.jsx(i,{onClick:p,size:"lg",className:`flex-1 h-12 rounded-xl font-bold ${o.buttonBg} ${o.buttonText} transition-colors shadow-lg`,children:c})]})]})]})})})})};export{O as default};
 
1
+ import{j as e}from"./vendor-react-B4AQeu28.js";import{B as i}from"./button-DCfeFHoH.js";import{j as f,m as r,p as h}from"./index-BaOs5Ayg.js";import{X as j}from"./x-TNvtuOD9.js";import{T as y}from"./trash-2-HTnKafZd.js";import{L as w}from"./log-out-BenDMDly.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";const O=({isOpen:s,onClose:t,onConfirm:n,title:a,message:l,confirmText:c="Confirm",cancelText:d="Cancel",type:m="warning",icon:x="warning",zIndexClass:g="z-50"})=>{const b=()=>{switch(x){case"logout":return e.jsx(w,{size:32});case"delete":return e.jsx(y,{size:32});case"warning":default:return e.jsx(h,{size:32})}},o=(()=>{switch(m){case"danger":return{iconBg:"bg-red-100",iconColor:"text-red-600",buttonBg:"bg-red-600 hover:bg-red-700",buttonText:"text-white"};case"warning":return{iconBg:"bg-rose-100",iconColor:"text-rose-600",buttonBg:"bg-rose-600 hover:bg-rose-700",buttonText:"text-white"};case"info":default:return{iconBg:"bg-sky-100",iconColor:"text-sky-600",buttonBg:"bg-sky-600 hover:bg-sky-700",buttonText:"text-white"}}})(),p=async()=>{try{await n(),t()}catch{}};return e.jsx(f,{children:s&&e.jsx(e.Fragment,{children:e.jsx(r.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:`fixed inset-0 bg-black/50 backdrop-blur-sm ${g} flex items-center justify-center p-4`,children:e.jsxs(r.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",damping:25,stiffness:300},onClick:u=>u.stopPropagation(),className:"bg-[#f7f9fc] rounded-3xl shadow-2xl max-w-md w-full overflow-hidden border border-[#dde3eb]",children:[e.jsx("button",{onClick:t,className:"absolute top-4 right-4 p-2 text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-xl transition-colors z-10",children:e.jsx(j,{size:20})}),e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(r.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.1,type:"spring",damping:15},className:`w-20 h-20 ${o.iconBg} rounded-full flex items-center justify-center mx-auto mb-6 ${o.iconColor}`,children:b()}),e.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628] mb-3",children:a}),e.jsx("p",{className:"text-[#5a6578] mb-8 leading-relaxed",children:l}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(i,{onClick:t,variant:"outline",size:"lg",className:"flex-1 h-12 rounded-xl border-[#dde3eb] hover:border-[#d1cec6] hover:bg-[#edf1f7] font-bold",children:d}),e.jsx(i,{onClick:p,size:"lg",className:`flex-1 h-12 rounded-xl font-bold ${o.buttonBg} ${o.buttonText} transition-colors shadow-lg`,children:c})]})]})]})})})})};export{O as default};
assets/{FloatingAITutor-C_4EP63I.js β†’ FloatingAITutor-BIdguqCV.js} RENAMED
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-B5QlckxZ.js","assets/index-Cb8VeSuW.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CH1lNiRF.js","assets/vendor-firebase-core-CO26nNq6.js","assets/vendor-firebase-auth-BLpRW_zO.js","assets/vendor-firebase-storage-B3igpVVS.js","assets/vendor-firebase-analytics-CTiUNb0-.js","assets/vendor-radix-BorKzPz9.js","assets/vendor-charts-D8hf8tI0.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-Aaqs1LGb.css"])))=>i.map(i=>d[i]);
2
- import{ay as C,_ as y,m as b,w as A}from"./index-Cb8VeSuW.js";import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{M}from"./maximize-2-DkEKBrNU.js";import{M as w}from"./minus-CMQilTBg.js";import{X as g}from"./x-CTLBAl-n.js";import{S as L}from"./send-CMJOaNp6.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const E=i.lazy(()=>y(()=>import("./ChatMarkdown-B5QlckxZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));function O(a){return a?a instanceof Date?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof a=="object"&&"toDate"in a?a.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(a):""}const Q=({constraintsRef:a,onFullScreen:j})=>{const{activeSessionId:r,setActiveSessionId:v,createNewSession:N,getActiveSession:k,sendMessage:I,isLoading:o}=C(),[s,l]=i.useState(!1),[c,u]=i.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[n,m]=i.useState(""),h=i.useRef(null);i.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",c?"1":"0")},[c]),i.useEffect(()=>{s&&y(async()=>{const{warmupBackend:t}=await import("./index-Cb8VeSuW.js").then(d=>d.aV);return{warmupBackend:t}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("Floating tutor warmup skipped:",t)})},[s]),i.useEffect(()=>{if(s&&!r){const t={id:"1",sender:"ai",text:"Hi! I'm your AI math tutor. What would you like to learn about today?",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},d=N(t);v(d)}},[s]);const x=k()?.messages||[],S=()=>{h.current?.scrollIntoView({behavior:"smooth"})};i.useEffect(()=>{S()},[x]);const p=async()=>{if(!n.trim()||!r||o)return;const t=n.trim();m(""),await I(r,t)},_=()=>{j()},f=()=>{l(!1),u(!0)},z=()=>{u(!1)};return e.jsxs("div",{className:"pointer-events-none flex flex-col items-end",children:[e.jsxs("div",{className:`pointer-events-auto mb-4 w-80 bg-[#f7f9fc] rounded-3xl shadow-2xl border border-[#dde3eb] flex flex-col overflow-hidden transition-all duration-300 origin-bottom-right select-none ${s?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-10 pointer-events-none h-0"}`,style:{"--max-h":s?"32rem":"0",willChange:"transform, opacity"},children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-4 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-9 h-9 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold text-sm",children:"L.O.L.I."}),e.jsxs("p",{className:"text-sky-100 text-[10px] leading-tight",children:["Logical Operations &",e.jsx("br",{}),"Learning Intelligence"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:_,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(M,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:f,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:e.jsx(w,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>l(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(g,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[x.map(t=>e.jsx("div",{className:`flex ${t.sender==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[75%] rounded-2xl px-4 py-2.5 ${t.sender==="user"?"bg-sky-600 text-white":"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}):e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}),children:e.jsx(E,{children:t.text})}),e.jsx("p",{className:`text-[10px] mt-1 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:O(t.timestamp)})]})},t.id)),o&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb] rounded-2xl px-4 py-2.5 max-w-[75%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})}),e.jsx("div",{ref:h})]}),e.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:"ai-tutor-input",name:"ai-tutor-input","aria-label":"Ask AI tutor a question",type:"text",value:n,onChange:t=>m(t.target.value),onKeyPress:t=>t.key==="Enter"&&p(),placeholder:"Ask me anything...",className:"flex-1 px-4 py-2.5 rounded-xl border border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-500 text-sm bg-[#f7f9fc]"}),e.jsx("button",{type:"button","aria-label":"Send message",onClick:p,className:"p-2.5 bg-sky-600 hover:bg-sky-700 text-white rounded-xl transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!n.trim()||o,children:e.jsx(L,{size:18})})]})})]}),e.jsx("div",{className:"pointer-events-auto relative self-end",children:c?e.jsx(b.button,{type:"button",onClick:z,whileHover:{scale:1.08},whileTap:{scale:.95},transition:{duration:.15,ease:"easeOut"},className:"h-9 w-9 rounded-full bg-slate-900/85 text-white shadow-lg ring-1 ring-white/20 backdrop-blur-sm flex items-center justify-center","aria-label":"Restore AI tutor launcher",title:"Show AI tutor",style:{willChange:"transform"},children:e.jsx(A,{size:14})}):e.jsxs("div",{className:"relative group",children:[!s&&e.jsxs("div",{className:"absolute right-full mr-4 top-1/2 -translate-y-1/2 px-4 py-2 bg-slate-800 text-white text-sm rounded-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap shadow-xl z-50",children:["Hello! I'm L.O.L.I., how may I help you?",e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -right-1 w-3 h-3 bg-slate-800 rotate-45"})]}),!s&&e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",title:"Minimize",onClick:f,className:"absolute -top-2 -left-2 z-10 h-6 w-6 rounded-full bg-white text-slate-700 border border-slate-200 shadow-md hover:bg-slate-100 transition-colors flex items-center justify-center",children:e.jsx(w,{size:12})}),e.jsx(b.button,{type:"button",onClick:()=>l(!s),whileHover:{scale:1.1},whileTap:{scale:.9},transition:{duration:.15,ease:"easeOut"},className:"w-16 h-16 bg-gradient-to-br from-sky-600 to-sky-500 rounded-xl shadow-2xl flex items-center justify-center text-white hover:shadow-sky-300/50 transition-all","aria-label":s?"Close AI tutor chat":"Open AI tutor chat",style:{willChange:"transform"},children:s?e.jsx(g,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})})]})};export{Q as default};
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-fgwaycBR.js","assets/index-BaOs5Ayg.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CH1lNiRF.js","assets/vendor-firebase-core-CO26nNq6.js","assets/vendor-firebase-auth-BLpRW_zO.js","assets/vendor-firebase-storage-B3igpVVS.js","assets/vendor-firebase-analytics-CTiUNb0-.js","assets/vendor-radix-BorKzPz9.js","assets/vendor-charts-D8hf8tI0.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-DdX2rVyy.css"])))=>i.map(i=>d[i]);
2
+ import{ay as C,_ as y,m as b,w as A}from"./index-BaOs5Ayg.js";import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{M}from"./maximize-2-EHa6JURc.js";import{M as w}from"./minus-DfrEv-SC.js";import{X as g}from"./x-TNvtuOD9.js";import{S as L}from"./send-CwwDU3uJ.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const E=i.lazy(()=>y(()=>import("./ChatMarkdown-fgwaycBR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])));function O(a){return a?a instanceof Date?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof a=="object"&&"toDate"in a?a.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(a):""}const Q=({constraintsRef:a,onFullScreen:j})=>{const{activeSessionId:r,setActiveSessionId:v,createNewSession:N,getActiveSession:k,sendMessage:I,isLoading:o}=C(),[s,l]=i.useState(!1),[c,u]=i.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[n,m]=i.useState(""),h=i.useRef(null);i.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",c?"1":"0")},[c]),i.useEffect(()=>{s&&y(async()=>{const{warmupBackend:t}=await import("./index-BaOs5Ayg.js").then(d=>d.b2);return{warmupBackend:t}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("Floating tutor warmup skipped:",t)})},[s]),i.useEffect(()=>{if(s&&!r){const t={id:"1",sender:"ai",text:"Hi! I'm your AI math tutor. What would you like to learn about today?",timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},d=N(t);v(d)}},[s]);const x=k()?.messages||[],S=()=>{h.current?.scrollIntoView({behavior:"smooth"})};i.useEffect(()=>{S()},[x]);const p=async()=>{if(!n.trim()||!r||o)return;const t=n.trim();m(""),await I(r,t)},_=()=>{j()},f=()=>{l(!1),u(!0)},z=()=>{u(!1)};return e.jsxs("div",{className:"pointer-events-none flex flex-col items-end",children:[e.jsxs("div",{className:`pointer-events-auto mb-4 w-80 bg-[#f7f9fc] rounded-3xl shadow-2xl border border-[#dde3eb] flex flex-col overflow-hidden transition-all duration-300 origin-bottom-right select-none ${s?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-10 pointer-events-none h-0"}`,style:{"--max-h":s?"32rem":"0",willChange:"transform, opacity"},children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-4 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-9 h-9 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold text-sm",children:"L.O.L.I."}),e.jsxs("p",{className:"text-sky-100 text-[10px] leading-tight",children:["Logical Operations &",e.jsx("br",{}),"Learning Intelligence"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:_,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(M,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:f,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:e.jsx(w,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>l(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(g,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[x.map(t=>e.jsx("div",{className:`flex ${t.sender==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:`max-w-[75%] rounded-2xl px-4 py-2.5 ${t.sender==="user"?"bg-sky-600 text-white":"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}):e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}),children:e.jsx(E,{children:t.text})}),e.jsx("p",{className:`text-[10px] mt-1 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:O(t.timestamp)})]})},t.id)),o&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-sm border border-[#dde3eb] rounded-2xl px-4 py-2.5 max-w-[75%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})}),e.jsx("div",{ref:h})]}),e.jsx("div",{className:"p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{id:"ai-tutor-input",name:"ai-tutor-input","aria-label":"Ask AI tutor a question",type:"text",value:n,onChange:t=>m(t.target.value),onKeyPress:t=>t.key==="Enter"&&p(),placeholder:"Ask me anything...",className:"flex-1 px-4 py-2.5 rounded-xl border border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-500 text-sm bg-[#f7f9fc]"}),e.jsx("button",{type:"button","aria-label":"Send message",onClick:p,className:"p-2.5 bg-sky-600 hover:bg-sky-700 text-white rounded-xl transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!n.trim()||o,children:e.jsx(L,{size:18})})]})})]}),e.jsx("div",{className:"pointer-events-auto relative self-end",children:c?e.jsx(b.button,{type:"button",onClick:z,whileHover:{scale:1.08},whileTap:{scale:.95},transition:{duration:.15,ease:"easeOut"},className:"h-9 w-9 rounded-full bg-slate-900/85 text-white shadow-lg ring-1 ring-white/20 backdrop-blur-sm flex items-center justify-center","aria-label":"Restore AI tutor launcher",title:"Show AI tutor",style:{willChange:"transform"},children:e.jsx(A,{size:14})}):e.jsxs("div",{className:"relative group",children:[!s&&e.jsxs("div",{className:"absolute right-full mr-4 top-1/2 -translate-y-1/2 px-4 py-2 bg-slate-800 text-white text-sm rounded-xl opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none whitespace-nowrap shadow-xl z-50",children:["Hello! I'm L.O.L.I., how may I help you?",e.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -right-1 w-3 h-3 bg-slate-800 rotate-45"})]}),!s&&e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",title:"Minimize",onClick:f,className:"absolute -top-2 -left-2 z-10 h-6 w-6 rounded-full bg-white text-slate-700 border border-slate-200 shadow-md hover:bg-slate-100 transition-colors flex items-center justify-center",children:e.jsx(w,{size:12})}),e.jsx(b.button,{type:"button",onClick:()=>l(!s),whileHover:{scale:1.1},whileTap:{scale:.9},transition:{duration:.15,ease:"easeOut"},className:"w-16 h-16 bg-gradient-to-br from-sky-600 to-sky-500 rounded-xl shadow-2xl flex items-center justify-center text-white hover:shadow-sky-300/50 transition-all","aria-label":s?"Close AI tutor chat":"Open AI tutor chat",style:{willChange:"transform"},children:s?e.jsx(g,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})})]})};export{Q as default};
assets/{GradesPage-CmSMzBLK.js β†’ GradesPage-Y0HsmLPP.js} RENAMED
@@ -1,2 +1,2 @@
1
- import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{B as v}from"./button-De2q2xHf.js";import{u as J,az as K,aA as W,z as X,A as Z,y as z,T as R}from"./index-Cb8VeSuW.js";import{g as q,S as E}from"./subjects-Bnu0lJdU.js";import{u as ee}from"./useCurriculum-B8pRV6G_.js";import{D as te}from"./download-C-V0pYsk.js";import{F as P}from"./funnel-D-s_ygM_.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-CmH46HAG.js";const ge=()=>{const{currentUser:i,userProfile:w}=J(),[n,N]=o.useState("all"),[x,D]=o.useState("all"),[M,u]=o.useState(!0),[h,L]=o.useState(null),[F,G]=o.useState([]),y=w?.grade,S=q(y),_=new Set(S),{isLoading:Q}=ee(y);o.useEffect(()=>{},[Q]);const O=t=>{if(t==null)return"N/A";const s=t instanceof Date?t:new Date(t);return Number.isNaN(s.getTime())?"N/A":s.toISOString().split("T")[0]};o.useEffect(()=>{if(!i)return;u(!0);const t=K(i.uid,a=>{L(a),u(!1)}),s=W(i.uid,a=>{G(a),u(!1)});return()=>{t(),s()}},[i]);const b=h?.averageScore?Math.round(h.averageScore):0,U=h?.quizzesCompleted??0,B=b>0?(b/100*4).toFixed(2):"0.00",I={"gen-math":"indigo","stats-prob":"violet"},k={indigo:{dot:"bg-indigo-500",bar:"bg-indigo-500"},violet:{dot:"bg-violet-500",bar:"bg-violet-500"},fuchsia:{dot:"bg-fuchsia-500",bar:"bg-fuchsia-500"},purple:{dot:"bg-purple-500",bar:"bg-purple-500"},slate:{dot:"bg-slate-500",bar:"bg-slate-500"}},A=E.reduce((t,s)=>(t[s.id]={label:s.name,color:I[s.id]||"slate"},t),{}),c=E.filter(t=>_.has(t.id)).map(t=>t.name),T=Object.entries({}).filter(([t])=>_.has(t)).map(([t,s])=>{const a=A[t]||{label:t,color:"slate"},r=[],f=r.length>0?Math.round(r.reduce((g,p)=>g+p.score,0)/r.length):Math.round(s?.progress??0);return{subject:a.label,average:f,quizzes:r.length||s?.completedModules,color:a.color}}),H=S.map(t=>{const s=A[t]||{label:t,color:"slate"};return{subject:s.label,average:0,quizzes:0,color:s.color}}),C=T.length>0?T:H,$=F.slice().sort((t,s)=>{const a=t.completedAt?.toDate?.()?.getTime()??0;return(s.completedAt?.toDate?.()?.getTime()??0)-a}).slice(0,10).map((t,s)=>({id:s+1,title:t.title||`Assessment ${s+1}`,subject:t.subject||"General",score:t.score,date:t.completedAt?O(t.completedAt.toDate()):"N/A",type:t.type==="practice"?"practice":(t.type==="diagnostic","module"),status:t.score>=80?"Excellent":t.score>=60?"Passing":"Needs Review"})).filter(t=>c.includes(t.subject)),m=$.filter(t=>{if(!c.includes(t.subject))return!1;const s=n==="all"||t.subject===n,a=x==="all"||t.type===x;return s&&a});o.useEffect(()=>{n!=="all"&&(c.includes(n)||N("all"))},[c,n]);const V=()=>{const t=l=>{const j=String(l??"");return/[",\n]/.test(j)?`"${j.replace(/"/g,'""')}"`:j},s=[],a=w?.name||i?.displayName||i?.email||"Student",r=new Date().toISOString().split("T")[0];s.push("Grade Report"),s.push(`Student,${t(a)}`),s.push(`Export Date,${t(r)}`),s.push(`Subject Filter,${t(n)}`),s.push(`Type Filter,${t(x)}`),s.push(""),s.push("Subject Performance"),s.push("Subject,Average Score"),C.forEach(l=>{s.push([t(l.subject),t(l.average)].join(","))}),s.push(""),s.push("Recent Quizzes"),s.push("Title,Subject,Score,Date,Type,Status"),m.length===0?s.push("No quiz data available for the selected filters"):m.forEach(l=>{s.push([t(l.title),t(l.subject),t(l.score),t(l.date),t(l.type),t(l.status)].join(","))});const f=s.join(`
2
  `),g=new Blob([f],{type:"text/csv;charset=utf-8;"}),p=window.URL.createObjectURL(g),d=document.createElement("a"),Y=a.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";d.href=p,d.setAttribute("download",`grade-report-${Y}-${r}.csv`),document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(p)};return M?e.jsx("div",{className:"p-8 flex justify-center items-center h-full",children:e.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"p-4 sm:p-6 lg:p-8 space-y-8 max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-white p-6 rounded-[2rem] shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] border border-slate-50",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-black text-slate-800 tracking-tight",children:"Assessment"}),e.jsx("p",{className:"text-slate-400 font-bold mt-1 text-[13px]",children:"Review your performance across subjects"})]}),e.jsxs("div",{className:"flex gap-3 w-full sm:w-auto",children:[e.jsxs(v,{variant:"outline",className:"flex-1 sm:flex-none border-slate-200 text-slate-500 font-bold rounded-xl h-11 px-5 hover:bg-slate-50 hover:text-slate-700",children:[e.jsx(X,{className:"w-4 h-4 mr-2 text-slate-400"}),"This Semester"]}),e.jsxs(v,{className:"flex-1 sm:flex-none bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl h-11 px-5 shadow-[0_8px_20px_-8px_rgba(79,70,229,0.5)] hover:-translate-y-0.5 transition-all",onClick:V,children:[e.jsx(te,{className:"w-4 h-4 mr-2"}),"Report"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-indigo-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-indigo-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-indigo-100 text-indigo-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(Z,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Overall GPA"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsx("h3",{className:"text-4xl font-display font-black text-slate-800",children:B})})]})]}),e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-emerald-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-emerald-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-emerald-100 text-emerald-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(z,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Average Score"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsxs("h3",{className:"text-4xl font-display font-black text-slate-800",children:[b,"%"]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-violet-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-violet-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-violet-100 text-violet-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(R,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Quizzes Completed"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsx("h3",{className:"text-4xl font-display font-black text-slate-800",children:U})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] overflow-hidden flex flex-col h-full",children:[e.jsxs("div",{className:"p-6 sm:p-8 border-b border-slate-50 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-black text-xl text-slate-800",children:"Recent Assessments"}),e.jsx("p",{className:"text-slate-400 font-bold text-[13px] mt-1",children:"Your latest quiz and practice results"})]}),e.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:n,onChange:t=>N(t.target.value),className:"appearance-none w-full pl-4 pr-10 py-2.5 border-none bg-slate-50 rounded-xl text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-[140px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Subjects"}),c.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsx(P,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:x,onChange:t=>D(t.target.value),className:"appearance-none w-full pl-4 pr-10 py-2.5 border-none bg-slate-50 rounded-xl text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-[120px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"module",children:"Module Quiz"}),e.jsx("option",{value:"practice",children:"Practice"})]}),e.jsx(P,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]})]}),e.jsx("div",{className:"overflow-x-auto flex-1 p-2",children:e.jsxs("table",{className:"w-full text-left border-separate border-spacing-y-2 px-4 sm:px-6 mb-4",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Assessment"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent min-w-[120px]",children:"Subject"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right border-b border-transparent",children:"Score"})]})}),e.jsx("tbody",{children:m.length>0?m.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/70 transition-colors",children:[e.jsxs("td",{className:"px-4 py-4 rounded-l-2xl",children:[e.jsx("p",{className:"text-[14px] font-bold text-slate-800",children:t.title}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:t.date})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:"inline-flex flex-col gap-1 items-start",children:e.jsx("span",{className:"text-[13px] font-bold text-slate-600 truncate max-w-[140px] block",children:t.subject})})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:`inline-flex items-center px-3 py-1.5 rounded-lg text-[11px] font-bold uppercase tracking-wide ${t.type==="practice"?"bg-emerald-100/50 text-emerald-600":"bg-indigo-100/50 text-indigo-600"}`,children:t.type==="practice"?"Practice":"Quiz"})}),e.jsx("td",{className:"px-4 py-4 text-right rounded-r-2xl",children:e.jsxs("span",{className:`inline-flex items-center px-3 py-1.5 rounded-xl text-[13px] font-black ${t.score>=80?"bg-emerald-100 text-emerald-700":t.score>=60?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:[t.score,"%"]})})]},t.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-6 py-16 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-full flex items-center justify-center mb-4",children:e.jsx(z,{className:"w-8 h-8 text-slate-300"})}),e.jsx("p",{className:"text-slate-500 font-bold text-sm",children:"No recent assessments match the selected filters."})]})})})})]})})]})}),e.jsxs("div",{className:"space-y-6 lg:space-y-8 flex flex-col",children:[e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)]",children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:e.jsx("h3",{className:"font-display font-black text-lg text-slate-800",children:"Subject Performance"})}),e.jsx("div",{className:"space-y-7",children:C.map((t,s)=>{const a=k[t.color]||k.slate;return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex justify-between items-end mb-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[14px] font-bold text-slate-800 flex items-center gap-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${a.dot} group-hover:scale-125 transition-transform`}),t.subject]}),e.jsxs("p",{className:"text-[11px] text-slate-400 font-bold ml-4 mt-0.5",children:[t.quizzes," activities"]})]}),e.jsxs("span",{className:"text-[15px] font-black text-slate-800",children:[t.average,"%"]})]}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded-full overflow-hidden shadow-inner",children:e.jsx("div",{className:`h-full rounded-full e-w ${a.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{"--w":`${Math.max(t.average,5)}%`},children:e.jsx("div",{className:"absolute inset-0 bg-white/20 w-1/2 -skew-x-12 translate-x-[-100%] group-hover:animate-[shimmer_1.5s_ease-out]"})})})]},s)})})]}),e.jsxs("div",{className:"relative bg-gradient-to-br from-indigo-600 to-violet-700 rounded-[2rem] p-6 sm:p-8 shadow-[0_12px_30px_-10px_rgba(79,70,229,0.5)] text-white overflow-hidden group",children:[e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full blur-3xl -mt-10 -mr-10 group-hover:bg-white/20 transition-all duration-700 ease-in-out"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-indigo-400/30 rounded-full blur-2xl -mb-10 -ml-10"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center mb-5 backdrop-blur-sm border border-white/20 shadow-sm group-hover:scale-110 transition-transform",children:e.jsx(R,{className:"w-6 h-6 text-white"})}),e.jsx("h3",{className:"text-2xl font-display font-black tracking-tight mb-2 leading-tight",children:"Keep up the momentum!"}),e.jsxs("p",{className:"text-white/80 text-[13px] font-medium leading-relaxed mb-8 max-w-[90%]",children:["You've completed ",e.jsx("span",{className:"font-black text-white",children:$.length})," activities recently. Try a practice session to boost your lowest scores."]}),e.jsx(v,{className:"w-full bg-white text-indigo-600 hover:bg-slate-50 border-0 font-black h-12 rounded-xl shadow-[0_8px_16px_rgba(0,0,0,0.15)] hover:shadow-[0_8px_24px_rgba(0,0,0,0.2)] hover:-translate-y-0.5 transition-all",children:"Start Practice Session"})]})]})]})]})]})};export{ge as default};
 
1
+ import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{B as v}from"./button-DCfeFHoH.js";import{u as J,az as K,aA as W,z as X,A as Z,y as z,T as R}from"./index-BaOs5Ayg.js";import{g as q,S as E}from"./subjects-BFghB0SQ.js";import{u as ee}from"./useCurriculum-DDCuCvMR.js";import{D as te}from"./download-DX_YebqQ.js";import{F as P}from"./funnel-BT77sgnz.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-B3jJOD5i.js";const ge=()=>{const{currentUser:i,userProfile:w}=J(),[n,N]=o.useState("all"),[x,D]=o.useState("all"),[M,u]=o.useState(!0),[h,L]=o.useState(null),[F,G]=o.useState([]),y=w?.grade,S=q(y),_=new Set(S),{isLoading:Q}=ee(y);o.useEffect(()=>{},[Q]);const O=t=>{if(t==null)return"N/A";const s=t instanceof Date?t:new Date(t);return Number.isNaN(s.getTime())?"N/A":s.toISOString().split("T")[0]};o.useEffect(()=>{if(!i)return;u(!0);const t=K(i.uid,a=>{L(a),u(!1)}),s=W(i.uid,a=>{G(a),u(!1)});return()=>{t(),s()}},[i]);const b=h?.averageScore?Math.round(h.averageScore):0,U=h?.quizzesCompleted??0,B=b>0?(b/100*4).toFixed(2):"0.00",I={"gen-math":"indigo","stats-prob":"violet"},k={indigo:{dot:"bg-indigo-500",bar:"bg-indigo-500"},violet:{dot:"bg-violet-500",bar:"bg-violet-500"},fuchsia:{dot:"bg-fuchsia-500",bar:"bg-fuchsia-500"},purple:{dot:"bg-purple-500",bar:"bg-purple-500"},slate:{dot:"bg-slate-500",bar:"bg-slate-500"}},A=E.reduce((t,s)=>(t[s.id]={label:s.name,color:I[s.id]||"slate"},t),{}),c=E.filter(t=>_.has(t.id)).map(t=>t.name),T=Object.entries({}).filter(([t])=>_.has(t)).map(([t,s])=>{const a=A[t]||{label:t,color:"slate"},r=[],f=r.length>0?Math.round(r.reduce((g,p)=>g+p.score,0)/r.length):Math.round(s?.progress??0);return{subject:a.label,average:f,quizzes:r.length||s?.completedModules,color:a.color}}),H=S.map(t=>{const s=A[t]||{label:t,color:"slate"};return{subject:s.label,average:0,quizzes:0,color:s.color}}),C=T.length>0?T:H,$=F.slice().sort((t,s)=>{const a=t.completedAt?.toDate?.()?.getTime()??0;return(s.completedAt?.toDate?.()?.getTime()??0)-a}).slice(0,10).map((t,s)=>({id:s+1,title:t.title||`Assessment ${s+1}`,subject:t.subject||"General",score:t.score,date:t.completedAt?O(t.completedAt.toDate()):"N/A",type:t.type==="practice"?"practice":(t.type==="diagnostic","module"),status:t.score>=80?"Excellent":t.score>=60?"Passing":"Needs Review"})).filter(t=>c.includes(t.subject)),m=$.filter(t=>{if(!c.includes(t.subject))return!1;const s=n==="all"||t.subject===n,a=x==="all"||t.type===x;return s&&a});o.useEffect(()=>{n!=="all"&&(c.includes(n)||N("all"))},[c,n]);const V=()=>{const t=l=>{const j=String(l??"");return/[",\n]/.test(j)?`"${j.replace(/"/g,'""')}"`:j},s=[],a=w?.name||i?.displayName||i?.email||"Student",r=new Date().toISOString().split("T")[0];s.push("Grade Report"),s.push(`Student,${t(a)}`),s.push(`Export Date,${t(r)}`),s.push(`Subject Filter,${t(n)}`),s.push(`Type Filter,${t(x)}`),s.push(""),s.push("Subject Performance"),s.push("Subject,Average Score"),C.forEach(l=>{s.push([t(l.subject),t(l.average)].join(","))}),s.push(""),s.push("Recent Quizzes"),s.push("Title,Subject,Score,Date,Type,Status"),m.length===0?s.push("No quiz data available for the selected filters"):m.forEach(l=>{s.push([t(l.title),t(l.subject),t(l.score),t(l.date),t(l.type),t(l.status)].join(","))});const f=s.join(`
2
  `),g=new Blob([f],{type:"text/csv;charset=utf-8;"}),p=window.URL.createObjectURL(g),d=document.createElement("a"),Y=a.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";d.href=p,d.setAttribute("download",`grade-report-${Y}-${r}.csv`),document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(p)};return M?e.jsx("div",{className:"p-8 flex justify-center items-center h-full",children:e.jsx("div",{className:"w-10 h-10 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin"})}):e.jsxs("div",{className:"p-4 sm:p-6 lg:p-8 space-y-8 max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-white p-6 rounded-[2rem] shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] border border-slate-50",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-black text-slate-800 tracking-tight",children:"Assessment"}),e.jsx("p",{className:"text-slate-400 font-bold mt-1 text-[13px]",children:"Review your performance across subjects"})]}),e.jsxs("div",{className:"flex gap-3 w-full sm:w-auto",children:[e.jsxs(v,{variant:"outline",className:"flex-1 sm:flex-none border-slate-200 text-slate-500 font-bold rounded-xl h-11 px-5 hover:bg-slate-50 hover:text-slate-700",children:[e.jsx(X,{className:"w-4 h-4 mr-2 text-slate-400"}),"This Semester"]}),e.jsxs(v,{className:"flex-1 sm:flex-none bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl h-11 px-5 shadow-[0_8px_20px_-8px_rgba(79,70,229,0.5)] hover:-translate-y-0.5 transition-all",onClick:V,children:[e.jsx(te,{className:"w-4 h-4 mr-2"}),"Report"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-indigo-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-indigo-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-indigo-100 text-indigo-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(Z,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Overall GPA"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsx("h3",{className:"text-4xl font-display font-black text-slate-800",children:B})})]})]}),e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-emerald-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-emerald-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-emerald-100 text-emerald-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(z,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Average Score"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsxs("h3",{className:"text-4xl font-display font-black text-slate-800",children:[b,"%"]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_24px_-10px_rgba(0,0,0,0.05)] relative overflow-hidden group hover:border-violet-100 transition-colors",children:[e.jsx("div",{className:"absolute -right-8 -top-8 w-32 h-32 bg-violet-50 rounded-full group-hover:scale-110 transition-transform duration-500"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-14 h-14 bg-violet-100 text-violet-600 rounded-2xl flex items-center justify-center mb-6 shadow-sm",children:e.jsx(R,{className:"w-7 h-7"})}),e.jsx("p",{className:"text-slate-400 font-bold text-sm tracking-wide uppercase",children:"Quizzes Completed"}),e.jsx("div",{className:"flex items-end gap-2 mt-2",children:e.jsx("h3",{className:"text-4xl font-display font-black text-slate-800",children:U})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsx("div",{className:"lg:col-span-2",children:e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] overflow-hidden flex flex-col h-full",children:[e.jsxs("div",{className:"p-6 sm:p-8 border-b border-slate-50 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-black text-xl text-slate-800",children:"Recent Assessments"}),e.jsx("p",{className:"text-slate-400 font-bold text-[13px] mt-1",children:"Your latest quiz and practice results"})]}),e.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:n,onChange:t=>N(t.target.value),className:"appearance-none w-full pl-4 pr-10 py-2.5 border-none bg-slate-50 rounded-xl text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-[140px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Subjects"}),c.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsx(P,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]}),e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:x,onChange:t=>D(t.target.value),className:"appearance-none w-full pl-4 pr-10 py-2.5 border-none bg-slate-50 rounded-xl text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-[120px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"module",children:"Module Quiz"}),e.jsx("option",{value:"practice",children:"Practice"})]}),e.jsx(P,{className:"w-4 h-4 text-slate-400 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"})]})]})]}),e.jsx("div",{className:"overflow-x-auto flex-1 p-2",children:e.jsxs("table",{className:"w-full text-left border-separate border-spacing-y-2 px-4 sm:px-6 mb-4",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Assessment"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent min-w-[120px]",children:"Subject"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider border-b border-transparent",children:"Type"}),e.jsx("th",{className:"px-4 py-3 text-[11px] font-bold text-slate-400 uppercase tracking-wider text-right border-b border-transparent",children:"Score"})]})}),e.jsx("tbody",{children:m.length>0?m.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/70 transition-colors",children:[e.jsxs("td",{className:"px-4 py-4 rounded-l-2xl",children:[e.jsx("p",{className:"text-[14px] font-bold text-slate-800",children:t.title}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:t.date})]}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:"inline-flex flex-col gap-1 items-start",children:e.jsx("span",{className:"text-[13px] font-bold text-slate-600 truncate max-w-[140px] block",children:t.subject})})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:`inline-flex items-center px-3 py-1.5 rounded-lg text-[11px] font-bold uppercase tracking-wide ${t.type==="practice"?"bg-emerald-100/50 text-emerald-600":"bg-indigo-100/50 text-indigo-600"}`,children:t.type==="practice"?"Practice":"Quiz"})}),e.jsx("td",{className:"px-4 py-4 text-right rounded-r-2xl",children:e.jsxs("span",{className:`inline-flex items-center px-3 py-1.5 rounded-xl text-[13px] font-black ${t.score>=80?"bg-emerald-100 text-emerald-700":t.score>=60?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:[t.score,"%"]})})]},t.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:"px-6 py-16 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-full flex items-center justify-center mb-4",children:e.jsx(z,{className:"w-8 h-8 text-slate-300"})}),e.jsx("p",{className:"text-slate-500 font-bold text-sm",children:"No recent assessments match the selected filters."})]})})})})]})})]})}),e.jsxs("div",{className:"space-y-6 lg:space-y-8 flex flex-col",children:[e.jsxs("div",{className:"bg-white rounded-[2rem] border border-slate-100 p-6 sm:p-8 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)]",children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:e.jsx("h3",{className:"font-display font-black text-lg text-slate-800",children:"Subject Performance"})}),e.jsx("div",{className:"space-y-7",children:C.map((t,s)=>{const a=k[t.color]||k.slate;return e.jsxs("div",{className:"group",children:[e.jsxs("div",{className:"flex justify-between items-end mb-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-[14px] font-bold text-slate-800 flex items-center gap-2",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${a.dot} group-hover:scale-125 transition-transform`}),t.subject]}),e.jsxs("p",{className:"text-[11px] text-slate-400 font-bold ml-4 mt-0.5",children:[t.quizzes," activities"]})]}),e.jsxs("span",{className:"text-[15px] font-black text-slate-800",children:[t.average,"%"]})]}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded-full overflow-hidden shadow-inner",children:e.jsx("div",{className:`h-full rounded-full e-w ${a.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{"--w":`${Math.max(t.average,5)}%`},children:e.jsx("div",{className:"absolute inset-0 bg-white/20 w-1/2 -skew-x-12 translate-x-[-100%] group-hover:animate-[shimmer_1.5s_ease-out]"})})})]},s)})})]}),e.jsxs("div",{className:"relative bg-gradient-to-br from-indigo-600 to-violet-700 rounded-[2rem] p-6 sm:p-8 shadow-[0_12px_30px_-10px_rgba(79,70,229,0.5)] text-white overflow-hidden group",children:[e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-white/10 rounded-full blur-3xl -mt-10 -mr-10 group-hover:bg-white/20 transition-all duration-700 ease-in-out"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-indigo-400/30 rounded-full blur-2xl -mb-10 -ml-10"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("div",{className:"w-12 h-12 bg-white/10 rounded-2xl flex items-center justify-center mb-5 backdrop-blur-sm border border-white/20 shadow-sm group-hover:scale-110 transition-transform",children:e.jsx(R,{className:"w-6 h-6 text-white"})}),e.jsx("h3",{className:"text-2xl font-display font-black tracking-tight mb-2 leading-tight",children:"Keep up the momentum!"}),e.jsxs("p",{className:"text-white/80 text-[13px] font-medium leading-relaxed mb-8 max-w-[90%]",children:["You've completed ",e.jsx("span",{className:"font-black text-white",children:$.length})," activities recently. Try a practice session to boost your lowest scores."]}),e.jsx(v,{className:"w-full bg-white text-indigo-600 hover:bg-slate-50 border-0 font-black h-12 rounded-xl shadow-[0_8px_16px_rgba(0,0,0,0.15)] hover:shadow-[0_8px_24px_rgba(0,0,0,0.2)] hover:-translate-y-0.5 transition-all",children:"Start Practice Session"})]})]})]})]})]})};export{ge as default};
assets/{HeroBanner-LXU_ph73.js β†’ HeroBanner-CKiXGluA.js} RENAMED
@@ -1,5 +1,5 @@
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-CbAKGmA6.js","assets/vendor-react-B4AQeu28.js","assets/avatarData-BuQSOXo3.js"])))=>i.map(i=>d[i]);
2
- import{e as y,T as v,f as w,Q as k,j as M,m as p,A as P,B as u,y as A,Z as T,b as _,_ as E}from"./index-Cb8VeSuW.js";import{j as e,r as o}from"./vendor-react-B4AQeu28.js";import{D as V,a as Q}from"./dialog-CCp2tnRr.js";import{R as $,L as G,C as q,X as Y,Y as W,T as X,b as F}from"./vendor-charts-D8hf8tI0.js";import{collection as S,query as C,limit as L,orderBy as R,getDocs as D}from"./vendor-firebase-firestore-CH1lNiRF.js";import{X as K}from"./x-CTLBAl-n.js";import{C as z}from"./circle-alert-DgDGv7k5.js";import{C as U}from"./circle-check-CVJuYLp6.js";import{S as Z}from"./sparkles-v8V3LFaV.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-markdown-yqZQ_iQm.js";/**
3
  * @license lucide-react v0.487.0 - ISC
4
  *
5
  * This source code is licensed under the ISC license.
 
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-CbAKGmA6.js","assets/vendor-react-B4AQeu28.js","assets/avatarData-BuQSOXo3.js"])))=>i.map(i=>d[i]);
2
+ import{e as y,T as v,f as w,Q as k,j as M,m as p,A as P,B as u,y as A,Z as T,b as _,_ as E}from"./index-BaOs5Ayg.js";import{j as e,r as o}from"./vendor-react-B4AQeu28.js";import{D as V,a as Q}from"./dialog-CHtYkwVl.js";import{R as $,L as G,C as q,X as Y,Y as W,T as X,b as F}from"./vendor-charts-D8hf8tI0.js";import{collection as S,query as C,limit as L,orderBy as R,getDocs as D}from"./vendor-firebase-firestore-CH1lNiRF.js";import{X as K}from"./x-TNvtuOD9.js";import{C as z}from"./circle-alert-CP9K3300.js";import{C as U}from"./circle-check-C0FPGTrp.js";import{S as Z}from"./sparkles-By-vFjpv.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-markdown-yqZQ_iQm.js";/**
3
  * @license lucide-react v0.487.0 - ISC
4
  *
5
  * This source code is licensed under the ISC license.
assets/{InitialAssessmentModal-8dYkJoWr.js β†’ InitialAssessmentModal-CknVaqMx.js} RENAMED
@@ -1 +1 @@
1
- import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{B as j}from"./button-De2q2xHf.js";import{g as y}from"./diagnosticService-BIetid_s.js";import{updateDoc as N,doc as v,serverTimestamp as w}from"./vendor-firebase-firestore-CH1lNiRF.js";import{m as o,B as k,p as C,l as L,f as z}from"./index-Cb8VeSuW.js";import{X as S}from"./x-CTLBAl-n.js";import{C as A}from"./circle-check-big-CNGbqkWz.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";const H=({isOpen:n,onClose:d,onDismiss:m,userId:c,strand:x,gradeLevel:p,onAssessmentStart:u,onAssessmentComplete:I})=>{const[t,a]=l.useState(!1),[r,i]=l.useState(null),h=async()=>{a(!0),i(null);try{const s=await y(x,p);sessionStorage.setItem("mathpulse_diagnostic",JSON.stringify({testId:s.test_id,questions:s.questions,totalItems:s.total_items,estimatedMinutes:s.estimated_minutes})),u(s.test_id,s.questions)}catch(s){const b=s instanceof Error?s.message:"Failed to load assessment";i(b),a(!1)}},f=()=>{sessionStorage.setItem("mathpulse_iar_session_dismissed","true"),d()},g=async()=>{try{await N(v(z,"users",c),{assessmentDismissed:!0,assessmentDismissedAt:w()})}catch(s){console.error("[diagnostic] Failed to save dismiss state:",s)}m()};return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:s=>s.stopPropagation(),children:e.jsxs(o.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"bg-white rounded-2xl shadow-2xl max-w-[36rem] w-full flex flex-col overflow-hidden pointer-events-auto",onClick:s=>s.stopPropagation(),style:{willChange:"transform, opacity"},children:[e.jsxs("div",{className:"px-5 py-3 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600",children:e.jsx(k,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-[#0a1628] leading-tight",children:"Initial Assessment"}),e.jsx("p",{className:"text-[11px] text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),e.jsx("button",{onClick:f,"aria-label":"Close assessment modal",className:"ml-auto w-8 h-8 rounded-lg flex items-center justify-center text-[#5a6578] hover:bg-[#dde3eb] hover:text-[#0a1628] transition-colors",children:e.jsx(S,{size:18})})]}),e.jsx("div",{className:"p-5 text-center space-y-3",children:e.jsxs(o.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut"},children:[e.jsx("div",{className:"w-20 h-20 bg-purple-50 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx("svg",{className:"w-9 h-9 text-purple-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}),e.jsx("h3",{className:"text-lg font-bold text-[#0a1628]",children:"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[13px] text-[#5a6578] max-w-[19rem] mx-auto leading-relaxed",children:"To personalize your learning path, complete a DepEd competency-based SHS diagnostic (15 items, around 11.6 minutes)."}),e.jsxs("div",{className:"grid grid-cols-2 gap-2.5 max-w-[22rem] mx-auto text-left mt-4",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(A,{size:14,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(C,{size:14,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Spot areas that need more attention early."})]})]}),r&&e.jsx("div",{className:"mt-3 p-2.5 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("p",{className:"text-xs text-red-700",children:r})}),e.jsxs("div",{className:"pt-3 space-y-2.5",children:[e.jsx(j,{onClick:h,disabled:t,className:"bg-gradient-to-r from-purple-600 to-purple-500 hover:from-purple-700 hover:to-purple-600 text-white px-5 py-3 rounded-xl text-sm font-bold shadow-lg shadow-purple-200 w-full max-w-[320px] mx-auto",children:t?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:16,className:"animate-spin mr-2"}),"Crafting your assessment..."]}):"Start Assessment"}),t&&e.jsx("p",{className:"text-[10px] text-slate-400 max-w-[18rem] mx-auto text-center leading-relaxed",children:"This may take up to 90 seconds while AI generates your personalized test."}),!t&&e.jsx("button",{onClick:g,disabled:t,className:"block mx-auto text-xs text-slate-500 hover:text-[#5a6578] transition-colors font-medium disabled:opacity-40",children:"Skip for now"})]})]})})]})}):null};export{H as default};
 
1
+ import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{B as j}from"./button-DCfeFHoH.js";import{g as y}from"./diagnosticService-BDYTUoqk.js";import{updateDoc as N,doc as v,serverTimestamp as w}from"./vendor-firebase-firestore-CH1lNiRF.js";import{m as o,B as k,p as C,l as L,f as z}from"./index-BaOs5Ayg.js";import{X as S}from"./x-TNvtuOD9.js";import{C as A}from"./circle-check-big-m1SvzGFL.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";const H=({isOpen:n,onClose:d,onDismiss:m,userId:c,strand:x,gradeLevel:p,onAssessmentStart:u,onAssessmentComplete:I})=>{const[t,a]=l.useState(!1),[r,i]=l.useState(null),h=async()=>{a(!0),i(null);try{const s=await y(x,p);sessionStorage.setItem("mathpulse_diagnostic",JSON.stringify({testId:s.test_id,questions:s.questions,totalItems:s.total_items,estimatedMinutes:s.estimated_minutes})),u(s.test_id,s.questions)}catch(s){const b=s instanceof Error?s.message:"Failed to load assessment";i(b),a(!1)}},f=()=>{sessionStorage.setItem("mathpulse_iar_session_dismissed","true"),d()},g=async()=>{try{await N(v(z,"users",c),{assessmentDismissed:!0,assessmentDismissedAt:w()})}catch(s){console.error("[diagnostic] Failed to save dismiss state:",s)}m()};return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:s=>s.stopPropagation(),children:e.jsxs(o.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"bg-white rounded-2xl shadow-2xl max-w-[36rem] w-full flex flex-col overflow-hidden pointer-events-auto",onClick:s=>s.stopPropagation(),style:{willChange:"transform, opacity"},children:[e.jsxs("div",{className:"px-5 py-3 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600",children:e.jsx(k,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-[#0a1628] leading-tight",children:"Initial Assessment"}),e.jsx("p",{className:"text-[11px] text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),e.jsx("button",{onClick:f,"aria-label":"Close assessment modal",className:"ml-auto w-8 h-8 rounded-lg flex items-center justify-center text-[#5a6578] hover:bg-[#dde3eb] hover:text-[#0a1628] transition-colors",children:e.jsx(S,{size:18})})]}),e.jsx("div",{className:"p-5 text-center space-y-3",children:e.jsxs(o.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut"},children:[e.jsx("div",{className:"w-20 h-20 bg-purple-50 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx("svg",{className:"w-9 h-9 text-purple-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}),e.jsx("h3",{className:"text-lg font-bold text-[#0a1628]",children:"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[13px] text-[#5a6578] max-w-[19rem] mx-auto leading-relaxed",children:"To personalize your learning path, complete a DepEd competency-based SHS diagnostic (15 items, around 11.6 minutes)."}),e.jsxs("div",{className:"grid grid-cols-2 gap-2.5 max-w-[22rem] mx-auto text-left mt-4",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(A,{size:14,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(C,{size:14,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Spot areas that need more attention early."})]})]}),r&&e.jsx("div",{className:"mt-3 p-2.5 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("p",{className:"text-xs text-red-700",children:r})}),e.jsxs("div",{className:"pt-3 space-y-2.5",children:[e.jsx(j,{onClick:h,disabled:t,className:"bg-gradient-to-r from-purple-600 to-purple-500 hover:from-purple-700 hover:to-purple-600 text-white px-5 py-3 rounded-xl text-sm font-bold shadow-lg shadow-purple-200 w-full max-w-[320px] mx-auto",children:t?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:16,className:"animate-spin mr-2"}),"Crafting your assessment..."]}):"Start Assessment"}),t&&e.jsx("p",{className:"text-[10px] text-slate-400 max-w-[18rem] mx-auto text-center leading-relaxed",children:"This may take up to 90 seconds while AI generates your personalized test."}),!t&&e.jsx("button",{onClick:g,disabled:t,className:"block mx-auto text-xs text-slate-500 hover:text-[#5a6578] transition-colors font-medium disabled:opacity-40",children:"Skip for now"})]})]})})]})}):null};export{H as default};
assets/{LeaderboardPage-D1oaPEZD.js β†’ LeaderboardPage-D9eaC9ey.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{e as Y,aC as W,j as H,m as c,a as y,y as P,A as k,x as m,T as E,l as z,W as X,X as U,O as q,u as $,aD as G,R as K,L as Q,r as T}from"./index-Cb8VeSuW.js";import{X as V}from"./x-CTLBAl-n.js";import{C as Z}from"./clock-BodmJJnp.js";import{u as J}from"./useFeatureAccess-RwJxbRkp.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{e as Y,aC as W,j as H,m as c,a as y,y as P,A as k,x as m,T as E,l as z,W as X,X as U,O as q,u as $,aD as G,R as K,L as Q,r as T}from"./index-BaOs5Ayg.js";import{X as V}from"./x-TNvtuOD9.js";import{C as Z}from"./clock-D1Ecvltm.js";import{u as J}from"./useFeatureAccess-BSpfx3vY.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{LearningPath-D68qmUJi.js β†’ LearningPath-BBE0vZ0S.js} RENAMED
@@ -1 +1 @@
1
- import{r as m,d as p,j as r}from"./vendor-react-B4AQeu28.js";import{u as j,a2 as P,a3 as I,q as N,a as k,b as L}from"./index-Cb8VeSuW.js";import{M as S}from"./ModuleFolderCard-CITAgDA0.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-d2Fw9DS6.js";import"./clock-BodmJJnp.js";const V=({onNavigateToModules:c,atRiskSubjects:d=[],priorityTopics:o=[],modules:a})=>{const{userProfile:l}=j(),[u,h]=m.useState(null),i=p.useMemo(()=>{const e=o.length>0?o:d.map(s=>P(s)).filter(s=>s!==null),t=new Set;return e.filter(s=>t.has(s)?!1:(t.add(s),!0))},[o,d]),x=p.useMemo(()=>{if(i.length===0)return a.slice(0,3);const e=new Map(i.map((t,s)=>[I[t],s]));return[...a].sort((t,s)=>{const n=e.get(t.id)??Number.POSITIVE_INFINITY,b=e.get(s.id)??Number.POSITIVE_INFINITY;return n-b}).slice(0,3)},[a,i]);m.useEffect(()=>{l?.uid&&N(l.uid).then(h).catch(console.error)},[l?.uid]);const g=x.slice(0,3).map(e=>{const t=u?.subjects?.[e.subject]?.modulesProgress?.[e.id],s=e.lessons.length,n=t?.progress??(s>0?Math.round((t?.lessonsCompleted?.length||0)/s*100):0);return{...e,progress:n,status:n===100?"Completed":n>0?"In Progress":"Not Started"}}),f=g.some(e=>e.progress>0)?"Continue Learning":"Start Learning";return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-6 px-1",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:r.jsx(k,{size:20,strokeWidth:2.5})}),r.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:f})]}),r.jsxs("button",{onClick:()=>c?.(),className:"text-primary font-bold text-sm flex items-center gap-1 hover:gap-2 transition-all bg-primary/10 px-4 py-2 rounded-xl hover:bg-primary/20",children:["View All ",r.jsx(L,{size:16})]})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-6",children:g.map((e,t)=>r.jsx(S,{module:e,index:t,onClick:()=>c?.(e.id),isAtRisk:i.length>0,badgeLabel:e.status!=="Not Started"?e.status:void 0},e.id))})]})};export{V as default};
 
1
+ import{r as m,d as p,j as r}from"./vendor-react-B4AQeu28.js";import{u as j,a2 as P,a3 as I,q as N,a as k,b as L}from"./index-BaOs5Ayg.js";import{M as S}from"./ModuleFolderCard-DKBrO5a8.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-Bvu3fXaT.js";import"./clock-D1Ecvltm.js";const V=({onNavigateToModules:c,atRiskSubjects:d=[],priorityTopics:o=[],modules:a})=>{const{userProfile:l}=j(),[u,h]=m.useState(null),i=p.useMemo(()=>{const e=o.length>0?o:d.map(s=>P(s)).filter(s=>s!==null),t=new Set;return e.filter(s=>t.has(s)?!1:(t.add(s),!0))},[o,d]),x=p.useMemo(()=>{if(i.length===0)return a.slice(0,3);const e=new Map(i.map((t,s)=>[I[t],s]));return[...a].sort((t,s)=>{const n=e.get(t.id)??Number.POSITIVE_INFINITY,b=e.get(s.id)??Number.POSITIVE_INFINITY;return n-b}).slice(0,3)},[a,i]);m.useEffect(()=>{l?.uid&&N(l.uid).then(h).catch(console.error)},[l?.uid]);const g=x.slice(0,3).map(e=>{const t=u?.subjects?.[e.subject]?.modulesProgress?.[e.id],s=e.lessons.length,n=t?.progress??(s>0?Math.round((t?.lessonsCompleted?.length||0)/s*100):0);return{...e,progress:n,status:n===100?"Completed":n>0?"In Progress":"Not Started"}}),f=g.some(e=>e.progress>0)?"Continue Learning":"Start Learning";return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-6 px-1",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:r.jsx(k,{size:20,strokeWidth:2.5})}),r.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:f})]}),r.jsxs("button",{onClick:()=>c?.(),className:"text-primary font-bold text-sm flex items-center gap-1 hover:gap-2 transition-all bg-primary/10 px-4 py-2 rounded-xl hover:bg-primary/20",children:["View All ",r.jsx(L,{size:16})]})]}),r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-6",children:g.map((e,t)=>r.jsx(S,{module:e,index:t,onClick:()=>c?.(e.id),isAtRisk:i.length>0,badgeLabel:e.status!=="Not Started"?e.status:void 0},e.id))})]})};export{V as default};
assets/{LoginPage-Bo_tg2xo.js β†’ LoginPage-DLaoyzV8.js} RENAMED
@@ -1 +1 @@
1
- import{r as s,j as e}from"./vendor-react-B4AQeu28.js";import{B as Me}from"./button-De2q2xHf.js";import{I as D}from"./input-w3MoyecB.js";import{m as r,B as Ee,T as Te,A as Re,U as te,G as se,a as ae,L as re,b as ie,s as oe,c as Ce,d as le}from"./index-Cb8VeSuW.js";import{S as Ie}from"./sparkles-v8V3LFaV.js";import{M as Le}from"./mail-D1Sfp9RA.js";import{E as De,a as ze}from"./eye-DBkZRvYD.js";import{S as qe}from"./shield-check-DqJE0odB.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";const ne="/assets/shader-bg-DA7bEbBA.mp4",Be=[{id:"length",label:"At least 8 characters",test:i=>i.length>=8},{id:"upper-lower",label:"Contains uppercase and lowercase letters",test:i=>/[A-Z]/.test(i)&&/[a-z]/.test(i)},{id:"number",label:"Contains at least one number",test:i=>/\d/.test(i)},{id:"special",label:"Contains at least one special character",test:i=>/[^A-Za-z0-9]/.test(i)}],z="Use at least 8 characters with uppercase, lowercase, number, and special character.",Oe=i=>{const c=typeof i=="object"&&i!==null?i:null,o=i instanceof Error?i.message:"";if(c?.code&&typeof c.code=="string")return{code:c.code.toLowerCase(),message:o};const d=o.match(/auth\/[a-z-]+/i);return{code:d?d[0].toLowerCase():"",message:o}},_e=i=>i.replace(/^Firebase:\s*/i,"").replace(/\s*\(auth\/[a-z-]+\)\.?/i,"").trim(),ce=(i,c)=>{const{code:o,message:d}=Oe(i),h=_e(d);return o==="auth/invalid-credential"||o==="auth/wrong-password"||o==="auth/user-not-found"?"Invalid email or password. Please check your credentials and try again.":o==="auth/email-already-in-use"?"This email is already registered. Please sign in instead.":o==="auth/weak-password"||o==="auth/password-does-not-meet-requirements"?h?`Password does not meet signup requirements. ${h}`:`Password does not meet signup requirements. ${z}`:o==="auth/too-many-requests"?"Access to this account has been temporarily disabled due to many failed login attempts. You can immediately restore it by resetting your password or you can try again later.":o==="auth/network-request-failed"?"Network error. Please check your internet connection and try again.":o.startsWith("auth/")?h||c:d.includes("Firebase:")||d.includes("auth/")?c:d||c},rt=()=>{const i=["Grade 11"],c={"Grade 11":["STEM A","STEM B","ABM A","HUMSS A"]},o={teacher:["Mathematics","Science","English","Technology","Humanities"]},[d,h]=s.useState(""),[f,q]=s.useState(""),[A,de]=s.useState(!1),[l,B]=s.useState(!1),[M,ue]=s.useState(""),[n,O]=s.useState("student"),[b,me]=s.useState("Grade 11"),[w,_]=s.useState(c["Grade 11"][0]),[g,V]=s.useState("Mathematics"),[G,x]=s.useState(!1),[v,m]=s.useState(null),[pe,xe]=s.useState(!1),[ye,he]=s.useState(!1),[E,be]=s.useState(16),[F,U]=s.useState("primary"),[$,T]=s.useState(0),R=s.useRef(null),C=s.useRef(null),N=pe&&ye,j=s.useRef("primary"),k=s.useRef(0),S=s.useRef(!1),W=1.1,H=.34,Y=t=>{const a=Math.max(0,Math.min(1,t));Math.abs(k.current-a)<.02||(k.current=a,T(a))},Z=t=>{!Number.isFinite(t)||t<=0||Math.abs(E-t)>.05&&be(t)},I=s.useMemo(()=>Be.map(t=>({...t,met:t.test(f)})),[f]),fe=s.useMemo(()=>I.every(t=>t.met),[I]),J=s.useMemo(()=>{if(!l||!v)return!1;const t=v.toLowerCase();return t.includes("password requirements not met")||t.includes("password does not meet")},[v,l]),ge=()=>{const t=R.current?.duration;t&&Number.isFinite(t)&&t>0&&Z(t)},ve=()=>{const t=C.current?.duration;t&&Number.isFinite(t)&&t>0&&Z(t)};s.useEffect(()=>{if(!N)return;const t=R.current,a=C.current;if(!t||!a)return;let u=!1,p=0;j.current="primary",U("primary"),S.current=!1,k.current=0,T(0),t.loop=!1,a.loop=!1,t.currentTime=0,a.currentTime=0,a.pause(),t.play().catch(()=>{});const P=()=>{if(u)return;const y=j.current==="primary"?t:a,K=j.current==="primary"?a:t,Pe=Number.isFinite(y.duration)&&y.duration>0?y.duration:E,L=Math.max(Pe-y.currentTime,0);if(L<=W){S.current||(S.current=!0,K.currentTime=0,K.play().catch(()=>{}));const Ae=1-L/W;if(Y(Ae),L<=.03||y.ended){y.pause(),y.currentTime=0;const ee=j.current==="primary"?"secondary":"primary";j.current=ee,U(ee),S.current=!1,k.current=0,T(0)}}else Y(0);p=window.requestAnimationFrame(P)};return p=window.requestAnimationFrame(P),()=>{u=!0,p&&window.cancelAnimationFrame(p)}},[E,N]);const Q=N?H*(1-$):0,X=N?H*$:0,je=F==="primary"?Q:X,we=F==="secondary"?Q:X;s.useEffect(()=>{n==="teacher"&&!o.teacher.includes(g)&&V(o.teacher[0])},[g,n]),s.useEffect(()=>{const t=c[b]||[];t.length>0&&!t.includes(w)&&_(t[0])},[b,w]);const Ne=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:se,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:ae,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:qe,color:"rose"}],ke=async(t,a,u)=>{m(null),x(!0),h(t),q(a),O(u),B(!1);try{oe(u),await le(t,a)}catch(p){m(ce(p,"Demo sign-in failed. Please try again.")),x(!1)}},Se=async t=>{t.preventDefault(),m(null),x(!0);try{if(l){if(!M.trim()){m("Please enter your name"),x(!1);return}if(n==="student"&&!b){m("Please select a grade level"),x(!1);return}if(n!=="student"&&!g){m("Please select a department"),x(!1);return}if(n==="admin"){m("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!fe){m(`Password does not meet signup requirements. ${z}`),x(!1);return}oe(n),await Ce(d,f,M,n,n==="student"?{grade:b,section:w}:{department:g})}else await le(d,f)}catch(a){const u=l?`Sign-up failed. ${z}`:"Sign-in failed. Please check your credentials and try again.";m(ce(a,u)),x(!1)}};return e.jsxs("div",{className:"h-screen w-full flex items-center justify-center px-6 overflow-hidden relative login-bg",children:[e.jsx("video",{ref:R,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>xe(!0),onLoadedMetadata:ge,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":je},src:ne}),e.jsx("video",{ref:C,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>he(!0),onLoadedMetadata:ve,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":we},src:ne}),e.jsx("div",{className:"absolute inset-0 pointer-events-none login-frost-overlay"}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply login-orb-purple"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply login-orb-pink"}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen login-orb-blue"}),e.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[e.jsxs(r.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col justify-center space-y-8",children:[e.jsxs(r.div,{className:"flex items-center gap-2.5",children:[e.jsx(r.div,{className:"relative flex items-center justify-center drop-shadow-md",children:e.jsx("img",{src:"/mathpulse_logo.png",alt:"MathPulse AI Logo",className:"w-16 h-16 object-contain flex-shrink-0"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-black tracking-tight text-slate-900 bg-clip-text text-transparent bg-gradient-to-r from-purple-600 via-pink-600 to-sky-500",children:"MathPulse"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(Ie,{size:12,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body font-medium tracking-wide",children:"Powered by Machine Learning"})]})]})]}),e.jsxs(r.div,{className:"space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[e.jsxs("h2",{className:"text-4xl lg:text-5xl xl:text-[3.4rem] font-display font-extrabold leading-[1.1] tracking-tight text-slate-900",children:["Transform Your",e.jsx("br",{}),e.jsx("span",{className:"bg-gradient-to-r from-sky-600 via-cyan-500 to-sky-500 bg-clip-text text-transparent",children:"Math Journey"})]}),e.jsx("p",{className:"text-base text-slate-500 leading-relaxed max-w-md font-body",children:"AI-powered predictive system designed to identify at-risk students and provide personalized learning recommendations."})]}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{icon:Ee,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Te,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:Re,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,a)=>{const u=t.icon,p={sky:"border-sky-200/60 hover:border-sky-300",rose:"border-rose-200/60 hover:border-rose-300",emerald:"border-emerald-200/60 hover:border-emerald-300"},P={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},y={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(r.div,{className:`bg-white/80 backdrop-blur-xl border ${p[t.color]} rounded-xl p-4 transition-all cursor-pointer group shadow-md shadow-slate-900/[0.04]`,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5+a*.1},whileHover:{scale:1.03,y:-4},children:[e.jsx("div",{className:`w-9 h-9 rounded-lg ${y[t.color]} flex items-center justify-center mb-3`,children:e.jsx(u,{size:18,className:P[t.color]})}),e.jsx("h3",{className:"text-sm font-display font-semibold text-slate-800 mb-0.5",children:t.label}),e.jsx("p",{className:"text-xs text-slate-400 font-body",children:t.desc})]},a)})})]}),e.jsx(r.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,delay:.15,ease:[.22,1,.36,1]},className:"relative flex justify-center lg:justify-end",children:e.jsxs("div",{className:"bg-white/85 backdrop-blur-2xl border border-slate-200/60 rounded-3xl p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)]",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-gradient-to-r from-purple-500 via-pink-500 to-sky-500"}),e.jsx("div",{className:"absolute -top-40 left-1/2 -translate-x-1/2 w-80 h-80 bg-gradient-to-br from-purple-400/20 to-pink-400/20 rounded-full blur-[60px] pointer-events-none"}),e.jsxs("div",{className:"text-center mb-6 relative",children:[e.jsx(r.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:l?"Create Account":"Welcome Back"}),e.jsx(r.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:l?"Begin your learning journey":"Sign in to continue learning"})]}),e.jsxs("form",{onSubmit:Se,className:"space-y-4 mb-5 relative",children:[v&&!J&&e.jsx(r.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"bg-rose-50 border border-rose-200 text-rose-600 px-4 py-3 rounded-lg text-sm font-body",children:v}),l&&e.jsxs(r.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx(te,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:"text",placeholder:"Your Name",value:M,onChange:t=>ue(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),l&&e.jsxs(r.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.45},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Account Type"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{role:"student",label:"Student"},{role:"teacher",label:"Teacher"}].map(t=>{const a=n===t.role;return e.jsx("button",{type:"button",onClick:()=>O(t.role),className:`rounded-lg border px-3 py-2 text-xs font-body font-semibold transition-all ${a?"border-sky-400 bg-sky-50 text-sky-700":"border-slate-200 bg-slate-50 text-slate-500 hover:border-slate-300"}`,children:t.label},t.role)})})]}),l&&n==="student"&&e.jsxs(r.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Grade Level"}),e.jsxs("div",{className:"relative",children:[e.jsx(se,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:b,onChange:t=>me(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:i.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),l&&n==="student"&&e.jsxs(r.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Section"}),e.jsxs("div",{className:"relative",children:[e.jsx(te,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:w,onChange:t=>_(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:(c[b]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),l&&n!=="student"&&e.jsxs(r.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Department"}),e.jsxs("div",{className:"relative",children:[e.jsx(ae,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:g,onChange:t=>V(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:o.teacher.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),e.jsxs(r.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.5},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(Le,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:"email",placeholder:"your.email@school.edu",value:d,onChange:t=>h(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),e.jsxs(r.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.6},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:A?"text":"password",placeholder:"β€’β€’β€’β€’β€’β€’β€’β€’",value:f,onChange:t=>q(t.target.value),className:"w-full pl-11 pr-11 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0,minLength:l?8:6}),e.jsx(r.button,{type:"button",onClick:()=>de(!A),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:A?e.jsx(De,{size:16}):e.jsx(ze,{size:16})})]}),l&&e.jsxs("div",{className:"mt-2 rounded-lg border border-sky-100/80 bg-sky-50/70 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] font-body font-semibold uppercase tracking-wider text-slate-600",children:"Password requirements"}),e.jsx("ul",{className:"mt-2 space-y-1",children:I.map(t=>e.jsxs("li",{className:`flex items-center gap-2 text-[11px] font-body ${t.met?"text-emerald-700":"text-slate-500"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${t.met?"bg-emerald-500":"bg-slate-300"}`}),e.jsx("span",{children:t.label})]},t.id))}),J&&e.jsx("p",{className:"mt-2 text-[11px] font-body font-semibold text-rose-600",children:"Password does not meet signup requirements."})]})]}),e.jsx(r.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(Me,{type:"submit",disabled:G,className:"w-full bg-gradient-to-r from-purple-600 to-pink-500 hover:from-purple-500 hover:to-pink-400 text-white font-body font-semibold py-3 rounded-xl shadow-lg shadow-purple-600/25 hover:shadow-pink-500/35 hover:scale-[1.02] transition-all text-sm group relative overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(r.span,{className:"absolute inset-0 bg-gradient-to-r from-white/0 via-white/15 to-white/0",animate:{x:["-100%","100%"]},transition:{duration:3,repeat:1/0,repeatDelay:2}}),e.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[G?"Please wait...":l?"Create Account":"Sign In",e.jsx(ie,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{B(!l),m(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:l?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!l&&e.jsxs(r.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.85},className:"mb-4 relative",children:[e.jsxs("div",{className:"relative flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex-1 h-px bg-slate-200"}),e.jsx("span",{className:"text-[10px] font-body font-semibold text-slate-400 uppercase tracking-widest",children:"Quick Demo Access"}),e.jsx("div",{className:"flex-1 h-px bg-slate-200"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:Ne.map(t=>{const a=t.icon,u={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},p={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return e.jsxs(r.button,{type:"button",onClick:()=>ke(t.email,t.password,t.role),className:"group flex items-center gap-3 w-full px-4 py-2.5 rounded-lg bg-slate-50/80 border border-slate-200/70 hover:border-sky-300 hover:bg-sky-50/80 hover:shadow-sm transition-all text-left",whileHover:{scale:1.01},whileTap:{scale:.99},children:[e.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center shrink-0 ${u[t.color]}`,children:e.jsx(a,{size:15,className:p[t.color]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-xs font-body font-semibold text-slate-700 group-hover:text-sky-600 transition-colors",children:[t.label," Account"]}),e.jsx("p",{className:"text-[10px] text-slate-400 font-body truncate",children:t.email})]}),e.jsx(ie,{size:14,className:"text-slate-300 group-hover:text-sky-500 group-hover:translate-x-0.5 transition-all shrink-0"})]},t.label)})})]}),e.jsxs(r.p,{className:"text-xs text-slate-400 text-center mt-4 font-body relative",initial:{opacity:0},animate:{opacity:1},transition:{delay:1},children:[e.jsx(re,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{rt as default};
 
1
+ import{r as s,j as e}from"./vendor-react-B4AQeu28.js";import{B as Me}from"./button-DCfeFHoH.js";import{I as D}from"./input-D28h_UTJ.js";import{m as r,B as Ee,T as Te,A as Re,U as te,G as se,a as ae,L as re,b as ie,s as oe,c as Ce,d as le}from"./index-BaOs5Ayg.js";import{S as Ie}from"./sparkles-By-vFjpv.js";import{M as Le}from"./mail-BbG1phxL.js";import{E as De,a as ze}from"./eye-Ig3S6mOs.js";import{S as qe}from"./shield-check-Dgisjfmb.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";const ne="/assets/shader-bg-DA7bEbBA.mp4",Be=[{id:"length",label:"At least 8 characters",test:i=>i.length>=8},{id:"upper-lower",label:"Contains uppercase and lowercase letters",test:i=>/[A-Z]/.test(i)&&/[a-z]/.test(i)},{id:"number",label:"Contains at least one number",test:i=>/\d/.test(i)},{id:"special",label:"Contains at least one special character",test:i=>/[^A-Za-z0-9]/.test(i)}],z="Use at least 8 characters with uppercase, lowercase, number, and special character.",Oe=i=>{const c=typeof i=="object"&&i!==null?i:null,o=i instanceof Error?i.message:"";if(c?.code&&typeof c.code=="string")return{code:c.code.toLowerCase(),message:o};const d=o.match(/auth\/[a-z-]+/i);return{code:d?d[0].toLowerCase():"",message:o}},_e=i=>i.replace(/^Firebase:\s*/i,"").replace(/\s*\(auth\/[a-z-]+\)\.?/i,"").trim(),ce=(i,c)=>{const{code:o,message:d}=Oe(i),h=_e(d);return o==="auth/invalid-credential"||o==="auth/wrong-password"||o==="auth/user-not-found"?"Invalid email or password. Please check your credentials and try again.":o==="auth/email-already-in-use"?"This email is already registered. Please sign in instead.":o==="auth/weak-password"||o==="auth/password-does-not-meet-requirements"?h?`Password does not meet signup requirements. ${h}`:`Password does not meet signup requirements. ${z}`:o==="auth/too-many-requests"?"Access to this account has been temporarily disabled due to many failed login attempts. You can immediately restore it by resetting your password or you can try again later.":o==="auth/network-request-failed"?"Network error. Please check your internet connection and try again.":o.startsWith("auth/")?h||c:d.includes("Firebase:")||d.includes("auth/")?c:d||c},rt=()=>{const i=["Grade 11"],c={"Grade 11":["STEM A","STEM B","ABM A","HUMSS A"]},o={teacher:["Mathematics","Science","English","Technology","Humanities"]},[d,h]=s.useState(""),[f,q]=s.useState(""),[A,de]=s.useState(!1),[l,B]=s.useState(!1),[M,ue]=s.useState(""),[n,O]=s.useState("student"),[b,me]=s.useState("Grade 11"),[w,_]=s.useState(c["Grade 11"][0]),[g,V]=s.useState("Mathematics"),[G,x]=s.useState(!1),[v,m]=s.useState(null),[pe,xe]=s.useState(!1),[ye,he]=s.useState(!1),[E,be]=s.useState(16),[F,U]=s.useState("primary"),[$,T]=s.useState(0),R=s.useRef(null),C=s.useRef(null),N=pe&&ye,j=s.useRef("primary"),k=s.useRef(0),S=s.useRef(!1),W=1.1,H=.34,Y=t=>{const a=Math.max(0,Math.min(1,t));Math.abs(k.current-a)<.02||(k.current=a,T(a))},Z=t=>{!Number.isFinite(t)||t<=0||Math.abs(E-t)>.05&&be(t)},I=s.useMemo(()=>Be.map(t=>({...t,met:t.test(f)})),[f]),fe=s.useMemo(()=>I.every(t=>t.met),[I]),J=s.useMemo(()=>{if(!l||!v)return!1;const t=v.toLowerCase();return t.includes("password requirements not met")||t.includes("password does not meet")},[v,l]),ge=()=>{const t=R.current?.duration;t&&Number.isFinite(t)&&t>0&&Z(t)},ve=()=>{const t=C.current?.duration;t&&Number.isFinite(t)&&t>0&&Z(t)};s.useEffect(()=>{if(!N)return;const t=R.current,a=C.current;if(!t||!a)return;let u=!1,p=0;j.current="primary",U("primary"),S.current=!1,k.current=0,T(0),t.loop=!1,a.loop=!1,t.currentTime=0,a.currentTime=0,a.pause(),t.play().catch(()=>{});const P=()=>{if(u)return;const y=j.current==="primary"?t:a,K=j.current==="primary"?a:t,Pe=Number.isFinite(y.duration)&&y.duration>0?y.duration:E,L=Math.max(Pe-y.currentTime,0);if(L<=W){S.current||(S.current=!0,K.currentTime=0,K.play().catch(()=>{}));const Ae=1-L/W;if(Y(Ae),L<=.03||y.ended){y.pause(),y.currentTime=0;const ee=j.current==="primary"?"secondary":"primary";j.current=ee,U(ee),S.current=!1,k.current=0,T(0)}}else Y(0);p=window.requestAnimationFrame(P)};return p=window.requestAnimationFrame(P),()=>{u=!0,p&&window.cancelAnimationFrame(p)}},[E,N]);const Q=N?H*(1-$):0,X=N?H*$:0,je=F==="primary"?Q:X,we=F==="secondary"?Q:X;s.useEffect(()=>{n==="teacher"&&!o.teacher.includes(g)&&V(o.teacher[0])},[g,n]),s.useEffect(()=>{const t=c[b]||[];t.length>0&&!t.includes(w)&&_(t[0])},[b,w]);const Ne=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:se,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:ae,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:qe,color:"rose"}],ke=async(t,a,u)=>{m(null),x(!0),h(t),q(a),O(u),B(!1);try{oe(u),await le(t,a)}catch(p){m(ce(p,"Demo sign-in failed. Please try again.")),x(!1)}},Se=async t=>{t.preventDefault(),m(null),x(!0);try{if(l){if(!M.trim()){m("Please enter your name"),x(!1);return}if(n==="student"&&!b){m("Please select a grade level"),x(!1);return}if(n!=="student"&&!g){m("Please select a department"),x(!1);return}if(n==="admin"){m("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!fe){m(`Password does not meet signup requirements. ${z}`),x(!1);return}oe(n),await Ce(d,f,M,n,n==="student"?{grade:b,section:w}:{department:g})}else await le(d,f)}catch(a){const u=l?`Sign-up failed. ${z}`:"Sign-in failed. Please check your credentials and try again.";m(ce(a,u)),x(!1)}};return e.jsxs("div",{className:"h-screen w-full flex items-center justify-center px-6 overflow-hidden relative login-bg",children:[e.jsx("video",{ref:R,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>xe(!0),onLoadedMetadata:ge,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":je},src:ne}),e.jsx("video",{ref:C,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>he(!0),onLoadedMetadata:ve,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":we},src:ne}),e.jsx("div",{className:"absolute inset-0 pointer-events-none login-frost-overlay"}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply login-orb-purple"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply login-orb-pink"}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen login-orb-blue"}),e.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[e.jsxs(r.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col justify-center space-y-8",children:[e.jsxs(r.div,{className:"flex items-center gap-2.5",children:[e.jsx(r.div,{className:"relative flex items-center justify-center drop-shadow-md",children:e.jsx("img",{src:"/mathpulse_logo.png",alt:"MathPulse AI Logo",className:"w-16 h-16 object-contain flex-shrink-0"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-black tracking-tight text-slate-900 bg-clip-text text-transparent bg-gradient-to-r from-purple-600 via-pink-600 to-sky-500",children:"MathPulse"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(Ie,{size:12,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body font-medium tracking-wide",children:"Powered by Machine Learning"})]})]})]}),e.jsxs(r.div,{className:"space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[e.jsxs("h2",{className:"text-4xl lg:text-5xl xl:text-[3.4rem] font-display font-extrabold leading-[1.1] tracking-tight text-slate-900",children:["Transform Your",e.jsx("br",{}),e.jsx("span",{className:"bg-gradient-to-r from-sky-600 via-cyan-500 to-sky-500 bg-clip-text text-transparent",children:"Math Journey"})]}),e.jsx("p",{className:"text-base text-slate-500 leading-relaxed max-w-md font-body",children:"AI-powered predictive system designed to identify at-risk students and provide personalized learning recommendations."})]}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{icon:Ee,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Te,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:Re,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,a)=>{const u=t.icon,p={sky:"border-sky-200/60 hover:border-sky-300",rose:"border-rose-200/60 hover:border-rose-300",emerald:"border-emerald-200/60 hover:border-emerald-300"},P={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},y={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(r.div,{className:`bg-white/80 backdrop-blur-xl border ${p[t.color]} rounded-xl p-4 transition-all cursor-pointer group shadow-md shadow-slate-900/[0.04]`,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5+a*.1},whileHover:{scale:1.03,y:-4},children:[e.jsx("div",{className:`w-9 h-9 rounded-lg ${y[t.color]} flex items-center justify-center mb-3`,children:e.jsx(u,{size:18,className:P[t.color]})}),e.jsx("h3",{className:"text-sm font-display font-semibold text-slate-800 mb-0.5",children:t.label}),e.jsx("p",{className:"text-xs text-slate-400 font-body",children:t.desc})]},a)})})]}),e.jsx(r.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.8,delay:.15,ease:[.22,1,.36,1]},className:"relative flex justify-center lg:justify-end",children:e.jsxs("div",{className:"bg-white/85 backdrop-blur-2xl border border-slate-200/60 rounded-3xl p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)]",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-gradient-to-r from-purple-500 via-pink-500 to-sky-500"}),e.jsx("div",{className:"absolute -top-40 left-1/2 -translate-x-1/2 w-80 h-80 bg-gradient-to-br from-purple-400/20 to-pink-400/20 rounded-full blur-[60px] pointer-events-none"}),e.jsxs("div",{className:"text-center mb-6 relative",children:[e.jsx(r.h3,{className:"text-2xl font-display font-bold text-slate-900 mb-2",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:l?"Create Account":"Welcome Back"}),e.jsx(r.p,{className:"text-sm text-slate-500 font-body",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:l?"Begin your learning journey":"Sign in to continue learning"})]}),e.jsxs("form",{onSubmit:Se,className:"space-y-4 mb-5 relative",children:[v&&!J&&e.jsx(r.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"bg-rose-50 border border-rose-200 text-rose-600 px-4 py-3 rounded-lg text-sm font-body",children:v}),l&&e.jsxs(r.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Full Name"}),e.jsxs("div",{className:"relative",children:[e.jsx(te,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:"text",placeholder:"Your Name",value:M,onChange:t=>ue(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),l&&e.jsxs(r.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.45},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Account Type"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{role:"student",label:"Student"},{role:"teacher",label:"Teacher"}].map(t=>{const a=n===t.role;return e.jsx("button",{type:"button",onClick:()=>O(t.role),className:`rounded-lg border px-3 py-2 text-xs font-body font-semibold transition-all ${a?"border-sky-400 bg-sky-50 text-sky-700":"border-slate-200 bg-slate-50 text-slate-500 hover:border-slate-300"}`,children:t.label},t.role)})})]}),l&&n==="student"&&e.jsxs(r.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Grade Level"}),e.jsxs("div",{className:"relative",children:[e.jsx(se,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:b,onChange:t=>me(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:i.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),l&&n==="student"&&e.jsxs(r.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Section"}),e.jsxs("div",{className:"relative",children:[e.jsx(te,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:w,onChange:t=>_(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:(c[b]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),l&&n!=="student"&&e.jsxs(r.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Department"}),e.jsxs("div",{className:"relative",children:[e.jsx(ae,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:g,onChange:t=>V(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border border-slate-200/80 text-slate-900 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all appearance-none",required:!0,children:o.teacher.map(t=>e.jsx("option",{value:t,children:t},t))})]})]}),e.jsxs(r.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.5},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Email Address"}),e.jsxs("div",{className:"relative",children:[e.jsx(Le,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:"email",placeholder:"your.email@school.edu",value:d,onChange:t=>h(t.target.value),className:"w-full pl-11 pr-4 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0})]})]}),e.jsxs(r.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.6},children:[e.jsx("label",{className:"block text-xs font-body font-semibold text-slate-500 mb-2 uppercase tracking-wider",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(D,{type:A?"text":"password",placeholder:"β€’β€’β€’β€’β€’β€’β€’β€’",value:f,onChange:t=>q(t.target.value),className:"w-full pl-11 pr-11 py-3 rounded-lg bg-slate-100/70 border-slate-200/80 text-slate-900 placeholder:text-slate-400 focus:border-sky-400 focus:ring-2 focus:ring-sky-400/20 focus:bg-white text-sm font-body transition-all",required:!0,minLength:l?8:6}),e.jsx(r.button,{type:"button",onClick:()=>de(!A),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:A?e.jsx(De,{size:16}):e.jsx(ze,{size:16})})]}),l&&e.jsxs("div",{className:"mt-2 rounded-lg border border-sky-100/80 bg-sky-50/70 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] font-body font-semibold uppercase tracking-wider text-slate-600",children:"Password requirements"}),e.jsx("ul",{className:"mt-2 space-y-1",children:I.map(t=>e.jsxs("li",{className:`flex items-center gap-2 text-[11px] font-body ${t.met?"text-emerald-700":"text-slate-500"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${t.met?"bg-emerald-500":"bg-slate-300"}`}),e.jsx("span",{children:t.label})]},t.id))}),J&&e.jsx("p",{className:"mt-2 text-[11px] font-body font-semibold text-rose-600",children:"Password does not meet signup requirements."})]})]}),e.jsx(r.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(Me,{type:"submit",disabled:G,className:"w-full bg-gradient-to-r from-purple-600 to-pink-500 hover:from-purple-500 hover:to-pink-400 text-white font-body font-semibold py-3 rounded-xl shadow-lg shadow-purple-600/25 hover:shadow-pink-500/35 hover:scale-[1.02] transition-all text-sm group relative overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(r.span,{className:"absolute inset-0 bg-gradient-to-r from-white/0 via-white/15 to-white/0",animate:{x:["-100%","100%"]},transition:{duration:3,repeat:1/0,repeatDelay:2}}),e.jsxs("span",{className:"relative flex items-center justify-center gap-2",children:[G?"Please wait...":l?"Create Account":"Sign In",e.jsx(ie,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{B(!l),m(null)},className:"text-sm text-slate-400 hover:text-sky-500 font-body font-medium transition-colors",children:l?"Already have an account? Sign in":"Don't have an account? Create one"})})]}),!l&&e.jsxs(r.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.85},className:"mb-4 relative",children:[e.jsxs("div",{className:"relative flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"flex-1 h-px bg-slate-200"}),e.jsx("span",{className:"text-[10px] font-body font-semibold text-slate-400 uppercase tracking-widest",children:"Quick Demo Access"}),e.jsx("div",{className:"flex-1 h-px bg-slate-200"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:Ne.map(t=>{const a=t.icon,u={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},p={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return e.jsxs(r.button,{type:"button",onClick:()=>ke(t.email,t.password,t.role),className:"group flex items-center gap-3 w-full px-4 py-2.5 rounded-lg bg-slate-50/80 border border-slate-200/70 hover:border-sky-300 hover:bg-sky-50/80 hover:shadow-sm transition-all text-left",whileHover:{scale:1.01},whileTap:{scale:.99},children:[e.jsx("div",{className:`w-8 h-8 rounded-md flex items-center justify-center shrink-0 ${u[t.color]}`,children:e.jsx(a,{size:15,className:p[t.color]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-xs font-body font-semibold text-slate-700 group-hover:text-sky-600 transition-colors",children:[t.label," Account"]}),e.jsx("p",{className:"text-[10px] text-slate-400 font-body truncate",children:t.email})]}),e.jsx(ie,{size:14,className:"text-slate-300 group-hover:text-sky-500 group-hover:translate-x-0.5 transition-all shrink-0"})]},t.label)})})]}),e.jsxs(r.p,{className:"text-xs text-slate-400 text-center mt-4 font-body relative",initial:{opacity:0},animate:{opacity:1},transition:{delay:1},children:[e.jsx(re,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{rt as default};
assets/{LogoutActionButton-Cb7v3MhK.js β†’ LogoutActionButton-lUNItet6.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as a,m as s,i}from"./index-Cb8VeSuW.js";import{j as t}from"./vendor-react-B4AQeu28.js";import{L as l}from"./log-out-CM6AS10M.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as a,m as s,i}from"./index-BaOs5Ayg.js";import{j as t}from"./vendor-react-B4AQeu28.js";import{L as l}from"./log-out-BenDMDly.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{ModuleFolderCard-CITAgDA0.js β†’ ModuleFolderCard-DKBrO5a8.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{j as e}from"./vendor-react-B4AQeu28.js";import{u as g}from"./useSubjectAvailability-d2Fw9DS6.js";import{e as w,m as f,a as j,p as v,L as k}from"./index-Cb8VeSuW.js";import{C as y}from"./clock-BodmJJnp.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{j as e}from"./vendor-react-B4AQeu28.js";import{u as g}from"./useSubjectAvailability-Bvu3fXaT.js";import{e as w,m as f,a as j,p as v,L as k}from"./index-BaOs5Ayg.js";import{C as y}from"./clock-D1Ecvltm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{ModulesPage-yaDxw1Cj.js β†’ ModulesPage-cZJm_yoJ.js} RENAMED
@@ -1,5 +1,5 @@
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-auth-BLpRW_zO.js","assets/vendor-firebase-core-CO26nNq6.js"])))=>i.map(i=>d[i]);
2
- import{r as s,j as e,b as ut,d as Ae}from"./vendor-react-B4AQeu28.js";import{u as Gs}from"./useQuery-PwtHq3dz.js";import{getDoc as qt,doc as bt,onSnapshot as Gt,runTransaction as Vs,serverTimestamp as Ys,query as Ks,where as Zs,collection as Js}from"./vendor-firebase-firestore-CH1lNiRF.js";import{e as ie,m as v,Z as Re,C as mt,j as $e,O as As,M as ea,b as pt,T as Pt,y as qe,X as Es,R as Ps,x as Ct,_ as Lt,B as ns,F as ta,u as Ft,A as It,a as Je,i as At,p as Ts,n as sa,a4 as is,a5 as aa,a6 as os,a7 as ra,a8 as la,L as Vt,f as We,q as na,a9 as ia,aa as oa,ab as Ls,ac as ca,ad as da,ae as xa,a2 as ma,o as ua,af as cs,ag as pa,ah as ds,G as ha,a1 as fa,t as Bt,a3 as ba}from"./index-Cb8VeSuW.js";import{M as Wt}from"./ModuleFolderCard-CITAgDA0.js";import{B as ze}from"./button-De2q2xHf.js";import Fs from"./ScientificCalculator-CLmkIayw.js";import{C as lt}from"./check-DSwzaW4Y.js";import{X as De}from"./x-CTLBAl-n.js";import{V as Is,a as Ds,M as Rs,b as $s}from"./volume-x-BMxXZeNg.js";import{C as Yt}from"./chevron-left-CZaM7nZW.js";import{C as ht}from"./chevron-right-CoVWpXdD.js";import{C as ga}from"./circle-help-hn0lWYq9.js";import{S as xs,b as wa,L as ya}from"./quizService-CJqOfhFJ.js";import{L as Kt,C as Ht}from"./lightbulb-BjBRtEjU.js";import{logLessonView as ja}from"./trackingService-uiTTm34h.js";import{C as ft}from"./clock-BodmJJnp.js";import{C as Bs}from"./clipboard-check-BEObtDZM.js";import{C as zt}from"./circle-check-big-CNGbqkWz.js";import{s as Tt}from"./subjects-Bnu0lJdU.js";import{C as va}from"./circle-check-CVJuYLp6.js";import{triggerQuizSubmitted as Na}from"./automationService-BxQhaGqB.js";import ms from"./confetti.module-C94ZD2ww.js";import{u as ka}from"./useCurriculum-B8pRV6G_.js";import{S as Sa}from"./search-CMbwAzt9.js";import{F as Ca}from"./funnel-D-s_ygM_.js";import{S as za}from"./sparkles-v8V3LFaV.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-d2Fw9DS6.js";import"./chevron-up-Byo9SJJ4.js";import"./chart-column-CmH46HAG.js";/**
3
  * @license lucide-react v0.487.0 - ISC
4
  *
5
  * This source code is licensed under the ISC license.
 
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-auth-BLpRW_zO.js","assets/vendor-firebase-core-CO26nNq6.js"])))=>i.map(i=>d[i]);
2
+ import{r as s,j as e,b as ut,d as Ae}from"./vendor-react-B4AQeu28.js";import{u as Gs}from"./useQuery-BnRttv09.js";import{getDoc as qt,doc as bt,onSnapshot as Gt,runTransaction as Vs,serverTimestamp as Ys,query as Ks,where as Zs,collection as Js}from"./vendor-firebase-firestore-CH1lNiRF.js";import{e as ie,m as v,Z as Re,C as mt,j as $e,O as As,M as ea,b as pt,T as Pt,y as qe,X as Es,R as Ps,x as Ct,_ as Lt,B as ns,F as ta,u as Ft,A as It,a as Je,i as At,p as Ts,n as sa,a4 as is,a5 as aa,a6 as os,a7 as ra,a8 as la,L as Vt,f as We,q as na,a9 as ia,aa as oa,ab as Ls,ac as ca,ad as da,ae as xa,a2 as ma,o as ua,af as cs,ag as pa,ah as ds,G as ha,a1 as fa,t as Bt,a3 as ba}from"./index-BaOs5Ayg.js";import{M as Wt}from"./ModuleFolderCard-DKBrO5a8.js";import{B as ze}from"./button-DCfeFHoH.js";import Fs from"./ScientificCalculator-DRuSfTXj.js";import{C as lt}from"./check-BLSo9L0H.js";import{X as De}from"./x-TNvtuOD9.js";import{V as Is,a as Ds,M as Rs,b as $s}from"./volume-x-Chtf_bSj.js";import{C as Yt}from"./chevron-left-BWpgclqc.js";import{C as ht}from"./chevron-right-COqGruhh.js";import{C as ga}from"./circle-help-B8apTIdU.js";import{S as xs,b as wa,L as ya}from"./quizService-8JHQlvu9.js";import{L as Kt,C as Ht}from"./lightbulb-Ce2KQzGM.js";import{logLessonView as ja}from"./trackingService-DQ12buWG.js";import{C as ft}from"./clock-D1Ecvltm.js";import{C as Bs}from"./clipboard-check-DqBu2Pqb.js";import{C as zt}from"./circle-check-big-m1SvzGFL.js";import{s as Tt}from"./subjects-BFghB0SQ.js";import{C as va}from"./circle-check-C0FPGTrp.js";import{triggerQuizSubmitted as Na}from"./automationService-7m3RFJA3.js";import ms from"./confetti.module-C94ZD2ww.js";import{u as ka}from"./useCurriculum-DDCuCvMR.js";import{S as Sa}from"./search-Bq99THgc.js";import{F as Ca}from"./funnel-BT77sgnz.js";import{S as za}from"./sparkles-By-vFjpv.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-Bvu3fXaT.js";import"./chevron-up-Cdvz2TMJ.js";import"./chart-column-B3jJOD5i.js";/**
3
  * @license lucide-react v0.487.0 - ISC
4
  *
5
  * This source code is licensed under the ISC license.
assets/{ProfileModal-BYEUqArA.js β†’ ProfileModal-Gwxh5tYO.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as c}from"./button-De2q2xHf.js";import{I as d}from"./input-w3MoyecB.js";import{S as _,a as R,c as U,d as h}from"./select-CqJdJ0KN.js";import{e as S,j as D,m as k,U as u,A as x,a as w,z as B,aM as T,aD as q,aO as G}from"./index-Cb8VeSuW.js";import{P as V,M as z,V as C}from"./ProfilePictureUploader-viKg_Exm.js";import{X}from"./x-CTLBAl-n.js";import{M as Y}from"./mail-D1Sfp9RA.js";import{C as L}from"./circle-help-hn0lWYq9.js";import{S as $}from"./save-CpWDoSfX.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./chevron-up-Byo9SJJ4.js";import"./check-DSwzaW4Y.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";import"./minus-CMQilTBg.js";import"./plus-uFWGSQCY.js";import"./upload-D5cppfxb.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as c}from"./button-DCfeFHoH.js";import{I as d}from"./input-D28h_UTJ.js";import{S as _,a as R,c as U,d as h}from"./select-DIjxRWza.js";import{e as S,j as D,m as k,U as u,A as x,a as w,z as B,aM as T,aD as q,aO as G}from"./index-BaOs5Ayg.js";import{P as V,M as z,V as C}from"./ProfilePictureUploader-CX_IZAwE.js";import{X}from"./x-TNvtuOD9.js";import{M as Y}from"./mail-BbG1phxL.js";import{C as L}from"./circle-help-B8apTIdU.js";import{S as $}from"./save-CQIJrhLf.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./chevron-up-Cdvz2TMJ.js";import"./check-BLSo9L0H.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-markdown-yqZQ_iQm.js";import"./minus-DfrEv-SC.js";import"./plus-DkG35AoH.js";import"./upload-DayXhGwD.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{ProfilePictureUploader-viKg_Exm.js β†’ ProfilePictureUploader-CX_IZAwE.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as X,i as B,F as V,aQ as ve,aR as ge,u as we,J as xe,K as ye,N as be,j as Ce,m as K,t as J}from"./index-Cb8VeSuW.js";import{g as Pe,r as g,j as p}from"./vendor-react-B4AQeu28.js";import{_ as Re,p as b,q as Ee,r as Se,s as _e,t as ze}from"./vendor-radix-BorKzPz9.js";import{B as Q}from"./button-De2q2xHf.js";import{updateProfile as De}from"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-core-CO26nNq6.js";import{r as Me,u as Ae,a as Ne}from"./vendor-firebase-storage-B3igpVVS.js";import{X as Te}from"./x-CTLBAl-n.js";import{M as je}from"./minus-CMQilTBg.js";import{P as Ue}from"./plus-uFWGSQCY.js";import{U as Fe}from"./upload-D5cppfxb.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as X,i as B,F as V,aZ as ve,a_ as ge,u as we,J as xe,K as ye,N as be,j as Ce,m as K,t as J}from"./index-BaOs5Ayg.js";import{g as Pe,r as g,j as p}from"./vendor-react-B4AQeu28.js";import{_ as Re,p as b,q as Ee,r as Se,s as _e,t as ze}from"./vendor-radix-BorKzPz9.js";import{B as Q}from"./button-DCfeFHoH.js";import{updateProfile as De}from"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-core-CO26nNq6.js";import{r as Me,u as Ae,a as Ne}from"./vendor-firebase-storage-B3igpVVS.js";import{X as Te}from"./x-TNvtuOD9.js";import{M as je}from"./minus-DfrEv-SC.js";import{P as Ue}from"./plus-DkG35AoH.js";import{U as Fe}from"./upload-DayXhGwD.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{QuizBattlePage-Bsec_0MM.js β†’ QuizBattlePage-Bwu0snEF.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as Et,i as x,m as y,f as tt,aE as De,F as rt,aF as Q,O as Va,y as Ct,M as Wa,w as Pe,U as ve,j as Ke,l as Je,u as Ua,_ as Ya,P as wt,X as vt,x as jt,W as Xa}from"./index-Cb8VeSuW.js";import{r as i,j as e,d as Rt}from"./vendor-react-B4AQeu28.js";import{q as yt}from"./quiz_battle_avatar-BXHPSput.js";import{g as Ga,s as ea}from"./subjects-Bnu0lJdU.js";import{doc as Za,getDoc as Ka,where as ta,orderBy as pa,limit as zt,getDocs as It,query as Mt,collection as Bt}from"./vendor-firebase-firestore-CH1lNiRF.js";import{$ as q,a0 as ha,a1 as ba,a2 as Ie,a3 as Ja}from"./vendor-firebase-core-CO26nNq6.js";import{B as A}from"./button-De2q2xHf.js";import{a as te,b as le,c as ie,e as pe,d as ge,C as aa}from"./card-DXoGKpl1.js";import{f as es,g as ts}from"./vendor-radix-BorKzPz9.js";import{S as _e,a as Se,b as Ae,c as Ce,d as J}from"./select-CqJdJ0KN.js";import{I as as}from"./input-w3MoyecB.js";import{S as sa}from"./switch-KjWJg4zs.js";import{S as we}from"./skeleton-Bue6-H9w.js";import{V as fa,a as ga,M as ss,b as rs}from"./volume-x-BMxXZeNg.js";import{C as ns}from"./CompositeAvatar-Col05lJc.js";import{S as et}from"./sparkles-v8V3LFaV.js";import{C as kt}from"./check-DSwzaW4Y.js";import{C as Ye}from"./chevron-right-CoVWpXdD.js";import{S as os}from"./shield-check-DqJE0odB.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-CmH46HAG.js";import"./chevron-up-Byo9SJJ4.js";import"./avatarData-BuQSOXo3.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as Et,i as x,m as y,f as tt,aE as De,F as rt,aF as Q,O as Va,y as Ct,M as Wa,w as Pe,U as ve,j as Ke,l as Je,u as Ua,_ as Ya,P as wt,X as vt,x as jt,W as Xa}from"./index-BaOs5Ayg.js";import{r as i,j as e,d as Rt}from"./vendor-react-B4AQeu28.js";import{q as yt}from"./quiz_battle_avatar-BXHPSput.js";import{g as Ga,s as ea}from"./subjects-BFghB0SQ.js";import{doc as Za,getDoc as Ka,where as ta,orderBy as pa,limit as zt,getDocs as It,query as Mt,collection as Bt}from"./vendor-firebase-firestore-CH1lNiRF.js";import{$ as q,a0 as ha,a1 as ba,a2 as Ie,a3 as Ja}from"./vendor-firebase-core-CO26nNq6.js";import{B as A}from"./button-DCfeFHoH.js";import{a as te,b as le,c as ie,e as pe,d as ge,C as aa}from"./card-D4dmQVNb.js";import{f as es,g as ts}from"./vendor-radix-BorKzPz9.js";import{S as _e,a as Se,b as Ae,c as Ce,d as J}from"./select-DIjxRWza.js";import{I as as}from"./input-D28h_UTJ.js";import{S as sa}from"./switch-CblAJO7o.js";import{S as we}from"./skeleton-Bo6ISWhm.js";import{V as fa,a as ga,M as ss,b as rs}from"./volume-x-Chtf_bSj.js";import{C as ns}from"./CompositeAvatar-Col05lJc.js";import{S as et}from"./sparkles-By-vFjpv.js";import{C as kt}from"./check-BLSo9L0H.js";import{C as Ye}from"./chevron-right-COqGruhh.js";import{S as os}from"./shield-check-Dgisjfmb.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-B3jJOD5i.js";import"./chevron-up-Cdvz2TMJ.js";import"./avatarData-BuQSOXo3.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{RewardsModal-DTzrRjNP.js β†’ RewardsModal-CPyFRkMy.js} RENAMED
@@ -1 +1 @@
1
- import{r as d,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as F,doc as S}from"./vendor-firebase-firestore-CH1lNiRF.js";import{aI as u,A as j,aJ as U,aK as P,U as B,z as I,aL as $,r as R,aM as L,T as g,aN as M,W as N,R as T,S as q,P as X,O as w,X as v,B as G,Z as H,y as W,x as Z,G as J,a as K,aC as O,f as Q}from"./index-Cb8VeSuW.js";import{X as V}from"./x-CTLBAl-n.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const Y={BookOpen:K,GraduationCap:J,Trophy:Z,Target:W,Zap:H,Brain:G,Star:v,Flame:w,Swords:X,Shield:q,RefreshCw:T,Crown:N,Sun:M,TrendingUp:g,Globe:L,User:R,UserPlus:$,Calendar:I,Users:B,Compass:P,Heart:U,Award:j},me=({isOpen:o,onClose:c,userLevel:n,currentXP:x,xpToNextLevel:m,totalXP:p,userId:i})=>{const[y,b]=d.useState(!0),[k,_]=d.useState(new Set),[C,E]=d.useState({});d.useEffect(()=>{if(!o||!i)return;(async()=>{b(!0);try{const t=await O(i);_(new Set(t.map(a=>a.id)));const r=await F(S(Q,"progress",i));r.exists()&&E(r.data())}catch(t){console.error("Error loading achievements:",t)}finally{b(!1)}})()},[o,i]);const D=s=>{const{condition:t,threshold:r}=s,a=C;let l=0,f=r??1;switch(t){case"lesson_complete":l=a.totalLessonsCompleted||0;break;case"quiz_complete":l=a.totalQuizzesCompleted||0;break;case"battle_win":case"battle_undefeated":l=a.battleWins||0;break;case"mastery_10":case"social_streak_30":case"social_daily_return":l=a.consecutiveDaysActive||0;break;case"mastery_xp":l=p;break;case"explore_friend_added":case"social_friend":case"explore_social":l=a.friendsAdded||0;break;case"perfect_score":{l=(a.quizAttempts||[]).filter(A=>A.score===100).length;break}default:return}return{progress:Math.min(l,f),total:f}},h=u.map(s=>{const t=Y[s.icon.name]??j,r=k.has(s.id),a=D(s);return{id:s.id,icon:t,title:s.title,description:s.description,progress:a?.progress,total:a?.total,unlocked:r,color:r?s.iconColor:"text-slate-500",bgColor:r?s.iconColor.replace("text-","bg-").replace("-500","/10").replace("-400","/10").replace("-600","/10"):"bg-slate-100"}}),z=h.filter(s=>s.unlocked).length;return o?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-8",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:c}),e.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-6 text-white relative flex-shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_14%_12%,rgba(251,150,187,0.35),transparent_42%),radial-gradient(circle_at_80%_80%,rgba(117,208,106,0.25),transparent_38%)]"}),e.jsxs("div",{className:"flex items-center justify-between mb-4 relative z-10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-display font-bold",children:"Rewards & Achievements"}),e.jsxs("p",{className:"text-white/90 text-sm font-body",children:[z," / ",u.length," Achievements Unlocked"]})]}),e.jsx("button",{onClick:c,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(V,{size:24})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 relative z-10",children:[e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(N,{size:18,className:"text-[#FFB356]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Level"})]}),e.jsx("p",{className:"text-2xl font-bold",children:n})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(v,{size:18,className:"text-[#6ED1CF]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Total XP"})]}),e.jsx("p",{className:"text-2xl font-bold",children:p.toLocaleString()})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(w,{size:18,className:"text-[#FF8B8B]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Daily Rewards"})]}),e.jsx("p",{className:"text-2xl font-bold",children:"Check-in"})]})]}),e.jsxs("div",{className:"mt-4 relative z-10",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n]}),e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n+1]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"flex justify-between items-center mb-1",children:e.jsxs("span",{className:"text-xs text-white/90",children:[x," / ",m," XP"]})}),e.jsx("div",{className:"h-3 bg-white/20 rounded-full overflow-hidden border border-white/20",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full transition-all duration-500 e-w",style:{"--w":`${x/m*100}%`}})})]})]})]}),e.jsx("div",{className:"p-6 overflow-y-auto flex-1",children:y?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-[#9956DE] border-t-transparent rounded-full"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628] mb-4",children:"Achievements"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:h.map(s=>{const t=s.icon;return e.jsx("div",{className:`${s.unlocked?"bg-white border-[#9956DE]/25":"bg-[#edf1f7] border-[#dde3eb]"} border-2 rounded-xl p-4 transition-all ${s.unlocked?"shadow-md":"opacity-60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-12 h-12 ${s.bgColor} rounded-xl flex items-center justify-center flex-shrink-0`,children:e.jsx(t,{size:24,className:s.color})}),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:`text-sm font-bold ${s.unlocked?"text-[#0a1628]":"text-slate-500"} font-body`,children:s.title}),s.unlocked&&e.jsx("span",{className:"px-2 py-0.5 bg-[#75D06A] text-white text-[9px] font-bold rounded-full",children:"Unlocked"})]}),e.jsx("p",{className:`text-xs ${s.unlocked?"text-[#5a6578]":"text-slate-500"} mb-2`,children:s.description}),s.progress!==void 0&&s.total!==void 0&&!s.unlocked&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"text-[10px] text-slate-500",children:"Progress"}),e.jsxs("span",{className:"text-[10px] font-bold text-[#5a6578]",children:[s.progress," / ",s.total]})]}),e.jsx("div",{className:"h-1.5 bg-[#dde3eb] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#7274ED] to-[#1FA7E1] rounded-full transition-all e-w",style:{"--w":`${s.progress/s.total*100}%`}})})]})]})]})},s.id)})})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-[#7274ED] to-[#1FA7E1] rounded-lg flex items-center justify-center",children:e.jsx(g,{size:16,className:"text-white"})}),e.jsx("h3",{className:"text-base font-display font-bold text-[#0a1628]",children:"How to Earn XP"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{activity:"Complete a video lesson",xp:50},{activity:"Complete exercises",xp:100},{activity:"Perfect quiz score",xp:150},{activity:"Finish a quiz",xp:75},{activity:"Daily check-in",xp:"20-100"}].map((s,t)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-[#1FA7E1] rounded-full"}),e.jsxs("span",{className:"text-xs text-[#5a6578] font-body",children:[s.activity,":"]}),e.jsxs("span",{className:"text-xs font-bold text-[#7274ED]",children:["+",s.xp," XP"]})]},t))})]})]})})]})]}):null};export{me as default};
 
1
+ import{r as d,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as F,doc as S}from"./vendor-firebase-firestore-CH1lNiRF.js";import{aI as u,A as j,aJ as U,aK as P,U as B,z as I,aL as $,r as R,aM as L,T as g,aN as M,W as N,R as T,S as q,P as X,O as w,X as v,B as G,Z as H,y as W,x as Z,G as J,a as K,aC as O,f as Q}from"./index-BaOs5Ayg.js";import{X as V}from"./x-TNvtuOD9.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const Y={BookOpen:K,GraduationCap:J,Trophy:Z,Target:W,Zap:H,Brain:G,Star:v,Flame:w,Swords:X,Shield:q,RefreshCw:T,Crown:N,Sun:M,TrendingUp:g,Globe:L,User:R,UserPlus:$,Calendar:I,Users:B,Compass:P,Heart:U,Award:j},me=({isOpen:o,onClose:c,userLevel:n,currentXP:x,xpToNextLevel:m,totalXP:p,userId:i})=>{const[y,b]=d.useState(!0),[k,_]=d.useState(new Set),[C,E]=d.useState({});d.useEffect(()=>{if(!o||!i)return;(async()=>{b(!0);try{const t=await O(i);_(new Set(t.map(a=>a.id)));const r=await F(S(Q,"progress",i));r.exists()&&E(r.data())}catch(t){console.error("Error loading achievements:",t)}finally{b(!1)}})()},[o,i]);const D=s=>{const{condition:t,threshold:r}=s,a=C;let l=0,f=r??1;switch(t){case"lesson_complete":l=a.totalLessonsCompleted||0;break;case"quiz_complete":l=a.totalQuizzesCompleted||0;break;case"battle_win":case"battle_undefeated":l=a.battleWins||0;break;case"mastery_10":case"social_streak_30":case"social_daily_return":l=a.consecutiveDaysActive||0;break;case"mastery_xp":l=p;break;case"explore_friend_added":case"social_friend":case"explore_social":l=a.friendsAdded||0;break;case"perfect_score":{l=(a.quizAttempts||[]).filter(A=>A.score===100).length;break}default:return}return{progress:Math.min(l,f),total:f}},h=u.map(s=>{const t=Y[s.icon.name]??j,r=k.has(s.id),a=D(s);return{id:s.id,icon:t,title:s.title,description:s.description,progress:a?.progress,total:a?.total,unlocked:r,color:r?s.iconColor:"text-slate-500",bgColor:r?s.iconColor.replace("text-","bg-").replace("-500","/10").replace("-400","/10").replace("-600","/10"):"bg-slate-100"}}),z=h.filter(s=>s.unlocked).length;return o?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-8",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:c}),e.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-6 text-white relative flex-shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_14%_12%,rgba(251,150,187,0.35),transparent_42%),radial-gradient(circle_at_80%_80%,rgba(117,208,106,0.25),transparent_38%)]"}),e.jsxs("div",{className:"flex items-center justify-between mb-4 relative z-10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-display font-bold",children:"Rewards & Achievements"}),e.jsxs("p",{className:"text-white/90 text-sm font-body",children:[z," / ",u.length," Achievements Unlocked"]})]}),e.jsx("button",{onClick:c,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(V,{size:24})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 relative z-10",children:[e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(N,{size:18,className:"text-[#FFB356]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Level"})]}),e.jsx("p",{className:"text-2xl font-bold",children:n})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(v,{size:18,className:"text-[#6ED1CF]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Total XP"})]}),e.jsx("p",{className:"text-2xl font-bold",children:p.toLocaleString()})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(w,{size:18,className:"text-[#FF8B8B]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Daily Rewards"})]}),e.jsx("p",{className:"text-2xl font-bold",children:"Check-in"})]})]}),e.jsxs("div",{className:"mt-4 relative z-10",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n]}),e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n+1]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"flex justify-between items-center mb-1",children:e.jsxs("span",{className:"text-xs text-white/90",children:[x," / ",m," XP"]})}),e.jsx("div",{className:"h-3 bg-white/20 rounded-full overflow-hidden border border-white/20",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full transition-all duration-500 e-w",style:{"--w":`${x/m*100}%`}})})]})]})]}),e.jsx("div",{className:"p-6 overflow-y-auto flex-1",children:y?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-[#9956DE] border-t-transparent rounded-full"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628] mb-4",children:"Achievements"}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:h.map(s=>{const t=s.icon;return e.jsx("div",{className:`${s.unlocked?"bg-white border-[#9956DE]/25":"bg-[#edf1f7] border-[#dde3eb]"} border-2 rounded-xl p-4 transition-all ${s.unlocked?"shadow-md":"opacity-60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-12 h-12 ${s.bgColor} rounded-xl flex items-center justify-center flex-shrink-0`,children:e.jsx(t,{size:24,className:s.color})}),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:`text-sm font-bold ${s.unlocked?"text-[#0a1628]":"text-slate-500"} font-body`,children:s.title}),s.unlocked&&e.jsx("span",{className:"px-2 py-0.5 bg-[#75D06A] text-white text-[9px] font-bold rounded-full",children:"Unlocked"})]}),e.jsx("p",{className:`text-xs ${s.unlocked?"text-[#5a6578]":"text-slate-500"} mb-2`,children:s.description}),s.progress!==void 0&&s.total!==void 0&&!s.unlocked&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"text-[10px] text-slate-500",children:"Progress"}),e.jsxs("span",{className:"text-[10px] font-bold text-[#5a6578]",children:[s.progress," / ",s.total]})]}),e.jsx("div",{className:"h-1.5 bg-[#dde3eb] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#7274ED] to-[#1FA7E1] rounded-full transition-all e-w",style:{"--w":`${s.progress/s.total*100}%`}})})]})]})]})},s.id)})})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-[#7274ED] to-[#1FA7E1] rounded-lg flex items-center justify-center",children:e.jsx(g,{size:16,className:"text-white"})}),e.jsx("h3",{className:"text-base font-display font-bold text-[#0a1628]",children:"How to Earn XP"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{activity:"Complete a video lesson",xp:50},{activity:"Complete exercises",xp:100},{activity:"Perfect quiz score",xp:150},{activity:"Finish a quiz",xp:75},{activity:"Daily check-in",xp:"20-100"}].map((s,t)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-[#1FA7E1] rounded-full"}),e.jsxs("span",{className:"text-xs text-[#5a6578] font-body",children:[s.activity,":"]}),e.jsxs("span",{className:"text-xs font-bold text-[#7274ED]",children:["+",s.xp," XP"]})]},t))})]})]})})]})]}):null};export{me as default};
assets/{RightSidebar-BDjjmpc8.js β†’ RightSidebar-CmYzVUKQ.js} RENAMED
@@ -1 +1 @@
1
- import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{q as S}from"./quiz_battle_avatar-BXHPSput.js";import{j as B,m as c,Z as _,P,V as q,x as W,W as v,X,l as Y,r as k}from"./index-Cb8VeSuW.js";import{C as M}from"./circle-check-big-CNGbqkWz.js";import{T as O,a as Z,b as H}from"./tooltip-BY91VKdD.js";import{C as T}from"./chevron-right-CoVWpXdD.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const E=[{id:1,title:"Quiz Battle",subtitle:"Challenge players worldwide!",bgColor:"bg-[#9956de]",orbColor:"bg-[#6D28D9]",icon:e.jsx(P,{size:24,className:"text-white"}),buttonText:"Join Battle",actionType:"quiz-battle",avatarText:"Waiting for you to join..."},{id:2,title:"Topic Explorer",subtitle:"Dive into a new math topic today",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",icon:e.jsx(_,{size:24,className:"text-white"}),buttonText:"Explore",actionType:"explore",avatarText:"Knowledge is power!"},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",icon:e.jsx(M,{size:24,className:"text-white"}),buttonText:null,actionType:null,avatarText:"Ready for action!"}],J=({onNavigateToQuizBattle:s,userPhoto:a})=>{const[x,m]=l.useState(0);l.useEffect(()=>{const r=setInterval(()=>{m(o=>(o+1)%E.length)},5e3);return()=>clearInterval(r)},[]);const t=E[x];return e.jsx("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:e.jsx("div",{className:"relative h-[185px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(B,{mode:"wait",children:e.jsxs(c.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${t.bgColor} p-4 sm:p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -right-4 -bottom-6 w-32 h-32 opacity-25 mix-blend-overlay pointer-events-none z-0 transform group-hover:scale-105 transition-transform duration-700",children:e.jsx("img",{src:S,alt:"",className:"w-full h-full object-contain"})}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${t.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-[25deg] group-hover:scale-110 transition-transform duration-700 flex items-center justify-center z-10",children:t.icon}),e.jsxs("div",{className:"relative z-10 w-full pr-[60px]",children:[e.jsx("h3",{className:"font-display font-bold text-[20px] leading-tight text-white mb-0.5",children:t.title}),e.jsx("p",{className:"text-[12px] font-medium text-white/90 leading-snug",children:t.subtitle}),t.buttonText&&e.jsx("button",{onClick:r=>{r.stopPropagation(),t.actionType==="quiz-battle"&&s&&s()},className:"mt-2.5 bg-white text-[#0a1628] px-2 py-1 rounded-lg font-bold text-xs shadow-sm hover:scale-105 transition-transform uppercase tracking-wider whitespace-nowrap w-fit",children:t.buttonText})]}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 mt-auto pt-2",children:[a?e.jsxs("div",{className:"relative group/avatar shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-white/40 blur-md rounded-full animate-pulse"}),e.jsx("img",{src:a,alt:"You",className:"w-8 h-8 rounded-full border-[2px] border-white object-cover relative z-10 shadow-md group-hover/avatar:scale-110 transition-transform"}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] bg-[#75D06A] border-2 border-[#7C3AED] rounded-full z-20 flex items-center justify-center",children:e.jsx(_,{size:8,className:"text-white",fill:"currentColor"})})]}):null,e.jsx("span",{className:"text-[12px] font-bold text-white tracking-wide leading-tight flex-1 pr-[60px]",children:t.avatarText})]})]},t.id)})})})},K=s=>{if(s>=1e3){const a=s/1e3;return a>=10?`${Math.round(a)}k`:`${a.toFixed(1)}k`}return`${s}`},V=({entry:s,rank:a,isYou:x,userPhoto:m,rankColor:t})=>{const r=x?s?.photo||m:s?.photo,o=x?"You":s?.name||"---",h=s?.xp||0;return e.jsxs(e.Fragment,{children:[e.jsxs(c.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3+a*.1},className:"relative mb-2",children:[a===1&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(v,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("div",{className:`w-10 h-10 rounded-full border-[3px] ${a===1?"w-[52px] h-[52px]":""} ${t.border} z-10 relative overflow-hidden ${t.shadow} bg-white`,children:r?e.jsx("img",{src:r,alt:o,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-slate-200 to-slate-300 flex items-center justify-center",children:e.jsx(k,{size:a===1?22:16,className:"text-slate-400"})})}),e.jsx("div",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 ${t.badge} text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm`,children:a})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:`block ${a===1?"text-[13px] font-black":"text-[12px] font-bold"} text-[#0a1628] truncate max-w-[80px]`,children:o}),e.jsxs("span",{className:`block ${a===1?"text-[11px]":"text-[10px]"} ${t.badge.replace("bg-","text-").replace("-500","-600").replace("-400","-600").replace("amber","amber")} font-bold`,children:[K(h)," XP"]})]})]})},ce=({currentUserId:s,onOpenRewards:a,onOpenLeaderboard:x,onNavigateToModules:m,onNavigateToQuizBattle:t,userLevel:r,userPhoto:o,currentXP:h,xpToNextLevel:f})=>{const N=h/f*100,[$,D]=l.useState([]),[F,u]=l.useState(!0),[y,g]=l.useState(null),p=l.useRef(null),n=l.useRef(null);l.useEffect(()=>{if(!s){u(!1);return}u(!0),g(null);const d=q(b=>{D(b),u(!1),g(null),n.current&&(clearTimeout(n.current),n.current=null)},s,!1,"all",3);return p.current=d,n.current=setTimeout(()=>{u(!1),g("Leaderboard data unavailable")},15e3),()=>{n.current&&(clearTimeout(n.current),n.current=null),p.current&&(p.current(),p.current=null)}},[s]);const i=$.slice(0,3);i.some(d=>d.userId===s);const z=[{bg:"from-amber-100 to-amber-50",border:"border-amber-400",badge:"bg-amber-500",shadow:"shadow-md"},{bg:"from-slate-200 to-slate-100",border:"border-sky-400",badge:"bg-sky-500",shadow:"shadow-sm"},{bg:"from-orange-50 to-slate-50",border:"border-orange-400",badge:"bg-orange-500",shadow:"shadow-sm"}],A=["74px","54px","38px"],L=["w-[78px]","w-[70px]","w-[70px]"],j=(d,b,C,R,w)=>e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(V,{entry:d,rank:C,isYou:R==="You",userPhoto:o,rankColor:z[w]}),e.jsxs(c.div,{initial:{height:0},animate:{height:A[b]},transition:{delay:.2+b*.1,duration:.5,ease:"easeOut"},className:`${L[b]} bg-gradient-to-b ${z[w].bg} rounded-t-xl rounded-b-md border-t-2 border-white/20 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]`,children:[e.jsx("span",{className:`${w===0?"text-amber-400 text-3xl":"text-slate-400 text-2xl"} font-black opacity-40 translate-y-1`,children:C}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]})]});return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:a,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(W,{size:14,className:"text-white"})}),e.jsxs("h3",{className:"font-display font-bold text-[13px] leading-tight text-white tracking-wide",children:["Rewards & ",e.jsx("br",{className:"hidden 2xl:block"})," Achievements"]})]}),e.jsx(T,{size:14,className:"shrink-0 text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3 bg-white/10 p-1.5 rounded-xl border border-white/20 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(v,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",r]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(O,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs("button",{onClick:d=>{d.stopPropagation(),m?.()},className:"flex items-center gap-1.5 text-xs font-body px-1 text-white cursor-pointer transition-colors active:scale-95",children:[e.jsx(X,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[h," XP"]})]})}),e.jsx(H,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",r+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(N),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(c.div,{initial:{width:0},animate:{width:`${N}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(J,{onNavigateToQuizBattle:t,userPhoto:o})}),e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:x,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(v,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(T,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsx("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:F?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(Y,{className:"w-5 h-5 animate-spin text-amber-400 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Loading rankings..."})]}):y||i.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(k,{className:"w-8 h-8 text-slate-300 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400 text-center",children:y||"No rankings available yet"})]}):e.jsxs(e.Fragment,{children:[j(i[1],1,2,i[1]?.name||"---",1),j(i[0],0,1,i[0]?.name||"---",0),j(i[2],2,3,i[2]?.name||"---",2)]})})]})]})};export{ce as default};
 
1
+ import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{q as S}from"./quiz_battle_avatar-BXHPSput.js";import{j as B,m as c,Z as _,P,V as q,x as W,W as v,X,l as Y,r as k}from"./index-BaOs5Ayg.js";import{C as M}from"./circle-check-big-m1SvzGFL.js";import{T as O,a as Z,b as H}from"./tooltip-ChRIOid3.js";import{C as T}from"./chevron-right-COqGruhh.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const E=[{id:1,title:"Quiz Battle",subtitle:"Challenge players worldwide!",bgColor:"bg-[#9956de]",orbColor:"bg-[#6D28D9]",icon:e.jsx(P,{size:24,className:"text-white"}),buttonText:"Join Battle",actionType:"quiz-battle",avatarText:"Waiting for you to join..."},{id:2,title:"Topic Explorer",subtitle:"Dive into a new math topic today",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",icon:e.jsx(_,{size:24,className:"text-white"}),buttonText:"Explore",actionType:"explore",avatarText:"Knowledge is power!"},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",icon:e.jsx(M,{size:24,className:"text-white"}),buttonText:null,actionType:null,avatarText:"Ready for action!"}],J=({onNavigateToQuizBattle:s,userPhoto:a})=>{const[x,m]=l.useState(0);l.useEffect(()=>{const r=setInterval(()=>{m(o=>(o+1)%E.length)},5e3);return()=>clearInterval(r)},[]);const t=E[x];return e.jsx("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:e.jsx("div",{className:"relative h-[185px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(B,{mode:"wait",children:e.jsxs(c.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${t.bgColor} p-4 sm:p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -right-4 -bottom-6 w-32 h-32 opacity-25 mix-blend-overlay pointer-events-none z-0 transform group-hover:scale-105 transition-transform duration-700",children:e.jsx("img",{src:S,alt:"",className:"w-full h-full object-contain"})}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${t.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-[25deg] group-hover:scale-110 transition-transform duration-700 flex items-center justify-center z-10",children:t.icon}),e.jsxs("div",{className:"relative z-10 w-full pr-[60px]",children:[e.jsx("h3",{className:"font-display font-bold text-[20px] leading-tight text-white mb-0.5",children:t.title}),e.jsx("p",{className:"text-[12px] font-medium text-white/90 leading-snug",children:t.subtitle}),t.buttonText&&e.jsx("button",{onClick:r=>{r.stopPropagation(),t.actionType==="quiz-battle"&&s&&s()},className:"mt-2.5 bg-white text-[#0a1628] px-2 py-1 rounded-lg font-bold text-xs shadow-sm hover:scale-105 transition-transform uppercase tracking-wider whitespace-nowrap w-fit",children:t.buttonText})]}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 mt-auto pt-2",children:[a?e.jsxs("div",{className:"relative group/avatar shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-white/40 blur-md rounded-full animate-pulse"}),e.jsx("img",{src:a,alt:"You",className:"w-8 h-8 rounded-full border-[2px] border-white object-cover relative z-10 shadow-md group-hover/avatar:scale-110 transition-transform"}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] bg-[#75D06A] border-2 border-[#7C3AED] rounded-full z-20 flex items-center justify-center",children:e.jsx(_,{size:8,className:"text-white",fill:"currentColor"})})]}):null,e.jsx("span",{className:"text-[12px] font-bold text-white tracking-wide leading-tight flex-1 pr-[60px]",children:t.avatarText})]})]},t.id)})})})},K=s=>{if(s>=1e3){const a=s/1e3;return a>=10?`${Math.round(a)}k`:`${a.toFixed(1)}k`}return`${s}`},V=({entry:s,rank:a,isYou:x,userPhoto:m,rankColor:t})=>{const r=x?s?.photo||m:s?.photo,o=x?"You":s?.name||"---",h=s?.xp||0;return e.jsxs(e.Fragment,{children:[e.jsxs(c.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3+a*.1},className:"relative mb-2",children:[a===1&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(v,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("div",{className:`w-10 h-10 rounded-full border-[3px] ${a===1?"w-[52px] h-[52px]":""} ${t.border} z-10 relative overflow-hidden ${t.shadow} bg-white`,children:r?e.jsx("img",{src:r,alt:o,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-slate-200 to-slate-300 flex items-center justify-center",children:e.jsx(k,{size:a===1?22:16,className:"text-slate-400"})})}),e.jsx("div",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 ${t.badge} text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm`,children:a})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:`block ${a===1?"text-[13px] font-black":"text-[12px] font-bold"} text-[#0a1628] truncate max-w-[80px]`,children:o}),e.jsxs("span",{className:`block ${a===1?"text-[11px]":"text-[10px]"} ${t.badge.replace("bg-","text-").replace("-500","-600").replace("-400","-600").replace("amber","amber")} font-bold`,children:[K(h)," XP"]})]})]})},ce=({currentUserId:s,onOpenRewards:a,onOpenLeaderboard:x,onNavigateToModules:m,onNavigateToQuizBattle:t,userLevel:r,userPhoto:o,currentXP:h,xpToNextLevel:f})=>{const N=h/f*100,[$,D]=l.useState([]),[F,u]=l.useState(!0),[y,g]=l.useState(null),p=l.useRef(null),n=l.useRef(null);l.useEffect(()=>{if(!s){u(!1);return}u(!0),g(null);const d=q(b=>{D(b),u(!1),g(null),n.current&&(clearTimeout(n.current),n.current=null)},s,!1,"all",3);return p.current=d,n.current=setTimeout(()=>{u(!1),g("Leaderboard data unavailable")},15e3),()=>{n.current&&(clearTimeout(n.current),n.current=null),p.current&&(p.current(),p.current=null)}},[s]);const i=$.slice(0,3);i.some(d=>d.userId===s);const z=[{bg:"from-amber-100 to-amber-50",border:"border-amber-400",badge:"bg-amber-500",shadow:"shadow-md"},{bg:"from-slate-200 to-slate-100",border:"border-sky-400",badge:"bg-sky-500",shadow:"shadow-sm"},{bg:"from-orange-50 to-slate-50",border:"border-orange-400",badge:"bg-orange-500",shadow:"shadow-sm"}],A=["74px","54px","38px"],L=["w-[78px]","w-[70px]","w-[70px]"],j=(d,b,C,R,w)=>e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(V,{entry:d,rank:C,isYou:R==="You",userPhoto:o,rankColor:z[w]}),e.jsxs(c.div,{initial:{height:0},animate:{height:A[b]},transition:{delay:.2+b*.1,duration:.5,ease:"easeOut"},className:`${L[b]} bg-gradient-to-b ${z[w].bg} rounded-t-xl rounded-b-md border-t-2 border-white/20 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]`,children:[e.jsx("span",{className:`${w===0?"text-amber-400 text-3xl":"text-slate-400 text-2xl"} font-black opacity-40 translate-y-1`,children:C}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]})]});return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:a,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(W,{size:14,className:"text-white"})}),e.jsxs("h3",{className:"font-display font-bold text-[13px] leading-tight text-white tracking-wide",children:["Rewards & ",e.jsx("br",{className:"hidden 2xl:block"})," Achievements"]})]}),e.jsx(T,{size:14,className:"shrink-0 text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3 bg-white/10 p-1.5 rounded-xl border border-white/20 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(v,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",r]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(O,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs("button",{onClick:d=>{d.stopPropagation(),m?.()},className:"flex items-center gap-1.5 text-xs font-body px-1 text-white cursor-pointer transition-colors active:scale-95",children:[e.jsx(X,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[h," XP"]})]})}),e.jsx(H,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",r+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(N),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(c.div,{initial:{width:0},animate:{width:`${N}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(J,{onNavigateToQuizBattle:t,userPhoto:o})}),e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:x,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(v,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(T,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsx("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:F?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(Y,{className:"w-5 h-5 animate-spin text-amber-400 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Loading rankings..."})]}):y||i.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(k,{className:"w-8 h-8 text-slate-300 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400 text-center",children:y||"No rankings available yet"})]}):e.jsxs(e.Fragment,{children:[j(i[1],1,2,i[1]?.name||"---",1),j(i[0],0,1,i[0]?.name||"---",0),j(i[2],2,3,i[2]?.name||"---",2)]})})]})]})};export{ce as default};
assets/{ScientificCalculator-CLmkIayw.js β†’ ScientificCalculator-DRuSfTXj.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{e as Z,h as de,j as U,m as ue}from"./index-Cb8VeSuW.js";import{C as fe,a as pe}from"./chevron-up-Byo9SJJ4.js";import{X as be}from"./x-CTLBAl-n.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{e as Z,h as de,j as U,m as ue}from"./index-BaOs5Ayg.js";import{C as fe,a as pe}from"./chevron-up-Cdvz2TMJ.js";import{X as be}from"./x-TNvtuOD9.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/SettingsModal-BVXFPk7A.js DELETED
@@ -1,11 +0,0 @@
1
- import{r,j as e}from"./vendor-react-B4AQeu28.js";import{S as ge,a as Ne,c as ve,d as D}from"./select-CqJdJ0KN.js";import{e as ie,r as we,S as ke,aM as Ce,j as Se,m as E,L as Ee,aP as ze,t as d}from"./index-Cb8VeSuW.js";import{B as x}from"./button-De2q2xHf.js";import{I as l}from"./input-w3MoyecB.js";import{S as m}from"./switch-KjWJg4zs.js";import ee from"./ConfirmModal-B7469iTj.js";import{P as Pe,M as se,V as te}from"./ProfilePictureUploader-viKg_Exm.js";import{B as Ae}from"./bell-DsHB20Hc.js";import{D as ae}from"./download-C-V0pYsk.js";import{X as ne}from"./x-CTLBAl-n.js";import{C as re}from"./circle-help-hn0lWYq9.js";import{C as Re}from"./clock-BodmJJnp.js";import{T as Me}from"./trash-2-DB-oXtbr.js";import{E as Te,a as Fe}from"./eye-DBkZRvYD.js";import"./vendor-radix-BorKzPz9.js";import"./chevron-up-Byo9SJJ4.js";import"./check-DSwzaW4Y.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";import"./log-out-CM6AS10M.js";import"./minus-CMQilTBg.js";import"./plus-uFWGSQCY.js";import"./upload-D5cppfxb.js";/**
2
- * @license lucide-react v0.487.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const qe=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],Ie=ie("palette",qe);/**
7
- * @license lucide-react v0.487.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Le=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],De=ie("smartphone",Le),_=()=>JSON.parse(JSON.stringify(ze)),us=({isOpen:f,onClose:N,profileData:o,onSave:H,settingsData:w,onSaveSettings:O,onApplySettingsPreview:v,onUpdatePassword:z,onExportData:U,onClearCache:V,onDeleteAccount:P,onResetData:k})=>{const[h,le]=r.useState("account"),[a,c]=r.useState({}),[n,G]=r.useState(_()),[A,Q]=r.useState(!1),[j,X]=r.useState(!1),[R,B]=r.useState(!1),[M,J]=r.useState(!1),[y,$]=r.useState(!1),[oe,C]=r.useState(!1),[ce,S]=r.useState(!1),[de,g]=r.useState(!1),[u,K]=r.useState(!1),[W,b]=r.useState(""),[T,p]=r.useState(!1),F=r.useRef(!1),q=r.useRef(_());r.useEffect(()=>{if(!f){F.current=!1;return}if(F.current)return;F.current=!0;const s=w?JSON.parse(JSON.stringify(w)):_();q.current=s,c({uid:o?.uid,name:o?.name||"",email:o?.email||"",phone:o?.phone||"",photo:o?.photo||"",avatarLayers:o?.avatarLayers,role:o?.role,gender:o?.gender,lrn:o?.lrn||"",grade:o?.grade||"",section:o?.section||"",school:o?.school||"",department:o?.department||"",subject:o?.subject||"",yearsOfExperience:o?.yearsOfExperience||"",qualification:o?.qualification||"",position:o?.position||""}),G(s)},[f,o,w]),r.useEffect(()=>{f&&v?.(n)},[f,n,v]),r.useEffect(()=>{if(!f)return;const s=t=>{t.key==="Escape"&&(v?.(q.current),N())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[f,N,v,w]);const Y=r.useMemo(()=>[{id:"account",label:"Account",icon:we},{id:"notifications",label:"Notifications",icon:Ae},{id:"appearance",label:"Appearance",icon:Ie},{id:"privacy",label:"Privacy & Security",icon:ke},{id:"learning",label:"Learning",icon:Ce},{id:"data",label:"Data & Storage",icon:ae}],[]),i=s=>{G(t=>s(t))},xe=async()=>{Q(!0);try{H&&await H(a),O&&await O(n),N()}catch(s){console.error("Error saving settings:",s),d.error(s instanceof Error?s.message:"Failed to save settings")}finally{Q(!1)}},I=()=>{C(!1),S(!1),g(!1),b(""),p(!1),v?.(q.current),N()},me=()=>{!k||j||C(!0)},he=async()=>{if(!(!k||j)){C(!1),X(!0);try{await k(),d.success("Testing data reset completed")}catch(s){console.error("Error resetting testing data:",s),d.error(s instanceof Error?s.message:"Failed to reset testing data")}finally{X(!1)}}},ue=async()=>{if(!z){d.info("Password update is not available in this environment.");return}b(""),p(!1),g(!0)},Z=async()=>{if(!z||u)return;const s=W.trim();if(!s){d.error("Password is required.");return}if(s.length<8){d.error("Password must be at least 8 characters long.");return}K(!0);try{await z(s),d.success("Password updated successfully."),g(!1),b(""),p(!1)}catch(t){console.error("Error updating password:",t),d.error(t instanceof Error?t.message:"Failed to update password")}finally{K(!1)}},fe=()=>{d.info("Two-factor authentication setup is not enabled for this project yet.")},be=async()=>{if(!U||R){d.info("Data export is not available right now.");return}B(!0);try{await U()}catch(s){console.error("Error exporting data:",s),d.error(s instanceof Error?s.message:"Failed to export data")}finally{B(!1)}},pe=async()=>{if(!V||M){d.info("Cache clearing is not available right now.");return}J(!0);try{await V()}catch(s){console.error("Error clearing cache:",s),d.error(s instanceof Error?s.message:"Failed to clear cache")}finally{J(!1)}},je=()=>{if(!P||y){d.info("Account deletion is not available right now.");return}S(!0)},ye=async()=>{if(!(!P||y)){S(!1),$(!0);try{await P(),N()}catch(s){console.error("Error deleting account:",s),d.error(s instanceof Error?s.message:"Failed to delete account")}finally{$(!1)}}};return f?e.jsx(Se,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx(E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:I,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(E.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-4xl max-h-[85vh] overflow-hidden flex",children:[e.jsxs("div",{className:"w-64 bg-slate-50 border-r border-slate-200 p-6 overflow-y-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-[#0a1628]",children:"Settings"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Manage your preferences"})]}),e.jsx("nav",{className:"space-y-1",children:Y.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>le(s.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${h===s.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[e.jsx(t,{size:18}),e.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id)})})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-[#dde3eb]",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628]",children:Y.find(s=>s.id===h)?.label}),e.jsx("button",{onClick:I,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:e.jsx(ne,{size:20,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[h==="account"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(Pe,{uid:a.uid,photoURL:a.photo,displayName:a.name,onUploaded:s=>c(t=>({...t,photo:s}))}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Full Name"}),e.jsx(l,{type:"text",value:a.name||"",onChange:s=>c(t=>({...t,name:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Email Address"}),e.jsx(l,{type:"email",value:a.email||"",onChange:s=>c(t=>({...t,email:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Phone Number"}),e.jsx(l,{type:"tel",value:a.phone||"",onChange:s=>c(t=>({...t,phone:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Gender"}),e.jsxs(ge,{value:a.gender||"",onValueChange:s=>{c(t=>({...t,gender:s||void 0}))},children:[e.jsx(Ne,{className:"max-w-md bg-white border-[#dde3eb] rounded-lg [&>span]:flex [&>span]:items-center [&>span]:gap-2",children:e.jsxs("span",{className:"flex items-center gap-2",children:[a.gender==="male"&&e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"size-4 text-blue-500"}),e.jsx("span",{children:"Male"})]}),a.gender==="female"&&e.jsxs(e.Fragment,{children:[e.jsx(te,{className:"size-4 text-pink-500"}),e.jsx("span",{children:"Female"})]}),a.gender==="prefer_not_to_say"&&e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"size-4 text-gray-500"}),e.jsx("span",{children:"Prefer not to say"})]}),!a.gender&&e.jsx("span",{className:"text-muted-foreground",children:"Select gender (optional)"})]})}),e.jsxs(ve,{children:[e.jsx(D,{value:"male",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{className:"size-4 text-blue-500"}),e.jsx("span",{children:"Male"})]})}),e.jsx(D,{value:"female",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{className:"size-4 text-pink-500"}),e.jsx("span",{children:"Female"})]})}),e.jsx(D,{value:"prefer_not_to_say",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(re,{className:"size-4 text-gray-500"}),e.jsx("span",{children:"Prefer not to say"})]})})]})]})]}),a.role==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Learner's Reference Number (LRN)"}),e.jsx(l,{type:"text",value:a.lrn||"",onChange:s=>c(t=>({...t,lrn:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Grade Level"}),e.jsx(l,{type:"text",value:a.grade||"",onChange:s=>c(t=>({...t,grade:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Section"}),e.jsx(l,{type:"text",value:a.section||"",onChange:s=>c(t=>({...t,section:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"School"}),e.jsx(l,{type:"text",value:a.school||"",onChange:s=>c(t=>({...t,school:s.target.value})),className:"max-w-md"})]})]}),a.role==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(l,{type:"text",value:a.department||"",onChange:s=>c(t=>({...t,department:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Subject"}),e.jsx(l,{type:"text",value:a.subject||"",onChange:s=>c(t=>({...t,subject:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Years of Experience"}),e.jsx(l,{type:"text",value:a.yearsOfExperience||"",onChange:s=>c(t=>({...t,yearsOfExperience:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Qualification"}),e.jsx(l,{type:"text",value:a.qualification||"",onChange:s=>c(t=>({...t,qualification:s.target.value})),className:"max-w-md"})]})]}),a.role==="admin"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Position"}),e.jsx(l,{type:"text",value:a.position||"",onChange:s=>c(t=>({...t,position:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(l,{type:"text",value:a.department||"",onChange:s=>c(t=>({...t,department:s.target.value})),className:"max-w-md"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Role"}),e.jsx(l,{type:"text",value:a.role||"",className:"max-w-md bg-slate-100",disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Change Password"}),e.jsxs(x,{variant:"outline",className:"rounded-xl",onClick:ue,children:[e.jsx(Ee,{size:16,className:"mr-2"}),"Update Password"]})]}),e.jsx("div",{className:"pt-4 border-t border-[#dde3eb]",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Two-Factor Authentication"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Add an extra layer of security"})]}),e.jsx(x,{variant:"outline",size:"sm",className:"rounded-xl",onClick:fe,children:"Enable"})]})})]}),h==="notifications"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Email Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Receive updates via email"})]}),e.jsx(m,{checked:n.notifications.emailNotifications,onCheckedChange:s=>i(t=>({...t,notifications:{...t.notifications,emailNotifications:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Push Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Get notified on your device"})]}),e.jsx(m,{checked:n.notifications.pushNotifications,onCheckedChange:s=>i(t=>({...t,notifications:{...t.notifications,pushNotifications:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Sound Effects"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Play sounds for notifications"})]}),e.jsx(m,{checked:n.notifications.soundEnabled,onCheckedChange:s=>i(t=>({...t,notifications:{...t.notifications,soundEnabled:s}}))})]}),e.jsxs("div",{className:"pt-4",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-3 font-body",children:"Notification Types"}),e.jsx("div",{className:"space-y-3",children:[{key:"quizReminders",label:"Quiz Reminders"},{key:"newContent",label:"New Content"},{key:"achievements",label:"Achievements"},{key:"streakAlerts",label:"Streak Alerts"},{key:"weeklySummary",label:"Weekly Summary"}].map(s=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:n.notifications.notificationTypes[s.key],onChange:t=>i(L=>({...L,notifications:{...L.notifications,notificationTypes:{...L.notifications.notificationTypes,[s.key]:t.target.checked}}})),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),e.jsx("span",{className:"text-sm text-[#0a1628] font-body",children:s.label})]},s.key))})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(Re,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(l,{type:"time",value:n.notifications.quietHours.start,onChange:s=>i(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,start:s.target.value}}})),className:"w-32"}),e.jsx("span",{className:"text-[#5a6578]",children:"to"}),e.jsx(l,{type:"time",value:n.notifications.quietHours.end,onChange:s=>i(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,end:s.target.value}}})),className:"w-32"})]}),e.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"No notifications during this time"})]})]}),h==="appearance"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Dark Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Smart invert colors like extension dark mode"})]}),e.jsx(m,{checked:n.appearance.darkMode,onCheckedChange:s=>i(t=>({...t,appearance:{...t.appearance,darkMode:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-3 block font-body uppercase tracking-wider text-xs",children:"Font Size"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-slate-500",children:"Small"}),e.jsx("input",{type:"range",min:"12",max:"20",value:n.appearance.fontSize,onChange:s=>i(t=>({...t,appearance:{...t.appearance,fontSize:Number(s.target.value)}})),className:"flex-1"}),e.jsx("span",{className:"text-xs text-slate-500",children:"Large"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Compact View"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show more content on screen"})]}),e.jsx(m,{checked:n.appearance.compactView,onCheckedChange:s=>i(t=>({...t,appearance:{...t.appearance,compactView:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Reduce Animations"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Minimize motion effects"})]}),e.jsx(m,{checked:n.appearance.reduceAnimations,onCheckedChange:s=>i(t=>({...t,appearance:{...t.appearance,reduceAnimations:s}}))})]})]}),h==="privacy"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Profile Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Who can see your profile"})]}),e.jsxs("select",{value:n.privacy.profileVisibility,onChange:s=>i(t=>({...t,privacy:{...t.privacy,profileVisibility:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[e.jsx("option",{value:"everyone",children:"Everyone"}),e.jsx("option",{value:"students_and_staff",children:"Students and Staff"}),e.jsx("option",{value:"private",children:"Private"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Activity Status"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let others see when you're online"})]}),e.jsx(m,{checked:n.privacy.showActivityStatus,onCheckedChange:s=>i(t=>({...t,privacy:{...t.privacy,showActivityStatus:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Data Sharing"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Share anonymous usage data"})]}),e.jsx(m,{checked:n.privacy.dataSharing,onCheckedChange:s=>i(t=>({...t,privacy:{...t.privacy,dataSharing:s}}))})]})]}),h==="learning"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Daily XP Goal"}),e.jsx(l,{type:"number",value:n.learning.dailyXpGoal,onChange:s=>i(t=>({...t,learning:{...t.learning,dailyXpGoal:Number(s.target.value||0)}})),className:"max-w-xs"}),e.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Set your daily learning target"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Preferred Study Time"}),e.jsxs("select",{value:n.learning.preferredStudyTime,onChange:s=>i(t=>({...t,learning:{...t.learning,preferredStudyTime:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"morning",children:"Morning (6AM - 12PM)"}),e.jsx("option",{value:"afternoon",children:"Afternoon (12PM - 6PM)"}),e.jsx("option",{value:"evening",children:"Evening (6PM - 12AM)"}),e.jsx("option",{value:"night",children:"Night (12AM - 6AM)"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-play Next Lesson"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically start the next lesson"})]}),e.jsx(m,{checked:n.learning.autoPlayLessons,onCheckedChange:s=>i(t=>({...t,learning:{...t.learning,autoPlayLessons:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Hints During Quizzes"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Display helpful hints for questions"})]}),e.jsx(m,{checked:n.learning.showHints,onCheckedChange:s=>i(t=>({...t,learning:{...t.learning,showHints:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Quiz Difficulty Preference"}),e.jsxs("select",{value:n.learning.quizDifficultyPreference,onChange:s=>i(t=>({...t,learning:{...t.learning,quizDifficultyPreference:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"adaptive",children:"Adaptive (Recommended)"}),e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(De,{size:16,className:"inline mr-2"}),"Study Reminders"]}),e.jsx(l,{type:"time",value:n.learning.studyReminderTime,onChange:s=>i(t=>({...t,learning:{...t.learning,studyReminderTime:s.target.value}})),className:"w-32"}),e.jsx("p",{className:"text-xs text-slate-500 mt-2",children:"Daily reminder to study"})]})]}),h==="data"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-sky-900 mb-1 font-body",children:"Download Your Data"}),e.jsx("p",{className:"text-xs text-sky-700 mb-3",children:"Export all your learning data and progress"}),e.jsxs(x,{variant:"outline",size:"sm",className:"rounded-xl",onClick:be,disabled:R,children:[e.jsx(ae,{size:16,className:"mr-2"}),R?"Exporting...":"Request Data Export"]})]}),e.jsxs("div",{className:"p-4 bg-white border border-[#dde3eb] rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Clear Cache"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-3",children:"Free up space by clearing cached data"}),e.jsx(x,{variant:"outline",size:"sm",className:"rounded-xl",onClick:pe,disabled:M,children:M?"Clearing...":"Clear Cache"})]}),e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-rose-900 mb-1",children:"Reset Progress"}),e.jsxs("p",{className:"text-xs text-rose-700 mb-3",children:[(a.role||"student")==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",a.role==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts for retesting.",a.role==="admin"&&"Reset admin testing artifacts like personal audit/content update records for QA loops."]}),e.jsx(x,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!k||j,onClick:me,children:j?"Resetting...":"Reset Testing Data"})]}),a.role==="admin"?e.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-red-900 mb-1",children:"Delete Account"}),e.jsx("p",{className:"text-xs text-red-700 mb-3",children:"Permanently delete your account and all data"}),e.jsxs(x,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:je,disabled:y,children:[e.jsx(Me,{size:16,className:"mr-2"}),y?"Deleting...":"Delete Account"]})]}):e.jsxs("div",{className:"p-4 bg-emerald-50 border border-emerald-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-emerald-900 mb-1 font-body",children:"Protected Account Controls"}),e.jsx("p",{className:"text-xs text-emerald-700",children:"Account deletion is restricted to administrator accounts."})]})]})]}),e.jsxs("div",{className:"p-6 border-t border-[#dde3eb] bg-[#edf1f7] flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-slate-500 font-body",children:"MathPulse AI v2.1.0"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"outline",onClick:I,className:"rounded-lg border-[#dde3eb]",disabled:A,children:"Cancel"}),e.jsx(x,{onClick:xe,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white",disabled:A,children:A?"Saving...":"Save Changes"})]})]})]})]})]}),de?e.jsx(E.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[130] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>{u||(g(!1),b(""),p(!1))},children:e.jsxs(E.div,{initial:{opacity:0,scale:.95,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{duration:.2},className:"w-full max-w-md rounded-2xl border border-[#dde3eb] bg-[#f7f9fc] shadow-2xl",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[e.jsx("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:"Update Password"}),e.jsx("button",{onClick:()=>{u||(g(!1),b(""),p(!1))},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close password update dialog",children:e.jsx(ne,{size:18,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Enter a new password with at least 8 characters."}),e.jsxs("div",{className:"relative",children:[e.jsx(l,{type:T?"text":"password",value:W,onChange:s=>b(s.target.value),placeholder:"New password",autoFocus:!0,className:"pr-10",onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),Z())},disabled:u}),e.jsx("button",{type:"button",onClick:()=>p(!T),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",tabIndex:-1,children:T?e.jsx(Te,{size:16}):e.jsx(Fe,{size:16})})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(x,{variant:"outline",onClick:()=>{u||(g(!1),b(""),p(!1))},disabled:u,children:"Cancel"}),e.jsx(x,{onClick:Z,className:"bg-sky-600 hover:bg-sky-700 text-white",disabled:u,children:u?"Updating...":"Update Password"})]})]})]})}):null,e.jsx(ee,{isOpen:oe,onClose:()=>{j||C(!1)},onConfirm:he,title:"Reset Testing Data?",message:`Reset ${a.role||"student"} testing data? This will clear quizzes, diagnostic assessments, assessment history, XP, and learning progress. This action is for QA/demo use and cannot be undone.`,confirmText:j?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),e.jsx(ee,{isOpen:ce,onClose:()=>{y||S(!1)},onConfirm:ye,title:"Delete Account?",message:"Delete account permanently? This action cannot be undone.",confirmText:y?"Deleting...":"Delete Account",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null};export{us as default};
 
 
 
 
 
 
 
 
 
 
 
 
assets/SettingsModal-BbkSqdYG.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{S as Se,a as Ae,b as Pe,c as Ee,d as J}from"./select-DIjxRWza.js";import{e as K,u as ze,aP as Re,aQ as Te,aR as Me,aS as Le,aT as qe,aU as De,r as Ie,S as Fe,aM as Ve,a as Oe,j as _e,m as V,L as He,aV as Ge,t as u,aW as Ue,aX as Xe,aY as Qe}from"./index-BaOs5Ayg.js";import{B as p}from"./button-DCfeFHoH.js";import{I as n}from"./input-D28h_UTJ.js";import{S as d}from"./switch-CblAJO7o.js";import me from"./ConfirmModal-6cgkqXAT.js";import{P as We,M as Be,V as Ye}from"./ProfilePictureUploader-CX_IZAwE.js";import{B as Je}from"./bell-clcSMJn6.js";import{D as he}from"./download-DX_YebqQ.js";import{X as ue}from"./x-TNvtuOD9.js";import{C as $e}from"./circle-help-B8apTIdU.js";import{C as Ke}from"./clock-D1Ecvltm.js";import{T as Ze}from"./trash-2-HTnKafZd.js";import{E as es,a as ss}from"./eye-Ig3S6mOs.js";import"./vendor-radix-BorKzPz9.js";import"./chevron-up-Cdvz2TMJ.js";import"./check-BLSo9L0H.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";import"./log-out-BenDMDly.js";import"./minus-DfrEv-SC.js";import"./plus-DkG35AoH.js";import"./upload-DayXhGwD.js";/**
2
+ * @license lucide-react v0.487.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ts=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],as=K("palette",ts);/**
7
+ * @license lucide-react v0.487.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const ns=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],is=K("server",ns);/**
12
+ * @license lucide-react v0.487.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const ls=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],rs=K("smartphone",ls),cs=()=>{const{userProfile:x,userRole:j}=ze(),[l,P]=a.useState(Re),[E,z]=a.useState(Te),[k,R]=a.useState(!1),[L,S]=a.useState(null);a.useEffect(()=>{if(!x?.uid)return;(async()=>{R(!0),S(null);try{if(j==="teacher"){const h=await qe(x.uid);P(h)}if(j==="admin"){const h=await De();z(h)}}catch(h){S(h instanceof Error?h.message:"Failed to load settings")}finally{R(!1)}})()},[x?.uid,j]);const r=a.useCallback(async w=>{if(!x?.uid)return;const h=await Me(x.uid,w);P(h)},[x?.uid]),T=a.useCallback(async w=>{const h=await Le(w);z(h)},[]);return{teacherPrefs:l,adminConfig:E,loading:k,error:L,saveTeacherPrefs:r,saveAdminConfig:T}},$=()=>JSON.parse(JSON.stringify(Ge)),Vs=({isOpen:x,onClose:j,profileData:l,onSave:P,settingsData:E,onSaveSettings:z,onApplySettingsPreview:k,onExportData:R,onClearCache:L,onResetData:S})=>{const r=l?.role||"student",{teacherPrefs:T,adminConfig:w,saveTeacherPrefs:h,saveAdminConfig:be}=cs(),[f,fe]=a.useState("account"),[o,m]=a.useState({}),[i,Z]=a.useState($()),[y,g]=a.useState(T),[v,N]=a.useState(w),[O,ee]=a.useState(!1),[q,se]=a.useState(!1),[_,te]=a.useState(!1),[H,ae]=a.useState(!1),[ne,os]=a.useState(!1),[pe,D]=a.useState(!1),[je,I]=a.useState(!1),[ye,A]=a.useState(!1),[M,ie]=a.useState(""),[b,ge]=a.useState(null),[C,le]=a.useState(!1),[G,re]=a.useState(!1),[U,ce]=a.useState(""),[F,oe]=a.useState(""),X=a.useRef(!1),Q=a.useRef($());a.useEffect(()=>{if(!x){X.current=!1;return}if(X.current)return;X.current=!0;const s=E?JSON.parse(JSON.stringify(E)):$();Q.current=s,m({uid:l?.uid,name:l?.name||"",email:l?.email||"",phone:l?.phone||"",photo:l?.photo||"",avatarLayers:l?.avatarLayers,role:l?.role,gender:l?.gender,lrn:l?.lrn||"",grade:l?.grade||"",section:l?.section||"",school:l?.school||"",department:l?.department||"",subject:l?.subject||"",yearsOfExperience:l?.yearsOfExperience||"",qualification:l?.qualification||"",position:l?.position||""}),Z(s),g(T),N(w)},[x,l,E,T,w]),a.useEffect(()=>{x&&k?.(i)},[x,i,k]),a.useEffect(()=>{if(!x)return;const s=t=>{t.key==="Escape"&&(k?.(Q.current),j())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[x,j,k]);const de=a.useMemo(()=>{const s=[{id:"account",label:"Account",icon:Ie},{id:"notifications",label:"Notifications",icon:Je},{id:"appearance",label:"Appearance",icon:as},{id:"privacy",label:"Privacy & Security",icon:Fe}];return r==="student"&&s.push({id:"learning",label:"Learning",icon:Ve}),r==="teacher"&&s.push({id:"teaching",label:"Teaching",icon:Oe}),r==="admin"&&s.push({id:"system",label:"System",icon:is}),s.push({id:"data",label:"Data & Storage",icon:he}),s},[r]),c=s=>{Z(t=>s(t))},W=s=>{ge(s),ie(""),re(!1),s==="password"&&ce(""),s==="email"&&oe(o.email||""),A(!0)},xe=async()=>{if(!M.trim()){u.error("Current password is required");return}le(!0);try{if(b==="password"){if(U.length<8){u.error("New password must be at least 8 characters");return}await Ue(M,U),u.success("Password updated")}else if(b==="email"){if(!F.includes("@")){u.error("Enter a valid email");return}await Xe(M,F),m(s=>({...s,email:F})),u.success("Email updated")}else if(b==="delete"){await Qe(M,o.uid||""),u.success("Account deleted"),j();return}A(!1)}catch(s){u.error(s instanceof Error?s.message:"Authentication failed")}finally{le(!1)}},ve=async()=>{ee(!0);try{P&&await P(o),z&&await z(i),r==="teacher"&&await h(y),r==="admin"&&await be(v),j()}catch(s){u.error(s instanceof Error?s.message:"Failed to save settings")}finally{ee(!1)}},B=()=>{A(!1),D(!1),I(!1),k?.(Q.current),j()},Ne=async()=>{if(!(!R||_)){te(!0);try{await R()}catch(s){u.error(s instanceof Error?s.message:"Failed to export data")}finally{te(!1)}}},we=async()=>{if(!(!L||H)){ae(!0);try{await L()}catch(s){u.error(s instanceof Error?s.message:"Failed to clear cache")}finally{ae(!1)}}},Ce=async()=>{if(!(!S||q)){D(!1),se(!0);try{await S(),u.success("Testing data reset completed")}catch(s){u.error(s instanceof Error?s.message:"Failed to reset testing data")}finally{se(!1)}}},ke=()=>{I(!1),W("delete")};return x?e.jsx(_e,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx(V.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:B,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(V.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-4xl max-h-[85vh] overflow-hidden flex",children:[e.jsxs("div",{className:"w-64 bg-slate-50 border-r border-slate-200 p-6 overflow-y-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-[#0a1628]",children:"Settings"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Manage your preferences"})]}),e.jsx("nav",{className:"space-y-1",children:de.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>fe(s.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${f===s.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[e.jsx(t,{size:18}),e.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id)})})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-[#dde3eb]",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628]",children:de.find(s=>s.id===f)?.label}),e.jsx("button",{onClick:B,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:e.jsx(ue,{size:20,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[f==="account"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(We,{uid:o.uid,photoURL:o.photo,displayName:o.name,onUploaded:s=>m(t=>({...t,photo:s}))}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Full Name"}),e.jsx(n,{type:"text",value:o.name||"",onChange:s=>m(t=>({...t,name:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Email Address"}),e.jsxs("div",{className:"flex items-center gap-2 max-w-md",children:[e.jsx(n,{type:"email",value:o.email||"",disabled:!0,className:"flex-1 bg-slate-100"}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>W("email"),children:"Change"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Phone Number"}),e.jsx(n,{type:"tel",value:o.phone||"",onChange:s=>m(t=>({...t,phone:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Gender"}),e.jsxs(Se,{value:o.gender||"",onValueChange:s=>m(t=>({...t,gender:s})),children:[e.jsx(Ae,{className:"max-w-md bg-white border-[#dde3eb] rounded-lg",children:e.jsx(Pe,{placeholder:"Select gender (optional)"})}),e.jsxs(Ee,{children:[e.jsx(J,{value:"male",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Be,{className:"size-4 text-blue-500"}),e.jsx("span",{children:"Male"})]})}),e.jsx(J,{value:"female",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ye,{className:"size-4 text-pink-500"}),e.jsx("span",{children:"Female"})]})}),e.jsx(J,{value:"prefer_not_to_say",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{className:"size-4 text-gray-500"}),e.jsx("span",{children:"Prefer not to say"})]})})]})]})]}),r==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"LRN"}),e.jsx(n,{value:o.lrn||"",onChange:s=>m(t=>({...t,lrn:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Grade Level"}),e.jsx(n,{value:o.grade||"",onChange:s=>m(t=>({...t,grade:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Section"}),e.jsx(n,{value:o.section||"",onChange:s=>m(t=>({...t,section:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"School"}),e.jsx(n,{value:o.school||"",onChange:s=>m(t=>({...t,school:s.target.value})),className:"max-w-md"})]})]}),r==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(n,{value:o.department||"",onChange:s=>m(t=>({...t,department:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Subject"}),e.jsx(n,{value:o.subject||"",onChange:s=>m(t=>({...t,subject:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Years of Experience"}),e.jsx(n,{value:o.yearsOfExperience||"",onChange:s=>m(t=>({...t,yearsOfExperience:s.target.value})),className:"max-w-md"})]})]}),r==="admin"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Position"}),e.jsx(n,{value:o.position||"",onChange:s=>m(t=>({...t,position:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Change Password"}),e.jsxs(p,{variant:"outline",className:"rounded-xl",onClick:()=>W("password"),children:[e.jsx(He,{size:16,className:"mr-2"}),"Update Password"]})]})]}),f==="notifications"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Email Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Receive updates via email"})]}),e.jsx(d,{checked:i.notifications.emailNotifications,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,emailNotifications:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Push Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Get notified on your device"})]}),e.jsx(d,{checked:i.notifications.pushNotifications,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,pushNotifications:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Sound Effects"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Play sounds for notifications"})]}),e.jsx(d,{checked:i.notifications.soundEnabled,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,soundEnabled:s}}))})]}),r==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Submissions"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify when students submit work"})]}),e.jsx(d,{checked:y.notifyOnSubmission,onCheckedChange:s=>g(t=>({...t,notifyOnSubmission:s}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Activity Alerts"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify on at-risk student activity"})]}),e.jsx(d,{checked:y.notifyOnStudentActivity,onCheckedChange:s=>g(t=>({...t,notifyOnStudentActivity:s}))})]})]}),e.jsxs("div",{className:"pt-4",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-3 font-body",children:"Notification Types"}),e.jsx("div",{className:"space-y-3",children:[{key:"quizReminders",label:"Quiz Reminders"},{key:"newContent",label:"New Content"},{key:"achievements",label:"Achievements"},{key:"streakAlerts",label:"Streak Alerts"},{key:"weeklySummary",label:"Weekly Summary"}].map(s=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:i.notifications.notificationTypes[s.key],onChange:t=>c(Y=>({...Y,notifications:{...Y.notifications,notificationTypes:{...Y.notifications.notificationTypes,[s.key]:t.target.checked}}})),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),e.jsx("span",{className:"text-sm text-[#0a1628] font-body",children:s.label})]},s.key))})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(Ke,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(n,{type:"time",value:i.notifications.quietHours.start,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,start:s.target.value}}})),className:"w-32"}),e.jsx("span",{className:"text-[#5a6578]",children:"to"}),e.jsx(n,{type:"time",value:i.notifications.quietHours.end,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,end:s.target.value}}})),className:"w-32"})]})]})]}),f==="appearance"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Dark Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Toggle dark theme"})]}),e.jsx(d,{checked:i.appearance.darkMode,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,darkMode:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-3 block font-body uppercase tracking-wider text-xs",children:"Font Size"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-slate-500",children:"Small"}),e.jsx("input",{type:"range",min:"12",max:"20",value:i.appearance.fontSize,onChange:s=>c(t=>({...t,appearance:{...t.appearance,fontSize:Number(s.target.value)}})),className:"flex-1"}),e.jsx("span",{className:"text-xs text-slate-500",children:"Large"}),e.jsxs("span",{className:"text-xs font-mono text-slate-600 w-8",children:[i.appearance.fontSize,"px"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Compact View"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show more content on screen"})]}),e.jsx(d,{checked:i.appearance.compactView,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,compactView:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Reduce Animations"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Minimize motion effects"})]}),e.jsx(d,{checked:i.appearance.reduceAnimations,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,reduceAnimations:s}}))})]})]}),f==="privacy"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Profile Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Who can see your profile"})]}),e.jsxs("select",{value:i.privacy.profileVisibility,onChange:s=>c(t=>({...t,privacy:{...t.privacy,profileVisibility:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[e.jsx("option",{value:"everyone",children:"Everyone"}),e.jsx("option",{value:"students_and_staff",children:"Students and Staff"}),e.jsx("option",{value:"private",children:"Private"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Activity Status"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let others see when you're online"})]}),e.jsx(d,{checked:i.privacy.showActivityStatus,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,showActivityStatus:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Data Sharing"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Share anonymous usage data"})]}),e.jsx(d,{checked:i.privacy.dataSharing,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,dataSharing:s}}))})]})]}),f==="learning"&&r==="student"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Daily XP Goal"}),e.jsx(n,{type:"number",value:i.learning.dailyXpGoal,onChange:s=>c(t=>({...t,learning:{...t.learning,dailyXpGoal:Number(s.target.value||0)}})),className:"max-w-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Preferred Study Time"}),e.jsxs("select",{value:i.learning.preferredStudyTime,onChange:s=>c(t=>({...t,learning:{...t.learning,preferredStudyTime:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"morning",children:"Morning (6AM - 12PM)"}),e.jsx("option",{value:"afternoon",children:"Afternoon (12PM - 6PM)"}),e.jsx("option",{value:"evening",children:"Evening (6PM - 12PM)"}),e.jsx("option",{value:"night",children:"Night (12AM - 6AM)"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-play Next Lesson"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically start the next lesson"})]}),e.jsx(d,{checked:i.learning.autoPlayLessons,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,autoPlayLessons:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Hints During Quizzes"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Display helpful hints for questions"})]}),e.jsx(d,{checked:i.learning.showHints,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,showHints:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Quiz Difficulty Preference"}),e.jsxs("select",{value:i.learning.quizDifficultyPreference,onChange:s=>c(t=>({...t,learning:{...t.learning,quizDifficultyPreference:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"adaptive",children:"Adaptive (Recommended)"}),e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(rs,{size:16,className:"inline mr-2"}),"Study Reminders"]}),e.jsx(n,{type:"time",value:i.learning.studyReminderTime,onChange:s=>c(t=>({...t,learning:{...t.learning,studyReminderTime:s.target.value}})),className:"w-32"})]})]}),f==="teaching"&&r==="teacher"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Quiz Defaults"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Time Limit (min)"}),e.jsx(n,{type:"number",value:y.quizDefaults.timeLimitMinutes,onChange:s=>g(t=>({...t,quizDefaults:{...t.quizDefaults,timeLimitMinutes:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Passing Score (%)"}),e.jsx(n,{type:"number",value:y.quizDefaults.passingScore,onChange:s=>g(t=>({...t,quizDefaults:{...t.quizDefaults,passingScore:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Attempts"}),e.jsx(n,{type:"number",value:y.quizDefaults.maxAttempts,onChange:s=>g(t=>({...t,quizDefaults:{...t.quizDefaults,maxAttempts:Number(s.target.value)}}))})]})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"Class Preferences"}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-Enroll Students"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically enroll new students"})]}),e.jsx(d,{checked:y.classPreferences.autoEnroll,onCheckedChange:s=>g(t=>({...t,classPreferences:{...t.classPreferences,autoEnroll:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Class Visibility"}),e.jsxs("select",{value:y.classPreferences.classVisibility,onChange:s=>g(t=>({...t,classPreferences:{...t.classPreferences,classVisibility:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[e.jsx("option",{value:"public",children:"Public"}),e.jsx("option",{value:"private",children:"Private"}),e.jsx("option",{value:"invite_only",children:"Invite Only"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Analytics Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let students see their leaderboard rank"})]}),e.jsx(d,{checked:y.studentAnalyticsVisibility,onCheckedChange:s=>g(t=>({...t,studentAnalyticsVisibility:s}))})]})]}),f==="system"&&r==="admin"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Maintenance Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Disable platform access for non-admins"})]}),e.jsx(d,{checked:v.maintenanceMode,onCheckedChange:s=>N(t=>({...t,maintenanceMode:s}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Grade Level"}),e.jsx(n,{value:v.defaultGradeLevel,onChange:s=>N(t=>({...t,defaultGradeLevel:s.target.value}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Curriculum"}),e.jsx(n,{value:v.defaultCurriculum,onChange:s=>N(t=>({...t,defaultCurriculum:s.target.value}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Class Size"}),e.jsx(n,{type:"number",value:v.maxClassSize,onChange:s=>N(t=>({...t,maxClassSize:Number(s.target.value)}))})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Audit Log Visible"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show audit logs in admin dashboard"})]}),e.jsx(d,{checked:v.auditLogVisible,onCheckedChange:s=>N(t=>({...t,auditLogVisible:s}))})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"AI Configuration"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Model Name"}),e.jsx(n,{value:v.aiConfig.modelName,onChange:s=>N(t=>({...t,aiConfig:{...t.aiConfig,modelName:s.target.value}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Temperature"}),e.jsx(n,{type:"number",step:"0.1",min:"0",max:"2",value:v.aiConfig.temperature,onChange:s=>N(t=>({...t,aiConfig:{...t.aiConfig,temperature:Number(s.target.value)}}))})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"API Endpoint"}),e.jsx(n,{value:v.aiConfig.endpoint,onChange:s=>N(t=>({...t,aiConfig:{...t.aiConfig,endpoint:s.target.value}}))})]})]})]}),f==="data"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-sky-900 mb-1 font-body",children:"Download Your Data"}),e.jsx("p",{className:"text-xs text-sky-700 mb-3",children:"Export all your learning data and progress"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:Ne,disabled:_,children:[e.jsx(he,{size:16,className:"mr-2"}),_?"Exporting...":"Request Data Export"]})]}),e.jsxs("div",{className:"p-4 bg-white border border-[#dde3eb] rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Clear Cache"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-3",children:"Free up space by clearing cached data"}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:we,disabled:H,children:H?"Clearing...":"Clear Cache"})]}),e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-rose-900 mb-1",children:"Reset Progress"}),e.jsxs("p",{className:"text-xs text-rose-700 mb-3",children:[r==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",r==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts.",r==="admin"&&"Reset admin testing artifacts like personal audit/content update records."]}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!S||q,onClick:()=>D(!0),children:q?"Resetting...":"Reset Testing Data"})]}),e.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-red-900 mb-1",children:"Delete Account"}),e.jsx("p",{className:"text-xs text-red-700 mb-3",children:"Permanently delete your account and all data"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:()=>I(!0),disabled:ne,children:[e.jsx(Ze,{size:16,className:"mr-2"}),ne?"Deleting...":"Delete Account"]})]})]})]}),e.jsxs("div",{className:"p-6 border-t border-[#dde3eb] bg-[#edf1f7] flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-slate-500 font-body",children:"MathPulse AI v2.1.0"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(p,{variant:"outline",onClick:B,className:"rounded-lg border-[#dde3eb]",disabled:O,children:"Cancel"}),e.jsx(p,{onClick:ve,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white",disabled:O,children:O?"Saving...":"Save Changes"})]})]})]})]})]}),ye&&e.jsx(V.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[130] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>{C||A(!1)},children:e.jsxs(V.div,{initial:{opacity:0,scale:.95,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{duration:.2},className:"w-full max-w-md rounded-2xl border border-[#dde3eb] bg-[#f7f9fc] shadow-2xl",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[e.jsxs("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:[b==="password"&&"Change Password",b==="email"&&"Change Email",b==="delete"&&"Delete Account"]}),e.jsx("button",{onClick:()=>{C||A(!1)},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close",children:e.jsx(ue,{size:18,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Enter your current password to continue."}),e.jsxs("div",{className:"relative",children:[e.jsx(n,{type:G?"text":"password",value:M,onChange:s=>ie(s.target.value),placeholder:"Current password",autoFocus:!0,className:"pr-10",disabled:C,onKeyDown:s=>{s.key==="Enter"&&xe()}}),e.jsx("button",{type:"button",onClick:()=>re(!G),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:G?e.jsx(es,{size:16}):e.jsx(ss,{size:16})})]}),b==="password"&&e.jsx("div",{className:"relative",children:e.jsx(n,{type:"password",value:U,onChange:s=>ce(s.target.value),placeholder:"New password (min 8 chars)",disabled:C})}),b==="email"&&e.jsx(n,{type:"email",value:F,onChange:s=>oe(s.target.value),placeholder:"New email address",disabled:C}),b==="delete"&&e.jsx("p",{className:"text-sm text-red-600 font-medium",children:"This action is permanent and cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{variant:"outline",onClick:()=>A(!1),disabled:C,children:"Cancel"}),e.jsx(p,{onClick:()=>void xe(),className:b==="delete"?"bg-red-600 hover:bg-red-700 text-white":"bg-sky-600 hover:bg-sky-700 text-white",disabled:C,children:C?"Processing...":b==="delete"?"Delete Forever":"Confirm"})]})]})]})}),e.jsx(me,{isOpen:pe,onClose:()=>D(!1),onConfirm:Ce,title:"Reset Testing Data?",message:`Reset ${r} testing data? This will clear quizzes, diagnostic assessments, assessment history, XP, and learning progress. This action cannot be undone.`,confirmText:q?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),e.jsx(me,{isOpen:je,onClose:()=>I(!1),onConfirm:ke,title:"Delete Account?",message:"You will need to re-authenticate to permanently delete your account. This cannot be undone.",confirmText:"Continue",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null};export{Vs as default};
assets/{Sidebar-C2ctPQQf.js β†’ Sidebar-2LZAqf7E.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as p,j as e}from"./vendor-react-B4AQeu28.js";import{S as N,a as $,L as u,M as P}from"./LogoutActionButton-Cb7v3MhK.js";import{e as D,m as c,i as G,U as S,G as M,a as f,S as U,P as _,x as q}from"./index-Cb8VeSuW.js";import{T as L,a as C,b as A}from"./tooltip-BY91VKdD.js";import{X as F}from"./x-CTLBAl-n.js";import{C as Q}from"./chevron-right-CoVWpXdD.js";import{C as W}from"./chevron-left-CZaM7nZW.js";import{C as z}from"./chart-column-CmH46HAG.js";import{S as X}from"./shirt-CrJtkYx3.js";import"./log-out-CM6AS10M.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{r as p,j as e}from"./vendor-react-B4AQeu28.js";import{S as N,a as $,L as u,M as P}from"./LogoutActionButton-lUNItet6.js";import{e as D,m as c,i as G,U as S,G as M,a as f,S as U,P as _,x as q}from"./index-BaOs5Ayg.js";import{T as L,a as C,b as A}from"./tooltip-ChRIOid3.js";import{X as F}from"./x-TNvtuOD9.js";import{C as Q}from"./chevron-right-COqGruhh.js";import{C as W}from"./chevron-left-BWpgclqc.js";import{C as z}from"./chart-column-B3jJOD5i.js";import{S as X}from"./shirt-S3NBuaPm.js";import"./log-out-BenDMDly.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{SupplementalBanner-bYee7ru9.js β†’ SupplementalBanner-DFkcXPOZ.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,r as j}from"./vendor-react-B4AQeu28.js";import{j as y,m as p,p as h,a as f,T as m,B as x}from"./index-Cb8VeSuW.js";import{X as v}from"./x-CTLBAl-n.js";import{S as w}from"./sparkles-v8V3LFaV.js";import{C as g}from"./chevron-right-CoVWpXdD.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const b={"General Mathematics":[{label:"Functions Deep Dive",description:"Interactive review of function types and graphs",icon:e.jsx(m,{size:14})},{label:"Business Math Basics",description:"Simple & compound interest practice",icon:e.jsx(f,{size:14})}],"Statistics and Probability":[{label:"Distribution Visualizer",description:"Explore normal distribution curves",icon:e.jsx(m,{size:14})},{label:"Hypothesis Practice",description:"Step-by-step hypothesis testing",icon:e.jsx(x,{size:14})}],"Pre-Calculus":[{label:"Conic Sections Explorer",description:"Visual parabola, ellipse, hyperbola tool",icon:e.jsx(m,{size:14})},{label:"Trig Identity Practice",description:"Identity verification drill set",icon:e.jsx(x,{size:14})}],"Basic Calculus":[{label:"Limits Visualizer",description:"Graphical approach to limits",icon:e.jsx(m,{size:14})},{label:"Derivative Rules Drill",description:"Practice chain rule & implicit diff",icon:e.jsx(x,{size:14})}]};function u(i){const s=i.toLowerCase();return s==="functions"||s.includes("function")||s==="businessmath"||s.includes("business")||s==="logic"||s.includes("reason")||s.includes("general")||s.includes("gen-math")||s.includes("gen math")?"General Mathematics":s.includes("stat")||s.includes("prob")?"Statistics and Probability":s.includes("pre-calc")||s.includes("pre calc")||s.includes("precalc")?"Pre-Calculus":s.includes("basic")||s.includes("calc")?"Basic Calculus":null}function N(i){const s=i.trim().toLowerCase();return s==="functions"?"Functions and Graphs":s==="businessmath"?"Business and Financial Mathematics":s==="logic"?"Logic and Reasoning":i}const k=({atRiskSubjects:i=[],onAction:s,onDismiss:n})=>{const[l,a]=j.useState(!1);if(l||i.length===0)return null;const r=()=>{a(!0),n?.()};return e.jsx(y,{children:!l&&e.jsx(p.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-10,height:0},className:"overflow-hidden",children:e.jsxs("div",{className:"relative bg-gradient-to-r from-sky-600 via-sky-500 to-sky-600 rounded-2xl p-5 text-white shadow-lg shadow-sky-500/20",children:[e.jsx("button",{onClick:r,className:"absolute top-3 right-3 w-7 h-7 bg-white/20 hover:bg-white/30 rounded-full flex items-center justify-center transition-colors",children:e.jsx(v,{size:14})}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center flex-shrink-0",children:e.jsx(w,{size:24})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-bold text-lg mb-1",children:"Supplemental Materials Available"}),e.jsx("p",{className:"text-sky-100 text-sm mb-3",children:"Based on your diagnostic assessment, we've identified topics that could use extra practice. Strengthening these areas will improve your overall performance."}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:i.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full text-xs font-semibold",children:[e.jsx(h,{size:12}),N(t)]},t))}),e.jsxs("button",{onClick:s,className:"inline-flex items-center gap-2 bg-white text-sky-600 font-bold text-sm px-4 py-2 rounded-xl hover:bg-sky-50 transition-colors",children:["Review Topics",e.jsx(g,{size:16})]})]})]})]})})})},z=({quizSubject:i,atRiskSubjects:s=[]})=>{const n=i?u(i):null;if(!s.some(r=>{const t=u(r);return t&&t===n})||!n)return null;const a=b[n]||[];return e.jsx(p.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mb-4 overflow-hidden",children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(h,{size:14,className:"text-rose-600"}),e.jsxs("span",{className:"text-xs font-bold text-rose-800",children:["Supplemental Focus Area β€” ",n]})]}),e.jsx("p",{className:"text-xs text-rose-700 mb-2",children:"This topic was flagged in your diagnostic. Take your time and review the explanations carefully."}),a.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.slice(0,2).map((r,t)=>e.jsxs("span",{className:"inline-flex items-center gap-1 bg-rose-100 text-rose-700 px-2 py-0.5 rounded-md text-xs font-medium",children:[r.icon,r.label]},t))})]})})},C=({quizSubject:i,quizScore:s=0,atRiskSubjects:n=[],onAction:l})=>{const a=i?u(i):null,r=n.some(c=>{const d=u(c);return d&&d===a});if(s>=70&&!r)return null;const t=a?b[a]||[]:[],o=s<70;return e.jsx(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-4",children:e.jsx("div",{className:`rounded-2xl p-4 border-2 ${o?"bg-orange-50 border-orange-200":"bg-sky-50 border-sky-200"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${o?"bg-orange-500":"bg-sky-500"}`,children:e.jsx(f,{size:20,className:"text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-display font-bold text-[#0a1628] text-sm mb-1",children:o?"Review Recommended":"Supplemental Materials"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2",children:o?`You scored ${s}% on this quiz. We recommend reviewing the following resources to strengthen your understanding.`:"This topic was identified as an area for growth. Check out these additional resources."}),t.length>0&&e.jsx("div",{className:"space-y-1.5 mb-3",children:t.map((c,d)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center ${o?"bg-orange-100 text-orange-600":"bg-sky-100 text-sky-600"}`,children:c.icon}),e.jsx("span",{className:"font-medium text-[#0a1628]",children:c.label}),e.jsxs("span",{className:"text-slate-500",children:["β€” ",c.description]})]},d))}),l&&e.jsxs("button",{onClick:l,className:`inline-flex items-center gap-1.5 text-xs font-bold px-3 py-1.5 rounded-lg transition-colors ${o?"bg-orange-500 hover:bg-orange-600 text-white":"bg-sky-500 hover:bg-sky-600 text-white"}`,children:["Review Topics",e.jsx(g,{size:12})]})]})]})})})},I=i=>{switch(i.variant){case"compact":return e.jsx(z,{...i});case"results":return e.jsx(C,{...i});case"full":default:return e.jsx(k,{...i})}};export{I as default};
 
1
+ import{j as e,r as j}from"./vendor-react-B4AQeu28.js";import{j as y,m as p,p as h,a as f,T as m,B as x}from"./index-BaOs5Ayg.js";import{X as v}from"./x-TNvtuOD9.js";import{S as w}from"./sparkles-By-vFjpv.js";import{C as g}from"./chevron-right-COqGruhh.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const b={"General Mathematics":[{label:"Functions Deep Dive",description:"Interactive review of function types and graphs",icon:e.jsx(m,{size:14})},{label:"Business Math Basics",description:"Simple & compound interest practice",icon:e.jsx(f,{size:14})}],"Statistics and Probability":[{label:"Distribution Visualizer",description:"Explore normal distribution curves",icon:e.jsx(m,{size:14})},{label:"Hypothesis Practice",description:"Step-by-step hypothesis testing",icon:e.jsx(x,{size:14})}],"Pre-Calculus":[{label:"Conic Sections Explorer",description:"Visual parabola, ellipse, hyperbola tool",icon:e.jsx(m,{size:14})},{label:"Trig Identity Practice",description:"Identity verification drill set",icon:e.jsx(x,{size:14})}],"Basic Calculus":[{label:"Limits Visualizer",description:"Graphical approach to limits",icon:e.jsx(m,{size:14})},{label:"Derivative Rules Drill",description:"Practice chain rule & implicit diff",icon:e.jsx(x,{size:14})}]};function u(i){const s=i.toLowerCase();return s==="functions"||s.includes("function")||s==="businessmath"||s.includes("business")||s==="logic"||s.includes("reason")||s.includes("general")||s.includes("gen-math")||s.includes("gen math")?"General Mathematics":s.includes("stat")||s.includes("prob")?"Statistics and Probability":s.includes("pre-calc")||s.includes("pre calc")||s.includes("precalc")?"Pre-Calculus":s.includes("basic")||s.includes("calc")?"Basic Calculus":null}function N(i){const s=i.trim().toLowerCase();return s==="functions"?"Functions and Graphs":s==="businessmath"?"Business and Financial Mathematics":s==="logic"?"Logic and Reasoning":i}const k=({atRiskSubjects:i=[],onAction:s,onDismiss:n})=>{const[l,a]=j.useState(!1);if(l||i.length===0)return null;const r=()=>{a(!0),n?.()};return e.jsx(y,{children:!l&&e.jsx(p.div,{initial:{opacity:0,y:-10,height:0},animate:{opacity:1,y:0,height:"auto"},exit:{opacity:0,y:-10,height:0},className:"overflow-hidden",children:e.jsxs("div",{className:"relative bg-gradient-to-r from-sky-600 via-sky-500 to-sky-600 rounded-2xl p-5 text-white shadow-lg shadow-sky-500/20",children:[e.jsx("button",{onClick:r,className:"absolute top-3 right-3 w-7 h-7 bg-white/20 hover:bg-white/30 rounded-full flex items-center justify-center transition-colors",children:e.jsx(v,{size:14})}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-xl flex items-center justify-center flex-shrink-0",children:e.jsx(w,{size:24})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"font-bold text-lg mb-1",children:"Supplemental Materials Available"}),e.jsx("p",{className:"text-sky-100 text-sm mb-3",children:"Based on your diagnostic assessment, we've identified topics that could use extra practice. Strengthening these areas will improve your overall performance."}),e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:i.map(t=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full text-xs font-semibold",children:[e.jsx(h,{size:12}),N(t)]},t))}),e.jsxs("button",{onClick:s,className:"inline-flex items-center gap-2 bg-white text-sky-600 font-bold text-sm px-4 py-2 rounded-xl hover:bg-sky-50 transition-colors",children:["Review Topics",e.jsx(g,{size:16})]})]})]})]})})})},z=({quizSubject:i,atRiskSubjects:s=[]})=>{const n=i?u(i):null;if(!s.some(r=>{const t=u(r);return t&&t===n})||!n)return null;const a=b[n]||[];return e.jsx(p.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mb-4 overflow-hidden",children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(h,{size:14,className:"text-rose-600"}),e.jsxs("span",{className:"text-xs font-bold text-rose-800",children:["Supplemental Focus Area β€” ",n]})]}),e.jsx("p",{className:"text-xs text-rose-700 mb-2",children:"This topic was flagged in your diagnostic. Take your time and review the explanations carefully."}),a.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.slice(0,2).map((r,t)=>e.jsxs("span",{className:"inline-flex items-center gap-1 bg-rose-100 text-rose-700 px-2 py-0.5 rounded-md text-xs font-medium",children:[r.icon,r.label]},t))})]})})},C=({quizSubject:i,quizScore:s=0,atRiskSubjects:n=[],onAction:l})=>{const a=i?u(i):null,r=n.some(c=>{const d=u(c);return d&&d===a});if(s>=70&&!r)return null;const t=a?b[a]||[]:[],o=s<70;return e.jsx(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-4",children:e.jsx("div",{className:`rounded-2xl p-4 border-2 ${o?"bg-orange-50 border-orange-200":"bg-sky-50 border-sky-200"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${o?"bg-orange-500":"bg-sky-500"}`,children:e.jsx(f,{size:20,className:"text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-display font-bold text-[#0a1628] text-sm mb-1",children:o?"Review Recommended":"Supplemental Materials"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2",children:o?`You scored ${s}% on this quiz. We recommend reviewing the following resources to strengthen your understanding.`:"This topic was identified as an area for growth. Check out these additional resources."}),t.length>0&&e.jsx("div",{className:"space-y-1.5 mb-3",children:t.map((c,d)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center ${o?"bg-orange-100 text-orange-600":"bg-sky-100 text-sky-600"}`,children:c.icon}),e.jsx("span",{className:"font-medium text-[#0a1628]",children:c.label}),e.jsxs("span",{className:"text-slate-500",children:["β€” ",c.description]})]},d))}),l&&e.jsxs("button",{onClick:l,className:`inline-flex items-center gap-1.5 text-xs font-bold px-3 py-1.5 rounded-lg transition-colors ${o?"bg-orange-500 hover:bg-orange-600 text-white":"bg-sky-500 hover:bg-sky-600 text-white"}`,children:["Review Topics",e.jsx(g,{size:12})]})]})]})})})},I=i=>{switch(i.variant){case"compact":return e.jsx(z,{...i});case"results":return e.jsx(C,{...i});case"full":default:return e.jsx(k,{...i})}};export{I as default};
assets/{SupplementalPillCarousel-Bvno07XP.js β†’ SupplementalPillCarousel-BqNTelmK.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{m as f,p as x}from"./index-Cb8VeSuW.js";import{C as n}from"./chevron-right-CoVWpXdD.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const o={pillBg:"#E9D5FF",pillText:"#6B21A8",headerText:"#1F2937",arrowBg:"#F3F4F6"},b={functions:"Functions & Graphs",businessmath:"Business Math",logic:"Logic & Reasoning",statistics:"Statistics",probability:"Probability",precalc:"Pre-Calculus",calculus:"Basic Calculus",geometry:"Geometry",trigonometry:"Trigonometry",algebra:"Algebra"};function g(t){const s=t.toLowerCase().trim();return b[s]||t.split(/[-_]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join(" ")}const L=({atRiskSubjects:t=[],onTopicClick:s})=>{const l=a.useRef(null),[c,m]=a.useState(!1);if(t.length===0)return null;const h=()=>{if(l.current){const{scrollLeft:r,scrollWidth:i,clientWidth:d}=l.current;m(r+d<i-10)}},p=r=>{s?.(r)},u=()=>{l.current&&l.current.scrollBy({left:200,behavior:"smooth"})};return e.jsxs(f.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"mb-4",children:[e.jsx("h3",{className:"text-base font-bold mb-3",style:{color:o.headerText},children:"Recommended for Review"}),e.jsxs("div",{className:"relative flex items-center",children:[e.jsx("div",{ref:l,onScroll:h,className:"flex gap-2 overflow-x-auto scrollbar-hide pb-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t.slice(0,8).map((r,i)=>e.jsxs("button",{onClick:()=>p(r),className:"flex items-center gap-1.5 px-4 py-2 rounded-full text-sm font-semibold transition-all hover:scale-[1.02] whitespace-nowrap",style:{backgroundColor:o.pillBg,color:o.pillText},children:[e.jsx(x,{size:14}),g(r),e.jsx(n,{size:14})]},`${r}-${i}`))}),c&&e.jsx("button",{onClick:u,className:"flex-shrink-0 ml-2 w-8 h-8 rounded-full flex items-center justify-center transition-colors",style:{backgroundColor:o.arrowBg},"aria-label":"Scroll right",children:e.jsx(n,{size:16,className:"text-gray-600"})})]}),e.jsx("style",{children:`
2
  .scrollbar-hide::-webkit-scrollbar {
3
  display: none;
4
  }
 
1
+ import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{m as f,p as x}from"./index-BaOs5Ayg.js";import{C as n}from"./chevron-right-COqGruhh.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const o={pillBg:"#E9D5FF",pillText:"#6B21A8",headerText:"#1F2937",arrowBg:"#F3F4F6"},b={functions:"Functions & Graphs",businessmath:"Business Math",logic:"Logic & Reasoning",statistics:"Statistics",probability:"Probability",precalc:"Pre-Calculus",calculus:"Basic Calculus",geometry:"Geometry",trigonometry:"Trigonometry",algebra:"Algebra"};function g(t){const s=t.toLowerCase().trim();return b[s]||t.split(/[-_]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join(" ")}const L=({atRiskSubjects:t=[],onTopicClick:s})=>{const l=a.useRef(null),[c,m]=a.useState(!1);if(t.length===0)return null;const h=()=>{if(l.current){const{scrollLeft:r,scrollWidth:i,clientWidth:d}=l.current;m(r+d<i-10)}},p=r=>{s?.(r)},u=()=>{l.current&&l.current.scrollBy({left:200,behavior:"smooth"})};return e.jsxs(f.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"mb-4",children:[e.jsx("h3",{className:"text-base font-bold mb-3",style:{color:o.headerText},children:"Recommended for Review"}),e.jsxs("div",{className:"relative flex items-center",children:[e.jsx("div",{ref:l,onScroll:h,className:"flex gap-2 overflow-x-auto scrollbar-hide pb-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t.slice(0,8).map((r,i)=>e.jsxs("button",{onClick:()=>p(r),className:"flex items-center gap-1.5 px-4 py-2 rounded-full text-sm font-semibold transition-all hover:scale-[1.02] whitespace-nowrap",style:{backgroundColor:o.pillBg,color:o.pillText},children:[e.jsx(x,{size:14}),g(r),e.jsx(n,{size:14})]},`${r}-${i}`))}),c&&e.jsx("button",{onClick:u,className:"flex-shrink-0 ml-2 w-8 h-8 rounded-full flex items-center justify-center transition-colors",style:{backgroundColor:o.arrowBg},"aria-label":"Scroll right",children:e.jsx(n,{size:16,className:"text-gray-600"})})]}),e.jsx("style",{children:`
2
  .scrollbar-hide::-webkit-scrollbar {
3
  display: none;
4
  }
assets/{TeacherDashboard-CzDqNb42.js β†’ TeacherDashboard-CZdYfdg9.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/{XPNotification-DZv3ypM9.js β†’ XPNotification-DRsFdUWw.js} RENAMED
@@ -1 +1 @@
1
- import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{j as n,m as i,X as m}from"./index-Cb8VeSuW.js";import{S as c}from"./sparkles-v8V3LFaV.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const b=({xp:r,message:a,show:t,onComplete:s})=>(l.useEffect(()=>{if(t){const o=setTimeout(()=>{s()},3e3);return()=>clearTimeout(o)}},[t,s]),e.jsx(n,{children:t&&e.jsx(i.div,{initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"fixed top-8 left-1/2 -translate-x-1/2 z-50",style:{willChange:"transform, opacity"},children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-400 via-orange-500 to-rose-500 text-white px-6 py-4 rounded-2xl shadow-2xl border-2 border-rose-300 flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(m,{size:20,className:"text-white",fill:"currentColor"})}),e.jsx(i.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},style:{willChange:"transform"},children:e.jsx(c,{size:16,className:"text-rose-200"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:a}),e.jsxs("p",{className:"text-2xl font-black",children:["+",r," XP"]})]})]})})}));export{b as default};
 
1
+ import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{j as n,m as i,X as m}from"./index-BaOs5Ayg.js";import{S as c}from"./sparkles-By-vFjpv.js";import"./vendor-firebase-firestore-CH1lNiRF.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const b=({xp:r,message:a,show:t,onComplete:s})=>(l.useEffect(()=>{if(t){const o=setTimeout(()=>{s()},3e3);return()=>clearTimeout(o)}},[t,s]),e.jsx(n,{children:t&&e.jsx(i.div,{initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"fixed top-8 left-1/2 -translate-x-1/2 z-50",style:{willChange:"transform, opacity"},children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-400 via-orange-500 to-rose-500 text-white px-6 py-4 rounded-2xl shadow-2xl border-2 border-rose-300 flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(m,{size:20,className:"text-white",fill:"currentColor"})}),e.jsx(i.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},style:{willChange:"transform"},children:e.jsx(c,{size:16,className:"text-rose-200"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:a}),e.jsxs("p",{className:"text-2xl font-black",children:["+",r," XP"]})]})]})})}));export{b as default};
assets/{automationService-BxQhaGqB.js β†’ automationService-7m3RFJA3.js} RENAMED
@@ -1 +1 @@
1
- import{doc as g,collection as a,serverTimestamp as c,setDoc as l,addDoc as D,query as z,where as b,getDocs as A,updateDoc as C,writeBatch as Q}from"./vendor-firebase-firestore-CH1lNiRF.js";import{f as r,aS as $}from"./index-Cb8VeSuW.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const m=async(e,n,o,u,i)=>{try{const t=g(a(r,"notifications")),s={id:t.id,userId:e,type:n,title:o,message:u,read:!1,...i?{actionUrl:i}:{},createdAt:new Date},d={id:s.id,userId:s.userId,type:s.type,title:s.title,message:s.message,read:s.read,createdAt:c(),link:i||null};return await l(t,{...d}),s}catch(t){throw console.error("Error creating notification:",t),t}};async function E(e){if(!e)return 0;const n=a(r,"deepDiagnosticAssignments"),o=z(n,b("lrn","==",e));return(await A(o)).docs.filter(i=>{const t=i.data().status;return t==="pending"||t==="queued"||t==="in_progress"||t==="expired"}).length}async function M(e,n,o="Grade 11",u,i="iar_only",t="initial_assessment"){if(t==="followup_diagnostic"){const s=a(r,"deepDiagnosticAssignments"),d=z(s,b("lrn","==",e)),f=await A(d);if(!f.empty){const p=Q(r);let w=!1;for(const h of f.docs){const I=h.data().status;(I==="pending"||I==="queued")&&(p.update(h.ref,{status:"in_progress",startedAt:c()}),w=!0)}w&&await p.commit()}}return await l(g(r,"diagnosticResults",e),{lrn:e,results:n,gradeLevel:o,workflowMode:i,assessmentType:t,questionBreakdown:u||null,completedAt:c(),processed:!1,processing:!1}),{success:!0,event:"diagnostic_completed",lrn:e,message:`Diagnostic submitted for ${e}. Processing will begin automatically.`,remedialQuizzesCreated:0,notifications:["Your diagnostic results are being processed. Check back shortly!"]}}async function x(e){return await D(a(r,"quizResults"),{lrn:e.lrn,studentId:e.lrn,quizId:e.quizId,subject:e.subject,score:e.score,totalQuestions:e.totalQuestions,correctAnswers:e.correctAnswers,timeSpentSeconds:e.timeSpentSeconds,answers:e.answers||null,submittedAt:c()}),{success:!0,event:"quiz_submitted",lrn:e.lrn,message:`Quiz submitted for ${e.lrn}. Risk recalculation will run automatically.`,remedialQuizzesCreated:0,notifications:[`Quiz result recorded for ${e.subject}.`]}}async function N(e){return await $(e.lrn),await m(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await m(e.teacherId,"message","New Student Enrolled",`${e.name} has joined. Diagnostic assessment is pending.`),{success:!0,event:"student_enrolled",lrn:e.lrn,message:`Student ${e.name} enrolled and initialised`,remedialQuizzesCreated:0,notifications:[`Welcome ${e.name}! Please complete the diagnostic assessment.`]}}async function W(e){return await D(a(r,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:c(),processed:!1}),await m(e.teacherId,"message","Data Import Processed",`Data import complete β€” ${e.students.length} student records processed.`),{success:!0,event:"data_imported",message:`Data import processed for ${e.students.length} students`,remedialQuizzesCreated:0,notifications:[`Data import complete β€” ${e.students.length} student records processed.`]}}async function G(e){const n=g(r,"curriculumContent",e.contentId);return e.action==="delete"?await C(n,{deleted:!0,deletedBy:e.adminId,deletedAt:c(),contentType:e.contentType,subjectId:e.subjectId||null}):await l(n,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:c()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}export{E as getPendingDeepDiagnosticCount,G as triggerContentUpdated,W as triggerDataImported,M as triggerDiagnosticCompleted,x as triggerQuizSubmitted,N as triggerStudentEnrolled};
 
1
+ import{doc as g,collection as a,serverTimestamp as c,setDoc as l,addDoc as D,query as z,where as b,getDocs as A,updateDoc as C,writeBatch as Q}from"./vendor-firebase-firestore-CH1lNiRF.js";import{f as r,a$ as $}from"./index-BaOs5Ayg.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const m=async(e,n,o,u,i)=>{try{const t=g(a(r,"notifications")),s={id:t.id,userId:e,type:n,title:o,message:u,read:!1,...i?{actionUrl:i}:{},createdAt:new Date},d={id:s.id,userId:s.userId,type:s.type,title:s.title,message:s.message,read:s.read,createdAt:c(),link:i||null};return await l(t,{...d}),s}catch(t){throw console.error("Error creating notification:",t),t}};async function E(e){if(!e)return 0;const n=a(r,"deepDiagnosticAssignments"),o=z(n,b("lrn","==",e));return(await A(o)).docs.filter(i=>{const t=i.data().status;return t==="pending"||t==="queued"||t==="in_progress"||t==="expired"}).length}async function M(e,n,o="Grade 11",u,i="iar_only",t="initial_assessment"){if(t==="followup_diagnostic"){const s=a(r,"deepDiagnosticAssignments"),d=z(s,b("lrn","==",e)),f=await A(d);if(!f.empty){const p=Q(r);let w=!1;for(const h of f.docs){const I=h.data().status;(I==="pending"||I==="queued")&&(p.update(h.ref,{status:"in_progress",startedAt:c()}),w=!0)}w&&await p.commit()}}return await l(g(r,"diagnosticResults",e),{lrn:e,results:n,gradeLevel:o,workflowMode:i,assessmentType:t,questionBreakdown:u||null,completedAt:c(),processed:!1,processing:!1}),{success:!0,event:"diagnostic_completed",lrn:e,message:`Diagnostic submitted for ${e}. Processing will begin automatically.`,remedialQuizzesCreated:0,notifications:["Your diagnostic results are being processed. Check back shortly!"]}}async function x(e){return await D(a(r,"quizResults"),{lrn:e.lrn,studentId:e.lrn,quizId:e.quizId,subject:e.subject,score:e.score,totalQuestions:e.totalQuestions,correctAnswers:e.correctAnswers,timeSpentSeconds:e.timeSpentSeconds,answers:e.answers||null,submittedAt:c()}),{success:!0,event:"quiz_submitted",lrn:e.lrn,message:`Quiz submitted for ${e.lrn}. Risk recalculation will run automatically.`,remedialQuizzesCreated:0,notifications:[`Quiz result recorded for ${e.subject}.`]}}async function N(e){return await $(e.lrn),await m(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await m(e.teacherId,"message","New Student Enrolled",`${e.name} has joined. Diagnostic assessment is pending.`),{success:!0,event:"student_enrolled",lrn:e.lrn,message:`Student ${e.name} enrolled and initialised`,remedialQuizzesCreated:0,notifications:[`Welcome ${e.name}! Please complete the diagnostic assessment.`]}}async function W(e){return await D(a(r,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:c(),processed:!1}),await m(e.teacherId,"message","Data Import Processed",`Data import complete β€” ${e.students.length} student records processed.`),{success:!0,event:"data_imported",message:`Data import processed for ${e.students.length} students`,remedialQuizzesCreated:0,notifications:[`Data import complete β€” ${e.students.length} student records processed.`]}}async function G(e){const n=g(r,"curriculumContent",e.contentId);return e.action==="delete"?await C(n,{deleted:!0,deletedBy:e.adminId,deletedAt:c(),contentType:e.contentType,subjectId:e.subjectId||null}):await l(n,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:c()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}export{E as getPendingDeepDiagnosticCount,G as triggerContentUpdated,W as triggerDataImported,M as triggerDiagnosticCompleted,x as triggerQuizSubmitted,N as triggerStudentEnrolled};
assets/{bell-DsHB20Hc.js β†’ bell-clcSMJn6.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{button-De2q2xHf.js β†’ button-DCfeFHoH.js} RENAMED
@@ -1 +1 @@
1
- import{j as y}from"./vendor-react-B4AQeu28.js";import{S as k}from"./vendor-radix-BorKzPz9.js";import{c as V}from"./vendor-charts-D8hf8tI0.js";import{i as p}from"./index-Cb8VeSuW.js";const g=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,m=V,j=(n,r)=>e=>{var o;if(r?.variants==null)return m(n,e?.class,e?.className);const{variants:u,defaultVariants:i}=r,b=Object.keys(u).map(t=>{const a=e?.[t],d=i?.[t];if(a===null)return null;const s=g(a)||g(d);return u[t][s]}),v=e&&Object.entries(e).reduce((t,a)=>{let[d,s]=a;return s===void 0||(t[d]=s),t},{}),f=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((t,a)=>{let{class:d,className:s,...h}=a;return Object.entries(h).every(x=>{let[c,l]=x;return Array.isArray(l)?l.includes({...i,...v}[c]):{...i,...v}[c]===l})?[...t,d,s]:t},[]);return m(n,b,f,e?.class,e?.className)},N=j("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}});function w({className:n,variant:r,size:e,asChild:o=!1,...u}){const i=o?k:"button";return y.jsx(i,{"data-slot":"button",className:p(N({variant:r,size:e,className:n})),...u})}export{w as B,j as c};
 
1
+ import{j as y}from"./vendor-react-B4AQeu28.js";import{S as k}from"./vendor-radix-BorKzPz9.js";import{c as V}from"./vendor-charts-D8hf8tI0.js";import{i as p}from"./index-BaOs5Ayg.js";const g=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,m=V,j=(n,r)=>e=>{var o;if(r?.variants==null)return m(n,e?.class,e?.className);const{variants:u,defaultVariants:i}=r,b=Object.keys(u).map(t=>{const a=e?.[t],d=i?.[t];if(a===null)return null;const s=g(a)||g(d);return u[t][s]}),v=e&&Object.entries(e).reduce((t,a)=>{let[d,s]=a;return s===void 0||(t[d]=s),t},{}),f=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((t,a)=>{let{class:d,className:s,...h}=a;return Object.entries(h).every(x=>{let[c,l]=x;return Array.isArray(l)?l.includes({...i,...v}[c]):{...i,...v}[c]===l})?[...t,d,s]:t},[]);return m(n,b,f,e?.class,e?.className)},N=j("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}});function w({className:n,variant:r,size:e,asChild:o=!1,...u}){const i=o?k:"button";return y.jsx(i,{"data-slot":"button",className:p(N({variant:r,size:e,className:n})),...u})}export{w as B,j as c};
assets/{card-DXoGKpl1.js β†’ card-D4dmQVNb.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as o,i as r}from"./index-Cb8VeSuW.js";import{j as e}from"./vendor-react-B4AQeu28.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as o,i as r}from"./index-BaOs5Ayg.js";import{j as e}from"./vendor-react-B4AQeu28.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{chart-column-CmH46HAG.js β†’ chart-column-B3jJOD5i.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as t}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as t}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{chatService-D-gdHYgQ.js β†’ chatService-DwVkLoat.js} RENAMED
@@ -1 +1 @@
1
- import{doc as c,collection as u,getDoc as g,serverTimestamp as i,setDoc as w,updateDoc as p,query as l,where as d,orderBy as y,getDocs as A}from"./vendor-firebase-firestore-CH1lNiRF.js";import{f as a}from"./index-Cb8VeSuW.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const Q=async(s,t="New Conversation")=>{try{const e=c(u(a,"chatSessions")),n={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...n,createdAt:i(),updatedAt:i()}),n}catch(e){throw console.error("Error creating chat session:",e),e}},R=async s=>{try{const t=l(u(a,"chatSessions"),d("userId","==",s),d("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(n=>{const r=n.data();return{...r,createdAt:r.createdAt?.toDate()||new Date,updatedAt:r.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},b=async s=>{try{const t=await g(c(a,"chatSessions",s));if(t.exists()){const e=t.data();return{...e,createdAt:e.createdAt?.toDate()||new Date,updatedAt:e.updatedAt?.toDate()||new Date}}return null}catch(t){return console.error("Error getting chat session:",t),null}},q=async(s,t,e,n)=>{try{const r=c(u(a,"chatMessages")),o={id:r.id,userId:"",role:t,content:e,timestamp:new Date,...n?{context:n}:{}},m=await g(c(a,"chatSessions",s));m.exists()&&(o.userId=m.data().userId);const h={id:o.id,userId:o.userId,role:o.role,content:o.content,sessionId:s,timestamp:i()};return o.context&&(h.context=o.context),await w(r,h),await p(c(a,"chatSessions",s),{updatedAt:i()}),o}catch(r){throw console.error("Error adding message:",r),r}},B=async(s,t)=>{try{const e=l(u(a,"chatMessages"),d("sessionId","==",s),d("userId","==",t),y("timestamp","asc"));return(await A(e)).docs.map(r=>{const o=r.data();return{...o,timestamp:o.timestamp?.toDate()||new Date}})}catch(e){return console.error("Error getting session messages:",e),[]}},N=async(s,t)=>{try{await p(c(a,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},U=async s=>{try{await p(c(a,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{q as addMessageToSession,Q as createChatSession,U as deleteSession,b as getChatSession,B as getSessionMessages,R as getUserChatSessions,N as updateSessionTitle};
 
1
+ import{doc as c,collection as u,getDoc as g,serverTimestamp as i,setDoc as w,updateDoc as p,query as l,where as d,orderBy as y,getDocs as A}from"./vendor-firebase-firestore-CH1lNiRF.js";import{f as a}from"./index-BaOs5Ayg.js";import"./vendor-firebase-core-CO26nNq6.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-BLpRW_zO.js";import"./vendor-firebase-storage-B3igpVVS.js";import"./vendor-firebase-analytics-CTiUNb0-.js";import"./vendor-radix-BorKzPz9.js";import"./vendor-charts-D8hf8tI0.js";import"./vendor-markdown-yqZQ_iQm.js";const Q=async(s,t="New Conversation")=>{try{const e=c(u(a,"chatSessions")),n={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...n,createdAt:i(),updatedAt:i()}),n}catch(e){throw console.error("Error creating chat session:",e),e}},R=async s=>{try{const t=l(u(a,"chatSessions"),d("userId","==",s),d("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(n=>{const r=n.data();return{...r,createdAt:r.createdAt?.toDate()||new Date,updatedAt:r.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},b=async s=>{try{const t=await g(c(a,"chatSessions",s));if(t.exists()){const e=t.data();return{...e,createdAt:e.createdAt?.toDate()||new Date,updatedAt:e.updatedAt?.toDate()||new Date}}return null}catch(t){return console.error("Error getting chat session:",t),null}},q=async(s,t,e,n)=>{try{const r=c(u(a,"chatMessages")),o={id:r.id,userId:"",role:t,content:e,timestamp:new Date,...n?{context:n}:{}},m=await g(c(a,"chatSessions",s));m.exists()&&(o.userId=m.data().userId);const h={id:o.id,userId:o.userId,role:o.role,content:o.content,sessionId:s,timestamp:i()};return o.context&&(h.context=o.context),await w(r,h),await p(c(a,"chatSessions",s),{updatedAt:i()}),o}catch(r){throw console.error("Error adding message:",r),r}},B=async(s,t)=>{try{const e=l(u(a,"chatMessages"),d("sessionId","==",s),d("userId","==",t),y("timestamp","asc"));return(await A(e)).docs.map(r=>{const o=r.data();return{...o,timestamp:o.timestamp?.toDate()||new Date}})}catch(e){return console.error("Error getting session messages:",e),[]}},N=async(s,t)=>{try{await p(c(a,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},U=async s=>{try{await p(c(a,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{q as addMessageToSession,Q as createChatSession,U as deleteSession,b as getChatSession,B as getSessionMessages,R as getUserChatSessions,N as updateSessionTitle};
assets/{check-DSwzaW4Y.js β†’ check-BLSo9L0H.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as c}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as c}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{check-check-CS5aviKH.js β†’ check-check-B_HghS1Z.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{chevron-left-CZaM7nZW.js β†’ chevron-left-BWpgclqc.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{chevron-right-CoVWpXdD.js β†’ chevron-right-COqGruhh.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as o}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as o}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{chevron-up-Byo9SJJ4.js β†’ chevron-up-Cdvz2TMJ.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as o}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as o}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{circle-alert-DgDGv7k5.js β†’ circle-alert-CP9K3300.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{circle-check-CVJuYLp6.js β†’ circle-check-C0FPGTrp.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as c}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as c}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{circle-check-big-CNGbqkWz.js β†’ circle-check-big-m1SvzGFL.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as c}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as c}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{circle-help-hn0lWYq9.js β†’ circle-help-B8apTIdU.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as c}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as c}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{clipboard-check-BEObtDZM.js β†’ clipboard-check-DqBu2Pqb.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{clock-BodmJJnp.js β†’ clock-D1Ecvltm.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as c}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as c}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{diagnosticService-BIetid_s.js β†’ diagnosticService-BDYTUoqk.js} RENAMED
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Cb8VeSuW.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CH1lNiRF.js","assets/vendor-firebase-core-CO26nNq6.js","assets/vendor-firebase-auth-BLpRW_zO.js","assets/vendor-firebase-storage-B3igpVVS.js","assets/vendor-firebase-analytics-CTiUNb0-.js","assets/vendor-radix-BorKzPz9.js","assets/vendor-charts-D8hf8tI0.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-Aaqs1LGb.css"])))=>i.map(i=>d[i]);
2
- import{_ as w}from"./index-Cb8VeSuW.js";const y="https://deign86-mathpulse-api-v3test.hf.space";async function P(g,h){const f=`${y}/api/diagnostic/generate`,{auth:i}=await w(async()=>{const{auth:e}=await import("./index-Cb8VeSuW.js").then(s=>s.aU);return{auth:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),c=i.currentUser,l=async()=>{const e=new Headers({"Content-Type":"application/json"});if(c){const s=await c.getIdToken(!1);s&&e.set("Authorization",`Bearer ${s}`)}return e},u=async e=>fetch(f,{method:"POST",headers:await l(),body:JSON.stringify({strand:g,grade_level:h}),signal:e}),d=(e,s)=>{let t="Something went wrong. Please try again.";try{const a=JSON.parse(s);if(a.detail){const o=String(a.detail);o.includes("Database unavailable")||o.includes("unavailable")?t="Our servers are temporarily busy. Please try again in a moment.":o.includes("timeout")||o.includes("timed out")?t="The request timed out. Please check your connection and try again.":t=o}}catch{!e.ok&&s&&(t="Failed to start assessment. Please try again.")}return t},n=2,r=3e4;for(let e=1;e<=n;e++){const s=new AbortController,t=setTimeout(()=>s.abort(),r);try{const a=await u(s.signal);if(a.ok)return clearTimeout(t),a.json();if(a.status>=400&&a.status<500){clearTimeout(t);const m=await a.text().catch(()=>"");throw new Error(d(a,m))}const o=await a.text().catch(()=>""),p=d(a,o);if(clearTimeout(t),e<n){const m=e*2e3;console.warn(`[generateDiagnostic] attempt ${e} failed (${a.status}), retrying in ${m}ms...`),await new Promise(T=>setTimeout(T,m));continue}throw new Error(p)}catch(a){if(clearTimeout(t),a instanceof DOMException&&a.name==="AbortError"){if(e<n){console.warn(`[generateDiagnostic] attempt ${e} timed out, retrying...`);continue}throw new Error("The request timed out. Please check your connection and try again.")}throw a}}throw new Error("Failed to generate assessment after multiple attempts.")}async function _(g,h){const f=`${y}/api/diagnostic/submit`,i=new Headers({"Content-Type":"application/json"}),{auth:c}=await w(async()=>{const{auth:n}=await import("./index-Cb8VeSuW.js").then(r=>r.aU);return{auth:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),l=c.currentUser;if(l){const n=await l.getIdToken(!1);n&&i.set("Authorization",`Bearer ${n}`)}const u=new AbortController,d=setTimeout(()=>u.abort(),6e4);try{const n=await fetch(f,{method:"POST",headers:i,body:JSON.stringify({test_id:g,responses:h}),signal:u.signal});if(!n.ok){const r=await n.text().catch(()=>"");let e="Something went wrong. Please try again.";try{const s=JSON.parse(r);if(s.detail){const t=String(s.detail);t.includes("session")||t.includes("not found")?e="Your assessment session has expired. Please restart the assessment.":t.includes("Database unavailable")||t.includes("unavailable")?e="Our servers are temporarily busy. Please try again in a moment.":t.includes("timeout")||t.includes("timed out")?e="The request timed out. Please check your connection and try again.":e=t}}catch{r.includes("404")||r.includes("not found")?e="Your assessment session has expired. Please restart the assessment.":r&&(e="Something went wrong. Please try again.")}throw new Error(e)}return n.json()}finally{clearTimeout(d)}}export{P as g,_ as s};
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BaOs5Ayg.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CH1lNiRF.js","assets/vendor-firebase-core-CO26nNq6.js","assets/vendor-firebase-auth-BLpRW_zO.js","assets/vendor-firebase-storage-B3igpVVS.js","assets/vendor-firebase-analytics-CTiUNb0-.js","assets/vendor-radix-BorKzPz9.js","assets/vendor-charts-D8hf8tI0.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-DdX2rVyy.css"])))=>i.map(i=>d[i]);
2
+ import{_ as w}from"./index-BaOs5Ayg.js";const y="https://deign86-mathpulse-api-v3test.hf.space";async function P(g,h){const f=`${y}/api/diagnostic/generate`,{auth:i}=await w(async()=>{const{auth:e}=await import("./index-BaOs5Ayg.js").then(a=>a.b1);return{auth:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),c=i.currentUser,l=async()=>{const e=new Headers({"Content-Type":"application/json"});if(c){const a=await c.getIdToken(!1);a&&e.set("Authorization",`Bearer ${a}`)}return e},u=async e=>fetch(f,{method:"POST",headers:await l(),body:JSON.stringify({strand:g,grade_level:h}),signal:e}),d=(e,a)=>{let t="Something went wrong. Please try again.";try{const s=JSON.parse(a);if(s.detail){const o=String(s.detail);o.includes("Database unavailable")||o.includes("unavailable")?t="Our servers are temporarily busy. Please try again in a moment.":o.includes("timeout")||o.includes("timed out")?t="The request timed out. Please check your connection and try again.":t=o}}catch{!e.ok&&a&&(t="Failed to start assessment. Please try again.")}return t},n=2,r=3e4;for(let e=1;e<=n;e++){const a=new AbortController,t=setTimeout(()=>a.abort(),r);try{const s=await u(a.signal);if(s.ok)return clearTimeout(t),s.json();if(s.status>=400&&s.status<500){clearTimeout(t);const m=await s.text().catch(()=>"");throw new Error(d(s,m))}const o=await s.text().catch(()=>""),p=d(s,o);if(clearTimeout(t),e<n){const m=e*2e3;console.warn(`[generateDiagnostic] attempt ${e} failed (${s.status}), retrying in ${m}ms...`),await new Promise(T=>setTimeout(T,m));continue}throw new Error(p)}catch(s){if(clearTimeout(t),s instanceof DOMException&&s.name==="AbortError"){if(e<n){console.warn(`[generateDiagnostic] attempt ${e} timed out, retrying...`);continue}throw new Error("The request timed out. Please check your connection and try again.")}throw s}}throw new Error("Failed to generate assessment after multiple attempts.")}async function _(g,h){const f=`${y}/api/diagnostic/submit`,i=new Headers({"Content-Type":"application/json"}),{auth:c}=await w(async()=>{const{auth:n}=await import("./index-BaOs5Ayg.js").then(r=>r.b1);return{auth:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),l=c.currentUser;if(l){const n=await l.getIdToken(!1);n&&i.set("Authorization",`Bearer ${n}`)}const u=new AbortController,d=setTimeout(()=>u.abort(),6e4);try{const n=await fetch(f,{method:"POST",headers:i,body:JSON.stringify({test_id:g,responses:h}),signal:u.signal});if(!n.ok){const r=await n.text().catch(()=>"");let e="Something went wrong. Please try again.";try{const a=JSON.parse(r);if(a.detail){const t=String(a.detail);t.includes("session")||t.includes("not found")?e="Your assessment session has expired. Please restart the assessment.":t.includes("Database unavailable")||t.includes("unavailable")?e="Our servers are temporarily busy. Please try again in a moment.":t.includes("timeout")||t.includes("timed out")?e="The request timed out. Please check your connection and try again.":e=t}}catch{r.includes("404")||r.includes("not found")?e="Your assessment session has expired. Please restart the assessment.":r&&(e="Something went wrong. Please try again.")}throw new Error(e)}return n.json()}finally{clearTimeout(d)}}export{P as g,_ as s};
assets/{dialog-CCp2tnRr.js β†’ dialog-CHtYkwVl.js} RENAMED
@@ -1 +1 @@
1
- import{j as t,r as l}from"./vendor-react-B4AQeu28.js";import{c as m,d as n,e as i,T as r,D as d,P as p,O as c}from"./vendor-radix-BorKzPz9.js";import{i as s}from"./index-Cb8VeSuW.js";import{X as u}from"./x-CTLBAl-n.js";function w({...a}){return t.jsx(m,{"data-slot":"dialog",...a})}function x({...a}){return t.jsx(p,{"data-slot":"dialog-portal",...a})}function z({...a}){return t.jsx(i,{"data-slot":"dialog-close",...a})}const f=l.forwardRef(({className:a,...e},o)=>t.jsx(c,{ref:o,"data-slot":"dialog-overlay",className:s("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",a),...e}));f.displayName=c.displayName;const j=l.forwardRef(({className:a,children:e,...o},g)=>t.jsxs(x,{"data-slot":"dialog-portal",children:[t.jsx(f,{}),t.jsxs(n,{ref:g,"data-slot":"dialog-content",className:s("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",a),...o,children:[e,t.jsxs(i,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[t.jsx(u,{}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));j.displayName=n.displayName;function R({className:a,...e}){return t.jsx("div",{"data-slot":"dialog-header",className:s("flex flex-col gap-2 text-center sm:text-left",a),...e})}function C({className:a,...e}){return t.jsx("div",{"data-slot":"dialog-footer",className:s("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...e})}const y=l.forwardRef(({className:a,...e},o)=>t.jsx(r,{ref:o,"data-slot":"dialog-title",className:s("text-lg leading-none font-semibold",a),...e}));y.displayName=r.displayName;const N=l.forwardRef(({className:a,...e},o)=>t.jsx(d,{ref:o,"data-slot":"dialog-description",className:s("text-muted-foreground text-sm",a),...e}));N.displayName=d.displayName;export{w as D,j as a,R as b,y as c,N as d,C as e,z as f};
 
1
+ import{j as t,r as l}from"./vendor-react-B4AQeu28.js";import{c as m,d as n,e as i,T as r,D as d,P as p,O as c}from"./vendor-radix-BorKzPz9.js";import{i as s}from"./index-BaOs5Ayg.js";import{X as u}from"./x-TNvtuOD9.js";function w({...a}){return t.jsx(m,{"data-slot":"dialog",...a})}function x({...a}){return t.jsx(p,{"data-slot":"dialog-portal",...a})}function z({...a}){return t.jsx(i,{"data-slot":"dialog-close",...a})}const f=l.forwardRef(({className:a,...e},o)=>t.jsx(c,{ref:o,"data-slot":"dialog-overlay",className:s("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",a),...e}));f.displayName=c.displayName;const j=l.forwardRef(({className:a,children:e,...o},g)=>t.jsxs(x,{"data-slot":"dialog-portal",children:[t.jsx(f,{}),t.jsxs(n,{ref:g,"data-slot":"dialog-content",className:s("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",a),...o,children:[e,t.jsxs(i,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[t.jsx(u,{}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));j.displayName=n.displayName;function R({className:a,...e}){return t.jsx("div",{"data-slot":"dialog-header",className:s("flex flex-col gap-2 text-center sm:text-left",a),...e})}function C({className:a,...e}){return t.jsx("div",{"data-slot":"dialog-footer",className:s("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...e})}const y=l.forwardRef(({className:a,...e},o)=>t.jsx(r,{ref:o,"data-slot":"dialog-title",className:s("text-lg leading-none font-semibold",a),...e}));y.displayName=r.displayName;const N=l.forwardRef(({className:a,...e},o)=>t.jsx(d,{ref:o,"data-slot":"dialog-description",className:s("text-muted-foreground text-sm",a),...e}));N.displayName=d.displayName;export{w as D,j as a,R as b,y as c,N as d,C as e,z as f};
assets/{download-C-V0pYsk.js β†’ download-DX_YebqQ.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{e as o}from"./index-Cb8VeSuW.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{e as o}from"./index-BaOs5Ayg.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.