github-actions[bot] commited on
Commit
a6049ab
Β·
1 Parent(s): 317a850

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

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-DDSYPYxd.js β†’ AIChatPage-CstOeMuY.js} +2 -2
  2. assets/{AdminDashboard-uzlVc26h.js β†’ AdminDashboard-BkN0KBRk.js} +0 -0
  3. assets/AvatarShop-CFi18Hj0.js +16 -0
  4. assets/AvatarShop-D-gwLcZq.js +0 -11
  5. assets/{ChatMarkdown-BI4vbcO7.js β†’ ChatMarkdown-XT9mMuBR.js} +1 -1
  6. assets/{CompetencyRadarChart-Bv4P4qFs.js β†’ CompetencyRadarChart-B1x3Wmwg.js} +1 -1
  7. assets/{CompositeAvatar-CphZ-OWw.js β†’ CompositeAvatar-DSWWcDP7.js} +1 -1
  8. assets/{ConfirmModal-B9CUrvQP.js β†’ ConfirmModal-BO6r5veY.js} +1 -1
  9. assets/{DashboardAvatar-MX9hSo-6.js β†’ DashboardAvatar-2y_SuM8T.js} +1 -1
  10. assets/{DiagnosticAssessmentModal-BoOvPWwv.js β†’ DiagnosticAssessmentModal-DG6T8nsY.js} +1 -1
  11. assets/{FloatingAITutor-DYvlvoVe.js β†’ FloatingAITutor-BhjMn9CN.js} +3 -3
  12. assets/GradesPage-BIf0hX4r.js +0 -2
  13. assets/GradesPage-Bi5pcR2x.js +2 -0
  14. assets/{HeroBanner-DgRlQubI.js β†’ HeroBanner-BzMF9ktr.js} +3 -3
  15. assets/{LeaderboardPage-C97hWKsZ.js β†’ LeaderboardPage-DIZVn39b.js} +1 -1
  16. assets/{LearningPath-CTKb6bQc.js β†’ LearningPath-LYxnZA3A.js} +1 -1
  17. assets/{LoginPage-BTBes4zQ.js β†’ LoginPage-DTFoLFv7.js} +1 -1
  18. assets/{LogoutActionButton-D-8gok3U.js β†’ LogoutActionButton-TpO-by05.js} +1 -1
  19. assets/{MathAnswerInput-Bx58557t.js β†’ MathAnswerInput-DOzNwadV.js} +1 -1
  20. assets/{ModuleFolderCard-BGJM_1PJ.js β†’ ModuleFolderCard-BSQZpGub.js} +1 -1
  21. assets/{ModulesPage-C8056uyx.js β†’ ModulesPage-D7B9Sp71.js} +1 -1
  22. assets/{NotificationCenter-l7IdH4wu.js β†’ NotificationCenter-Djp-U1R4.js} +1 -1
  23. assets/{ProfileModal-CvubwvbT.js β†’ ProfileModal-CnV-otvQ.js} +1 -1
  24. assets/{QuizBattlePage-BhgM4TWz.js β†’ QuizBattlePage-C-kQ0NH9.js} +0 -0
  25. assets/{RewardsModal-CtOcWG3R.js β†’ RewardsModal-DbFwQSQa.js} +1 -1
  26. assets/{RightSidebar-kfU04N_d.js β†’ RightSidebar--rSxCGQy.js} +1 -1
  27. assets/{ScientificCalculator-BP-XvW_h.js β†’ ScientificCalculator-B0rqpddr.js} +1 -1
  28. assets/{SearchBar-DYN0WTzx.js β†’ SearchBar-CzmZ03BX.js} +1 -1
  29. assets/{SettingsModal-BFFZzSRx.js β†’ SettingsModal-Ct0cXLCK.js} +1 -1
  30. assets/{Sidebar-BH3yU0R9.js β†’ Sidebar-oxQVx2NC.js} +1 -1
  31. assets/{SupplementalBanner-COM6ABNZ.js β†’ SupplementalBanner-CaXzjH7M.js} +1 -1
  32. assets/{TeacherDashboard-CtdIzfjb.js β†’ TeacherDashboard-CXY2X8Up.js} +1 -1
  33. assets/{XPNotification-DOZFX3ET.js β†’ XPNotification-DeYNvFkJ.js} +1 -1
  34. assets/{apiService-BuaHZ1Ho.js β†’ apiService-ZZIWaV70.js} +1 -1
  35. assets/{automationService-1THdsq3v.js β†’ automationService-IMphlGK7.js} +1 -1
  36. assets/{avatarData-DykDiQ_Y.js β†’ avatarData-BW_TX0b4.js} +1 -1
  37. assets/{award-DpLN2BvV.js β†’ award-COlS18fi.js} +1 -1
  38. assets/{bell-DeNrtKrI.js β†’ bell-B1VXtbbh.js} +1 -1
  39. assets/{book-open-B5Xvd1JL.js β†’ book-open-BH_yilLK.js} +1 -1
  40. assets/{brain-DHmY5cbv.js β†’ brain-DfMjTiNx.js} +1 -1
  41. assets/{button-DWdPuxDU.js β†’ button-BP5cklmU.js} +1 -1
  42. assets/{calendar-19p2TrVX.js β†’ calendar-CP-HCx1y.js} +1 -1
  43. assets/{chart-column-CJzwyNMx.js β†’ chart-column-DzJCKCOe.js} +1 -1
  44. assets/{chatService-tsfogjaC.js β†’ chatService-D8LuvWux.js} +1 -1
  45. assets/{check-BONc3QkK.js β†’ check-D1XVAVXL.js} +1 -1
  46. assets/{check-check-BDU3hkDf.js β†’ check-check-TbgWzZ22.js} +1 -1
  47. assets/{chevron-right-DxXkA9aZ.js β†’ chevron-right-BSCyuP_x.js} +1 -1
  48. assets/{chevron-up-BJyzaJs7.js β†’ chevron-up-CwQX0CFg.js} +1 -1
  49. assets/{circle-alert-D8UKyVHS.js β†’ circle-alert-DWP6udG1.js} +1 -1
  50. assets/{circle-check-big-mv2CRLCE.js β†’ circle-check-big-C_XnLpga.js} +1 -1
assets/{AIChatPage-DDSYPYxd.js β†’ AIChatPage-CstOeMuY.js} RENAMED
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/apiService-BuaHZ1Ho.js","assets/index-DGWrSMOK.js","assets/vendor-react-Dexh7fmo.js","assets/vendor-firebase-auth-COrkgW0P.js","assets/vendor-firebase-core-DQ-pMjxd.js","assets/vendor-firebase-firestore-CkuVbeP5.js","assets/vendor-firebase-storage-BOeKE_0n.js","assets/vendor-firebase-analytics-CCo6E2f7.js","assets/index-CR2i2gnI.css"])))=>i.map(i=>d[i]);
2
- import{z as B,_ as F,e as N,m as k}from"./index-DGWrSMOK.js";import{r,j as e}from"./vendor-react-Dexh7fmo.js";import{B as $}from"./button-DWdPuxDU.js";import{I as S}from"./input-DBkKXOmF.js";import z from"./ChatMarkdown-BI4vbcO7.js";import{P as O}from"./plus-DVCmopn-.js";import{S as H}from"./search-O5gEqRZi.js";import{T as Y}from"./trash-2-CBQVcuBL.js";import{S as D}from"./send-nCgvy9cZ.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-radix-B-ht8aK0.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-markdown-C5ikSDMA.js";const ie=()=>{const{sessions:C,activeSessionId:a,isLoading:l,loadingSessionId:I,setActiveSessionId:i,createNewSession:u,sendMessage:A,deleteSession:L,getActiveSession:T}=B(),[d,_]=r.useState(""),[o,f]=r.useState(""),[b,y]=r.useState(!1),c=r.useRef(null),x=r.useRef(!0),m=r.useRef(!1),n=T(),h=n?.messages||[],M=h.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),g=l&&a===I&&!M,j=(t="auto")=>{const s=c.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},P=()=>{const t=c.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},E=()=>{x.current=P()};r.useEffect(()=>{F(async()=>{const{warmupBackend:t}=await import("./apiService-BuaHZ1Ho.js");return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),r.useEffect(()=>{if(!x.current)return;const t=window.requestAnimationFrame(()=>j("auto"));return()=>window.cancelAnimationFrame(t)},[h,g]),r.useEffect(()=>{x.current=!0,j("auto")},[a]);const v=async()=>{if(!(!o.trim()||l||b||m.current)){m.current=!0,y(!0);try{let t=a;t||(t=u(),i(t));const s=o.trim();f(""),await A(t,s)}finally{m.current=!1,y(!1)}}},w=()=>{const t=u();i(t)},R=(t,s)=>{s.stopPropagation(),L(t)},p=C.filter(t=>t.title.toLowerCase().includes(d.toLowerCase())||t.preview.toLowerCase().includes(d.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:w,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(O,{size:18}),"New Chat"]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(H,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(S,{type:"text",placeholder:"Search conversations...",value:d,onChange:t=>_(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(N,{children:p.map(t=>e.jsxs(k.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>i(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${a===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 ${a===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>R(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(Y,{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 ${a===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:a?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:n?.title}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:n?.date})]}),e.jsx("div",{className:"flex items-center gap-2",children:n?.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:c,onScroll:E,className:"flex-1 overflow-y-auto overscroll-contain p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(N,{children:h.map(t=>e.jsx(k.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex ${t.sender==="user"?"justify-end":"justify-start"}`,children: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(z,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:t.timestamp})]})},t.id))}),g&&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(S,{type:"text",value:o,onChange:t=>f(t.target.value),onKeyPress:t=>t.key==="Enter"&&v(),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($,{onClick:v,disabled:!o.trim()||l||b,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(D,{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:w,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{ie as default};
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/apiService-ZZIWaV70.js","assets/index-CmBdDSkw.js","assets/vendor-react-Dexh7fmo.js","assets/vendor-firebase-auth-COrkgW0P.js","assets/vendor-firebase-core-DQ-pMjxd.js","assets/vendor-firebase-firestore-CkuVbeP5.js","assets/vendor-firebase-storage-BOeKE_0n.js","assets/vendor-firebase-analytics-CCo6E2f7.js","assets/index-CR2i2gnI.css"])))=>i.map(i=>d[i]);
2
+ import{z as B,_ as F,e as N,m as k}from"./index-CmBdDSkw.js";import{r,j as e}from"./vendor-react-Dexh7fmo.js";import{B as $}from"./button-BP5cklmU.js";import{I as S}from"./input-DBkKXOmF.js";import z from"./ChatMarkdown-XT9mMuBR.js";import{P as O}from"./plus-Dip_RqNl.js";import{S as H}from"./search-zqCwfHe1.js";import{T as Y}from"./trash-2-BGLuKCox.js";import{S as D}from"./send-OMGWblBc.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-radix-CxzAJozq.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-markdown-C5ikSDMA.js";const ie=()=>{const{sessions:C,activeSessionId:a,isLoading:l,loadingSessionId:I,setActiveSessionId:i,createNewSession:u,sendMessage:A,deleteSession:L,getActiveSession:T}=B(),[d,_]=r.useState(""),[o,f]=r.useState(""),[b,y]=r.useState(!1),c=r.useRef(null),x=r.useRef(!0),m=r.useRef(!1),n=T(),h=n?.messages||[],M=h.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),g=l&&a===I&&!M,j=(t="auto")=>{const s=c.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},P=()=>{const t=c.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},E=()=>{x.current=P()};r.useEffect(()=>{F(async()=>{const{warmupBackend:t}=await import("./apiService-ZZIWaV70.js");return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),r.useEffect(()=>{if(!x.current)return;const t=window.requestAnimationFrame(()=>j("auto"));return()=>window.cancelAnimationFrame(t)},[h,g]),r.useEffect(()=>{x.current=!0,j("auto")},[a]);const v=async()=>{if(!(!o.trim()||l||b||m.current)){m.current=!0,y(!0);try{let t=a;t||(t=u(),i(t));const s=o.trim();f(""),await A(t,s)}finally{m.current=!1,y(!1)}}},w=()=>{const t=u();i(t)},R=(t,s)=>{s.stopPropagation(),L(t)},p=C.filter(t=>t.title.toLowerCase().includes(d.toLowerCase())||t.preview.toLowerCase().includes(d.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:w,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(O,{size:18}),"New Chat"]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(H,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(S,{type:"text",placeholder:"Search conversations...",value:d,onChange:t=>_(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(N,{children:p.map(t=>e.jsxs(k.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>i(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${a===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 ${a===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>R(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(Y,{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 ${a===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:a?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:n?.title}),e.jsx("p",{className:"text-xs text-[#5a6578]",children:n?.date})]}),e.jsx("div",{className:"flex items-center gap-2",children:n?.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:c,onScroll:E,className:"flex-1 overflow-y-auto overscroll-contain p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(N,{children:h.map(t=>e.jsx(k.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex ${t.sender==="user"?"justify-end":"justify-start"}`,children: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(z,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:t.timestamp})]})},t.id))}),g&&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(S,{type:"text",value:o,onChange:t=>f(t.target.value),onKeyPress:t=>t.key==="Enter"&&v(),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($,{onClick:v,disabled:!o.trim()||l||b,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(D,{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:w,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{ie as default};
assets/{AdminDashboard-uzlVc26h.js β†’ AdminDashboard-BkN0KBRk.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/AvatarShop-CFi18Hj0.js ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{r as l,j as e}from"./vendor-react-Dexh7fmo.js";import{c as V,L as B,o as $,d as F}from"./vendor-radix-CxzAJozq.js";import{c as v,u as K,l as z,m as d,e as U,t as n,K as Y,L as Z}from"./index-CmBdDSkw.js";import{T as D,a as G,b as H}from"./tooltip-Bn7-0zmi.js";import{C as W}from"./CompositeAvatar-DSWWcDP7.js";import{M as L}from"./avatarData-BW_TX0b4.js";import{S as I}from"./sparkles-D6B_TX7M.js";import{L as Q}from"./lock-Dt6Po_Oi.js";import{S as J}from"./save-XQRYdTi9.js";import{S as ee}from"./shirt-CHOJLYIJ.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./utils-BQQgILNW.js";import"./clsx-B-dksMZM.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 te=[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]],se=v("footprints",te);/**
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 ae=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],re=v("scissors",ae);/**
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 oe=[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]],b=v("shopping-bag",oe),E=["Wow!","Cute!","I love it!","Perfect!","So cool!","Awesome!"],M=["Gain more XP to buy me more clothes!","Help me get stylish!","Let's earn some XP to unlock more!","I'd love to try on more outfits!","Keep learning to unlock new looks!"],Ne=({onSaveProfile:g,onNavigateToModules:C})=>{const{userProfile:a,refreshProfile:y}=K(),_=!1,[m,w]=l.useState({top:a?.avatarLayers?.top||"top_pink",bottom:a?.avatarLayers?.bottom||"",shoes:a?.avatarLayers?.shoes||"",accessory:a?.avatarLayers?.accessory||""}),[p,x]=l.useState(!1),[h,j]=l.useState([]),[A,N]=l.useState(0),[k,S]=l.useState(null),[c,u]=l.useState(null);l.useEffect(()=>{if(a&&a.role==="student"){const t=a;j(t.ownedAvatarItems||[]),N(t.currentXP||0)}},[a]),l.useEffect(()=>{w({top:a?.avatarLayers?.top||"top_pink",bottom:a?.avatarLayers?.bottom||"",shoes:a?.avatarLayers?.shoes||"",accessory:a?.avatarLayers?.accessory||""})},[a?.avatarLayers?.top,a?.avatarLayers?.bottom,a?.avatarLayers?.shoes,a?.avatarLayers?.accessory]),l.useEffect(()=>{if(!c){const t=setInterval(()=>{Math.random()>.6&&u(M[Math.floor(Math.random()*M.length)])},4e3);return()=>clearInterval(t)}},[c]),l.useEffect(()=>{if(c){const t=setTimeout(()=>{u(null)},3500);return()=>clearTimeout(t)}},[c]);const T=(t,o)=>{const s=L.find(r=>r.id===o);if(s&&s.price&&s.price>0&&!h.includes(o)){n.error("This item is locked. Purchase it first!");return}w(r=>({...r,[t]:r[t]===o?"":o})),u(E[Math.floor(Math.random()*E.length)])},X=async(t,o,s)=>{if(t.stopPropagation(),!a?.uid){n.error("You must be logged in to purchase items");return}if(h.includes(o)){n.info("You already own this item");return}S(o);try{const r=await Y(a.uid,o,s);r.success?(n.success(r.message||"Item purchased!"),j(f=>[...f,o]),r.currentXP!==void 0&&N(r.currentXP),await y()):n.error(r.message||"Failed to purchase item")}catch(r){console.error("Purchase error:",r),n.error("Error purchasing item")}finally{S(null)}},q=t=>({top:t.top===""?void 0:t.top,bottom:t.bottom===""?void 0:t.bottom,shoes:t.shoes===""?void 0:t.shoes,accessory:t.accessory===""?void 0:t.accessory}),O=async()=>{if(a?.uid){x(!0);try{const t=q(m);await Z(a.uid,{avatarLayers:t}),g&&g(t),n.success("Avatar saved successfully"),await y(),x(!1)}catch(t){console.error(t),x(!1)}}},P=[{id:"top",label:"Tops",icon:e.jsx(ee,{size:16})},{id:"bottom",label:"Bottoms",icon:e.jsx(re,{size:16,className:"rotate-90"})},{id:"shoes",label:"Shoes",icon:e.jsx(se,{size:16})},{id:"accessory",label:"Accessories",icon:e.jsx(z,{size:16})}];return e.jsx("div",{className:"h-full w-full flex items-center justify-center p-4 sm:p-6 lg:p-8 overflow-hidden",children:e.jsxs("div",{className:"relative w-full max-w-[1000px] h-[80vh] min-h-[500px] max-h-[700px] rounded-[2rem] p-6 lg:p-8 bg-gradient-to-br from-white via-sky-50/30 to-white border border-slate-200/80 shadow-[0_8px_30px_rgb(0,0,0,0.04)] flex flex-col xl:flex-row gap-12 overflow-hidden",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-[2rem] pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/30 to-transparent"}),e.jsx("div",{className:"absolute -top-40 -right-40 w-96 h-96 bg-blue-100/40 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute -bottom-40 -left-40 w-96 h-96 bg-purple-100/30 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"flex flex-col h-full min-h-0 relative z-10 w-full xl:w-[50%] mx-auto xl:mx-0 flex-1 min-h-0",children:[e.jsxs("div",{className:"mb-6 flex flex-col gap-2 shrink-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between xl:justify-start gap-4",children:[e.jsxs("h1",{className:"text-3xl md:text-4xl font-display font-black text-[#0a1628] tracking-tight flex items-center gap-2.5",children:[e.jsx("span",{className:"whitespace-nowrap",children:"Avatar Studio"})," ",e.jsx(I,{className:"text-blue-500 fill-blue-500",size:28})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[_,e.jsxs("div",{className:"bg-gradient-to-br from-amber-400 to-orange-500 rounded-xl px-3 py-1.5 shadow-md flex items-center gap-2 h-fit",children:[e.jsx(b,{className:"text-white shrink-0",size:16}),e.jsxs(D,{children:[e.jsx(G,{asChild:!0,children:e.jsxs("button",{onClick:C,className:"cursor-pointer hover:opacity-90 transition-opacity active:scale-95 text-left",children:[e.jsx("p",{className:"text-white text-[9px] font-bold uppercase tracking-wider leading-none mb-0.5",children:"XP Balance"}),e.jsx("p",{className:"text-white text-base font-black leading-none",children:A})]})}),e.jsx(H,{side:"bottom",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]})]})]}),e.jsx("p",{className:"text-slate-500 font-medium text-sm md:text-base",children:"Design your perfect learning companion."})]}),e.jsxs(V,{defaultValue:"top",className:"flex flex-col flex-1 min-h-0",children:[e.jsx(B,{className:"flex flex-nowrap shrink-0 justify-start space-x-1 sm:space-x-2 mb-4 bg-white shadow-sm p-1 rounded-full border border-slate-100 w-fit overflow-x-auto max-w-full scrollbar-hide",children:P.map(t=>e.jsxs($,{value:t.id,className:"flex items-center gap-1.5 px-4 py-2 rounded-full font-bold text-[13px] text-slate-500 hover:bg-slate-50 data-[state=active]:bg-gradient-to-r data-[state=active]:from-blue-600 data-[state=active]:to-sky-500 data-[state=active]:text-white transition-all shadow-sm outline-none whitespace-nowrap",children:[t.icon,t.label]},t.id))}),e.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden min-h-0 pb-6 scrollbar-hide px-2 -mx-2",children:P.map(t=>{const o=L.filter(s=>s.category===t.id);return e.jsx(F,{value:t.id,className:"outline-none pt-2 h-full",children:o.length===0?e.jsxs("div",{className:"w-full h-full min-h-[250px] flex flex-col items-center justify-center border-2 border-dashed border-slate-200 rounded-[2rem] bg-slate-50/50 p-8 text-center",children:[e.jsx(z,{size:48,className:"text-slate-300 mb-4 opacity-50"}),e.jsx("h3",{className:"font-bold text-xl text-slate-500 mb-2",children:"Accessories coming soon"}),e.jsx("p",{className:"text-slate-400 text-sm max-w-xs",children:"We're crafting some awesome gear for your avatar! Check back later."})]}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 lg:gap-6",children:o.map(s=>{const r=m[t.id]===s.id,f=h.includes(s.id),i=!!(s.price&&s.price>0&&!f);return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{onClick:()=>!i&&T(t.id,s.id),disabled:i,className:`relative w-full aspect-square rounded-2xl border-2 transition-all flex flex-col items-center justify-center group ${r&&!i?"bg-white border-blue-500 shadow-md scale-[1.02] z-10":i?"bg-slate-50 border-slate-200 opacity-50 cursor-not-allowed":"bg-white border-slate-100 hover:border-sky-300 hover:shadow-lg hover:scale-[1.02] hover:z-10"}`,children:[r&&!i&&e.jsxs("div",{className:"absolute top-1.5 left-1/2 -translate-x-1/2 px-1.5 py-0.5 bg-gradient-to-r from-blue-500 to-sky-400 text-white text-[9px] font-black rounded-full flex items-center gap-1 z-10 whitespace-nowrap",children:["Equipped ",e.jsx(I,{size:9,className:"fill-white"})]}),i&&e.jsx("div",{className:"absolute inset-0 bg-black/20 z-20 flex items-center justify-center rounded-[1rem]",children:e.jsx(Q,{className:"text-white",size:24})}),e.jsx("img",{src:s.thumbnail,alt:s.name,className:`w-3/4 h-3/4 object-contain transition-transform ${!i&&"group-hover:scale-110"}`,style:{filter:i?"grayscale(70%)":"none"}})]}),e.jsx("p",{className:"text-xs font-bold text-slate-700 text-center line-clamp-2",children:s.name}),i&&e.jsx(d.button,{initial:{opacity:0},animate:{opacity:1},onClick:R=>X(R,s.id,s.price||0),disabled:k===s.id,className:"w-full py-1 bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-white text-[9px] font-bold flex items-center justify-center gap-1 rounded shadow-sm transition-all disabled:opacity-70",children:k===s.id?e.jsx(d.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1},children:e.jsx(b,{size:11})}):e.jsxs(e.Fragment,{children:[e.jsx(b,{size:11}),s.price," XP"]})})]},s.id)})})},t.id)})})]})]}),e.jsxs("div",{className:"flex flex-col gap-4 relative z-10 w-full xl:w-[350px] shrink-0 xl:self-center",children:[e.jsxs("div",{className:"bg-[#0f1422] rounded-[2rem] overflow-hidden relative shadow-[0_20px_50px_rgba(15,20,34,0.2)] h-[400px] w-full flex items-center justify-center mx-auto border-4 border-slate-800",children:[e.jsx("div",{className:"absolute top-[-10%] left-0 right-0 h-[110%] pointer-events-none mix-blend-screen opacity-70",style:{background:"linear-gradient(to bottom, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.05) 60%, transparent 100%)",clipPath:"polygon(15% 0, 85% 0, 65% 100%, 35% 100%)"}}),e.jsx("div",{className:"absolute bottom-12 left-1/2 -translate-x-1/2 w-[220px] h-[25px] bg-sky-500/20 blur-xl rounded-full"}),e.jsxs(d.div,{animate:{y:[-8,8,-8]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},className:"relative w-full h-[80%] z-10 flex justify-center items-center",children:[e.jsx(W,{layers:m,className:"w-full h-full absolute inset-0 z-20"}),e.jsx(U,{children:c&&e.jsxs(d.div,{initial:{opacity:0,y:-10,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.8},transition:{duration:.3},className:"absolute -top-24 left-1/2 -translate-x-1/2 z-30 bg-white text-slate-800 px-4 py-2 rounded-full shadow-lg border-2 border-sky-300 whitespace-nowrap font-bold text-sm max-w-xs text-center",children:[c,e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-white"})]})})]})]}),e.jsxs("button",{onClick:O,disabled:p,className:"w-full max-w-[450px] mx-auto h-[54px] bg-blue-600 hover:bg-blue-500 text-white rounded-xl font-bold text-base flex items-center justify-center gap-2 transition-colors shadow-md disabled:opacity-70 disabled:cursor-not-allowed active:scale-[0.98]",children:[p?e.jsx(d.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1,ease:"linear"},children:e.jsx(J,{size:24,className:"opacity-50"})}):null,p?"Saving...":"Save Profile Avatar"]})]})]})})};export{Ne as default};
assets/AvatarShop-D-gwLcZq.js DELETED
@@ -1,11 +0,0 @@
1
- import{r as c,j as e}from"./vendor-react-Dexh7fmo.js";import{T as y,b as j,c as n,a as k}from"./tabs-BJVl1n4R.js";import{B as N}from"./button-DWdPuxDU.js";import{c as i}from"./utils-BQQgILNW.js";import{c as h,u as _,l as S,m as o,t as d,K as T}from"./index-DGWrSMOK.js";import{S as z}from"./shirt-C4Gsu12G.js";import{S as A}from"./sparkles-DxmNHQEo.js";import{L}from"./loader-circle-BUf2fYcT.js";import"./vendor-radix-B-ht8aK0.js";import"./clsx-B-dksMZM.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.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 B=[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]],C=h("footprints",B);/**
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 I=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],P=h("scissors",I),E=[{id:"uniform_blue",name:"Blue Uniform",src:"/avatar/uniform_blue.png",thumbnail:"/avatar/uniform_blue_thumbnail.png",category:"Tops"},{id:"uniform_pink",name:"Pink Uniform",src:"/avatar/uniform_pink.png",thumbnail:"/avatar/uniform_pink_thumbnail.png",category:"Tops"},{id:"pants_black",name:"Black Pants",src:"/avatar/pants_black.png",thumbnail:"/avatar/pants_black_thumbnail.png",category:"Bottoms"},{id:"shoes_black",name:"Black Shoes",src:"/avatar/shoes_black.png",thumbnail:"/avatar/shoes_black_thumbnail.png",category:"Shoes"}],M=s=>({top:s.tops??void 0,bottom:s.bottoms??void 0,shoes:s.shoes??void 0,accessory:s.accessories??void 0}),O=s=>({tops:s?.top??"uniform_blue",bottoms:s?.bottom??"pants_black",shoes:s?.shoes??"shoes_black",accessories:s?.accessory??null}),X=()=>{const{currentUser:s,userProfile:p,refreshProfile:b}=_(),[r,u]=c.useState({tops:"uniform_blue",bottoms:"pants_black",shoes:"shoes_black",accessories:null}),[m,x]=c.useState(!1);c.useEffect(()=>{u(O(p?.avatarLayers))},[p?.avatarLayers]);const g=t=>{u(a=>({...a,[t.category.toLowerCase()]:a[t.category.toLowerCase()]===t.id?null:t.id}))},f=async()=>{if(!s?.uid){d.error("Please sign in to save avatar changes.");return}x(!0);try{await T(s.uid,{avatarLayers:M(r)}),await b(),d.success("Avatar saved to your profile.")}catch(t){console.error("Failed to save avatar config:",t),d.error("Unable to save avatar right now.")}finally{x(!1)}},v=["Tops","Bottoms","Shoes","Accessories"],w=t=>{switch(t){case"Tops":return"object-center scale-[1.7] translate-y-2";case"Bottoms":return"object-bottom scale-[2.2] translate-y-8";case"Shoes":return"object-bottom scale-[3.2] translate-y-12";default:return"object-center scale-[1.5]"}};return e.jsxs("div",{className:"relative min-h-full h-full w-full flex items-center justify-center p-4 lg:p-8 bg-transparent overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at 30% 50%, rgba(240,249,255,0.2) 0%, rgba(248,250,252,0.5) 50%, rgba(255,241,242,0.4) 80%, rgba(248,250,252,0.85) 100%)"}}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply",style:{background:"radial-gradient(circle, rgba(168,85,247,0.3) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply",style:{background:"radial-gradient(circle, rgba(236,72,153,0.25) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen",style:{background:"radial-gradient(circle, rgba(56,189,248,0.2) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle, rgba(15,23,42,0.4) 1px, transparent 1px)",backgroundSize:"24px 24px"}}),e.jsxs("div",{className:"relative z-10 w-full max-w-[1400px] h-[calc(100vh-2rem)] lg:h-[800px] flex flex-col-reverse lg:flex-row bg-white/90 backdrop-blur-xl rounded-[2.5rem] shadow-2xl border border-white/50 overflow-hidden divide-y-reverse lg:divide-y-0 lg:divide-x divide-slate-100/60 ring-1 ring-slate-900/5",children:[e.jsxs("div",{className:"flex-1 lg:w-[55%] flex flex-col p-6 lg:p-12 space-y-8 bg-white/40 overflow-y-auto min-h-0",children:[e.jsxs("div",{className:"flex flex-col space-y-2",children:[e.jsx("h1",{className:"text-4xl lg:text-5xl font-black tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-purple-600 via-pink-500 to-sky-500 flex items-center gap-3 drop-shadow-sm",children:"Avatar Studio ✨"}),e.jsx("p",{className:"text-slate-600 text-base font-medium lg:text-lg",children:"Design your perfect learning companion."})]}),e.jsxs(y,{defaultValue:"Tops",className:"w-full flex-1 flex flex-col",children:[e.jsxs(j,{className:"flex flex-nowrap shrink-0 justify-start gap-3 bg-white/60 backdrop-blur-xl p-3 border-2 border-white/80 rounded-3xl mb-10 overflow-x-auto overflow-y-hidden whitespace-nowrap scrollbar-hide min-w-full shadow-[0_8px_30px_rgb(0,0,0,0.04)]",children:[e.jsxs(n,{value:"Tops",className:"data-[state=active]:bg-gradient-to-r data-[state=active]:from-purple-500 data-[state=active]:to-pink-500 data-[state=active]:text-white data-[state=inactive]:hover:bg-purple-50 data-[state=inactive]:text-slate-500 data-[state=active]:shadow-md rounded-2xl py-3.5 px-5 font-bold transition-all flex-1 min-w-[120px] whitespace-nowrap shrink-0",children:[e.jsx(z,{className:"w-5 h-5 mr-2"})," Tops"]}),e.jsxs(n,{value:"Bottoms",className:"data-[state=active]:bg-gradient-to-r data-[state=active]:from-purple-500 data-[state=active]:to-pink-500 data-[state=active]:text-white data-[state=inactive]:hover:bg-purple-50 data-[state=inactive]:text-slate-500 data-[state=active]:shadow-md rounded-2xl py-3.5 px-5 font-bold transition-all flex-1 min-w-[120px] whitespace-nowrap shrink-0",children:[e.jsx(P,{className:"w-5 h-5 mr-2"})," Bottoms"]}),e.jsxs(n,{value:"Shoes",className:"data-[state=active]:bg-gradient-to-r data-[state=active]:from-purple-500 data-[state=active]:to-pink-500 data-[state=active]:text-white data-[state=inactive]:hover:bg-purple-50 data-[state=inactive]:text-slate-500 data-[state=active]:shadow-md rounded-2xl py-3.5 px-5 font-bold transition-all flex-1 min-w-[120px] whitespace-nowrap shrink-0",children:[e.jsx(C,{className:"w-5 h-5 mr-2"})," Shoes"]}),e.jsxs(n,{value:"Accessories",className:"data-[state=active]:bg-gradient-to-r data-[state=active]:from-purple-500 data-[state=active]:to-pink-500 data-[state=active]:text-white data-[state=inactive]:hover:bg-purple-50 data-[state=inactive]:text-slate-500 data-[state=active]:shadow-md rounded-2xl py-3.5 px-5 font-bold transition-all flex-1 min-w-[120px] whitespace-nowrap shrink-0",children:[e.jsx(S,{className:"w-5 h-5 mr-2"})," Accs"]})]}),v.map(t=>e.jsx(k,{value:t,className:"flex-1 focus-visible:outline-none focus-visible:ring-0",children:t==="Accessories"?e.jsxs("div",{className:"h-48 md:h-64 flex flex-col items-center justify-center text-slate-400 font-medium bg-white/50 backdrop-blur-sm rounded-[2rem] border-4 border-dashed border-slate-200/60 gap-4 relative overflow-hidden group",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-100/30 to-pink-100/30 opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),e.jsx(o.div,{className:"w-20 h-20 bg-white rounded-3xl flex items-center justify-center shadow-[0_10px_30px_-10px_rgba(0,0,0,0.1)] rotate-3 group-hover:rotate-12 transition-transform duration-300",animate:{y:[0,-10,0]},transition:{duration:4,repeat:1/0,ease:"easeInOut"},children:e.jsx(A,{className:"w-10 h-10 text-purple-400 drop-shadow-sm"})}),e.jsx("p",{className:"text-xl font-bold text-slate-500 group-hover:text-purple-500 transition-colors",children:"Accessories dropping soon! 🎁"})]}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-5 lg:gap-6 pb-8 lg:pb-0 h-full content-start",children:E.filter(a=>a.category===t).map(a=>{const l=r[t.toLowerCase()]===a.id;return e.jsxs(o.div,{whileHover:{scale:1.05,y:-4,rotate:Math.random()*2-1},whileTap:{scale:.95},onClick:()=>g(a),className:i("relative cursor-pointer rounded-[2rem] transition-all overflow-hidden flex flex-col items-center p-5 aspect-square bg-white border-4 justify-end group",l?"border-pink-500 shadow-[0_15px_35px_-5px_rgba(236,72,153,0.4)]":"border-slate-100 hover:border-sky-300 hover:shadow-[0_15px_35px_-5px_rgba(56,189,248,0.3)] shadow-sm"),children:[e.jsx("div",{className:i("absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 bg-gradient-to-tr from-transparent via-white/50 to-white/10",l&&"opacity-100 bg-gradient-to-t from-pink-50/50 to-transparent")}),e.jsx("div",{className:"absolute inset-0 top-4 bottom-[20%] flex items-center justify-center pointer-events-none mix-blend-multiply overflow-hidden z-10 transition-transform duration-300 group-hover:scale-110",children:e.jsx("img",{src:a.thumbnail||a.src,alt:a.name,className:i("w-full h-full object-contain drop-shadow-xl transition-all duration-300",!a.thumbnail&&w(a.category))})}),e.jsx("span",{className:i("text-sm lg:text-base font-black z-20 bg-white/90 backdrop-blur-md px-4 py-1.5 rounded-xl mt-auto text-center w-full transition-colors",l?"text-pink-600":"text-slate-700"),children:a.name}),l&&e.jsx("div",{className:"absolute top-4 right-4 bg-gradient-to-r from-pink-500 to-purple-500 text-white text-[10px] uppercase font-black px-3 py-1.5 rounded-full z-20 shadow-lg transform rotate-3",children:"Equipped ✨"})]},a.id)})})},t))]})]}),e.jsxs("div",{className:"flex-1 lg:w-[45%] flex flex-col items-center justify-center p-8 lg:p-12 relative bg-transparent overflow-hidden",children:[e.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-gradient-to-tr from-purple-300/50 via-sky-300/30 to-pink-300/40 blur-[100px] rounded-full pointer-events-none"}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-12 w-full max-w-[480px]",children:[e.jsxs("div",{className:"relative w-[340px] h-[340px] sm:w-[440px] sm:h-[440px] rounded-[3rem] bg-[#0A1128] border-[6px] border-[#1E293B] shadow-[0_30px_60px_rgba(15,23,42,0.4),inset_0_0_120px_rgba(0,0,0,0.9)] flex items-end justify-center pt-10 overflow-hidden transform-gpu shrink-0 ring-1 ring-white/10",children:[e.jsx("div",{className:"absolute top-[-10%] left-0 right-0 h-[110%] pointer-events-none mix-blend-screen",style:{background:"linear-gradient(to bottom, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.05) 60%, transparent 100%)",clipPath:"polygon(15% 0, 85% 0, 65% 100%, 35% 100%)"}}),e.jsx("div",{className:"absolute bottom-5 left-1/2 -translate-x-1/2 w-[60%] h-8 bg-sky-300/30 blur-[15px] rounded-[100%] pointer-events-none"}),e.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-80 h-80 bg-gradient-to-br from-sky-500/20 to-indigo-500/20 blur-[70px] rounded-full pointer-events-none"}),e.jsxs(o.div,{className:"relative w-full h-[120%] pb-6",animate:{y:[-5,5,-5]},transition:{repeat:1/0,duration:3.5,ease:"easeInOut"},children:[e.jsx("img",{src:"/avatar/avatar_body.png",className:"absolute inset-0 w-full h-full object-contain z-10",alt:"Base Avatar"}),r.bottoms&&e.jsx("img",{src:`/avatar/${r.bottoms}.png`,className:"absolute inset-0 w-full h-full object-contain z-20",alt:"Pants"}),r.shoes&&e.jsx("img",{src:`/avatar/${r.shoes}.png`,className:"absolute inset-0 w-full h-full object-contain z-30",alt:"Shoes"}),r.tops&&e.jsx("img",{src:`/avatar/${r.tops}.png`,className:"absolute inset-0 w-full h-full object-contain z-40",alt:"Top"}),e.jsx(o.img,{src:"/avatar/left_horn.png",className:"absolute inset-0 w-full h-full object-contain z-50 origin-[50%_45%]",animate:{rotate:[-8,8,-8]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},alt:"Left Horn"}),e.jsx(o.img,{src:"/avatar/right_horn.png",className:"absolute inset-0 w-full h-full object-contain z-50 origin-[50%_45%]",animate:{rotate:[8,-8,8]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},alt:"Right Horn"}),e.jsx("div",{className:"absolute inset-0 pointer-events-none bg-gradient-to-t from-slate-900/40 via-transparent to-transparent z-[60]"})]})]}),e.jsxs(N,{size:"lg",className:"relative w-full bg-blue-600 hover:bg-blue-500 text-white font-black h-[72px] rounded-2xl shadow-[0_10px_30px_-10px_rgba(37,99,235,0.6)] text-lg sm:text-xl transition-all hover:-translate-y-1 active:scale-95 group overflow-hidden border border-blue-500",onClick:f,disabled:m,children:[e.jsx("div",{className:"absolute inset-0 bg-white/10 translate-y-full group-hover:translate-y-0 transition-transform duration-300 ease-out"}),e.jsx("span",{className:"relative z-10 flex items-center justify-center gap-2",children:m?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"h-5 w-5 animate-spin"}),"Saving..."]}):"Save Profile Avatar"})]})]})]})]})]})};export{X as default};
 
 
 
 
 
 
 
 
 
 
 
 
assets/{ChatMarkdown-BI4vbcO7.js β†’ ChatMarkdown-XT9mMuBR.js} RENAMED
@@ -1,2 +1,2 @@
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-C5ikSDMA.js","assets/vendor-react-Dexh7fmo.js","assets/vendor-markdown-CBmFCdgC.css"])))=>i.map(i=>d[i]);
2
- import{P as i,_ as c}from"./index-DGWrSMOK.js";import{r as m,j as r}from"./vendor-react-Dexh7fmo.js";import{M as h,r as x,a as y}from"./vendor-markdown-C5ikSDMA.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";let a=null;const p=()=>(a||(a=c(()=>import("./vendor-markdown-C5ikSDMA.js").then(l=>l.k),__vite__mapDeps([0,1,2]))),a),v=({children:l})=>{if(m.useEffect(()=>{p()},[]),!l||typeof l!="string")return null;const t=i(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:n,children:o,...d}=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"} ${n||""}`,...d,children:o})},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{v as default};
 
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-C5ikSDMA.js","assets/vendor-react-Dexh7fmo.js","assets/vendor-markdown-CBmFCdgC.css"])))=>i.map(i=>d[i]);
2
+ import{Q as i,_ as c}from"./index-CmBdDSkw.js";import{r as m,j as r}from"./vendor-react-Dexh7fmo.js";import{M as h,r as x,a as y}from"./vendor-markdown-C5ikSDMA.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";let a=null;const p=()=>(a||(a=c(()=>import("./vendor-markdown-C5ikSDMA.js").then(l=>l.k),__vite__mapDeps([0,1,2]))),a),v=({children:l})=>{if(m.useEffect(()=>{p()},[]),!l||typeof l!="string")return null;const t=i(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:n,children:o,...d}=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"} ${n||""}`,...d,children:o})},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{v as default};
assets/{CompetencyRadarChart-Bv4P4qFs.js β†’ CompetencyRadarChart-B1x3Wmwg.js} RENAMED
@@ -1,2 +1,2 @@
1
- import{c as u,g as he,r as A,j as p}from"./vendor-react-Dexh7fmo.js";import{u as it,q as at,m as ot}from"./index-DGWrSMOK.js";import{g as st,s as ke}from"./subjects-DDYtJwQO.js";import{B as ct}from"./brain-DHmY5cbv.js";import{S as lt}from"./sparkles-DxmNHQEo.js";import{f as b,x as w,y as qe,z as ut,A as We,D as ft,b as B,T as Ke,L as S,E as Ve,d as Ge,e as pt,F as He,H as dt,I as X,J as mt,K as yt,G as ht,M as we,N as vt,O as _e,r as gt,P as bt,R as xt,v as Pt}from"./generateCategoricalChart-CiUYzAvW.js";import{c as N}from"./clsx-B-dksMZM.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./trending-up-B2MPUPwk.js";import"./chart-column-CJzwyNMx.js";var Ot=["points","className","baseLinePoints","connectNulls"];function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},F.apply(this,arguments)}function jt(t,e){if(t==null)return{};var n=kt(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function kt(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Ae(t){return Et(t)||At(t)||_t(t)||wt()}function wt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _t(t,e){if(t){if(typeof t=="string")return pe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(t,e)}}function At(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Et(t){if(Array.isArray(t))return pe(t)}function pe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ee=function(e){return e&&e.x===+e.x&&e.y===+e.y},St=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(r){Ee(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),Ee(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},V=function(e,n){var r=St(e);n&&(r=[r.reduce(function(a,o){return[].concat(Ae(a),Ae(o))},[])]);var i=r.map(function(a){return a.reduce(function(o,s,c){return"".concat(o).concat(c===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},Nt=function(e,n,r){var i=V(e,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(V(n.reverse(),r).slice(1))},Ze=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,a=e.connectNulls,o=jt(e,Ot);if(!n||!n.length)return null;var s=N("recharts-polygon",r);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",d=Nt(n,i,a);return u.createElement("g",{className:s},u.createElement("path",F({},b(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",stroke:"none",d})),c?u.createElement("path",F({},b(o,!0),{fill:"none",d:V(n,a)})):null,c?u.createElement("path",F({},b(o,!0),{fill:"none",d:V(i,a)})):null)}var f=V(n,a);return u.createElement("path",F({},b(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))},Tt=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function H(t){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(t)}function $t(t,e){if(t==null)return{};var n=Rt(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Rt(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function T(){return T=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},T.apply(this,arguments)}function Se(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Z(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Se(Object(n),!0).forEach(function(r){Lt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Se(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Lt(t,e,n){return e=Dt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dt(t){var e=It(t,"string");return H(e)=="symbol"?e:e+""}function It(t,e){if(H(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(H(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Mt=function(e,n,r,i){var a="";return i.forEach(function(o,s){var c=w(n,r,e,o);s?a+="L ".concat(c.x,",").concat(c.y):a+="M ".concat(c.x,",").concat(c.y)}),a+="Z",a},Ct=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.polarAngles,s=e.radialLines;if(!o||!o.length||!s)return null;var c=Z({stroke:"#ccc"},b(e,!1));return u.createElement("g",{className:"recharts-polar-grid-angle"},o.map(function(d){var f=w(n,r,i,d),m=w(n,r,a,d);return u.createElement("line",T({},c,{key:"line-".concat(d),x1:f.x,y1:f.y,x2:m.x,y2:m.y}))}))},Bt=function(e){var n=e.cx,r=e.cy,i=e.radius,a=e.index,o=Z(Z({stroke:"#ccc"},b(e,!1)),{},{fill:"none"});return u.createElement("circle",T({},o,{className:N("recharts-polar-grid-concentric-circle",e.className),key:"circle-".concat(a),cx:n,cy:r,r:i}))},Ft=function(e){var n=e.radius,r=e.index,i=Z(Z({stroke:"#ccc"},b(e,!1)),{},{fill:"none"});return u.createElement("path",T({},i,{className:N("recharts-polar-grid-concentric-polygon",e.className),key:"path-".concat(r),d:Mt(n,e.cx,e.cy,e.polarAngles)}))},zt=function(e){var n=e.polarRadius,r=e.gridType;return!n||!n.length?null:u.createElement("g",{className:"recharts-polar-grid-concentric"},n.map(function(i,a){var o=a;return r==="circle"?u.createElement(Bt,T({key:o},e,{radius:i,index:a})):u.createElement(Ft,T({key:o},e,{radius:i,index:a}))}))},Ue=function(e){var n=e.cx,r=n===void 0?0:n,i=e.cy,a=i===void 0?0:i,o=e.innerRadius,s=o===void 0?0:o,c=e.outerRadius,d=c===void 0?0:c,f=e.gridType,m=f===void 0?"polygon":f,l=e.radialLines,v=l===void 0?!0:l,y=$t(e,Tt);return d<=0?null:u.createElement("g",{className:"recharts-polar-grid"},u.createElement(Ct,T({cx:r,cy:a,innerRadius:s,outerRadius:d,gridType:m,radialLines:v},y)),u.createElement(zt,T({cx:r,cy:a,innerRadius:s,outerRadius:d,gridType:m,radialLines:v},y)))};Ue.displayName="PolarGrid";var ce,Ne;function qt(){if(Ne)return ce;Ne=1;var t=qe(),e=ut(),n=We();function r(i,a){return i&&i.length?t(i,n(a,2),e):void 0}return ce=r,ce}var Wt=qt();const Kt=he(Wt);var le,Te;function Vt(){if(Te)return le;Te=1;var t=qe(),e=We(),n=ft();function r(i,a){return i&&i.length?t(i,e(a,2),n):void 0}return le=r,le}var Gt=Vt();const Ht=he(Gt);var Zt=["cx","cy","angle","ticks","axisLine"],Ut=["ticks","tick","angle","tickFormatter","stroke"];function z(t){"@babel/helpers - typeof";return z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(t)}function G(){return G=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},G.apply(this,arguments)}function $e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function R(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$e(Object(n),!0).forEach(function(r){ne(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Re(t,e){if(t==null)return{};var n=Yt(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Yt(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Jt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Le(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Je(r.key),r)}}function Xt(t,e,n){return e&&Le(t.prototype,e),n&&Le(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qt(t,e,n){return e=Q(e),er(t,Ye()?Reflect.construct(e,n||[],Q(t).constructor):e.apply(t,n))}function er(t,e){if(e&&(z(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tr(t)}function tr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ye(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ye=function(){return!!t})()}function Q(t){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(t)}function rr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&de(t,e)}function de(t,e){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},de(t,e)}function ne(t,e,n){return e=Je(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Je(t){var e=nr(t,"string");return z(e)=="symbol"?e:e+""}function nr(t,e){if(z(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(z(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var U=(function(t){function e(){return Jt(this,e),Qt(this,e,arguments)}return rr(e,t),Xt(e,[{key:"getTickValueCoord",value:function(r){var i=r.coordinate,a=this.props,o=a.angle,s=a.cx,c=a.cy;return w(s,c,i,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,i;switch(r){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.angle,s=r.ticks,c=Kt(s,function(f){return f.coordinate||0}),d=Ht(s,function(f){return f.coordinate||0});return{cx:i,cy:a,startAngle:o,endAngle:o,innerRadius:d.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.angle,s=r.ticks,c=r.axisLine,d=Re(r,Zt),f=s.reduce(function(y,h){return[Math.min(y[0],h.coordinate),Math.max(y[1],h.coordinate)]},[1/0,-1/0]),m=w(i,a,f[0],o),l=w(i,a,f[1],o),v=R(R(R({},b(d,!1)),{},{fill:"none"},b(c,!1)),{},{x1:m.x,y1:m.y,x2:l.x,y2:l.y});return u.createElement("line",G({className:"recharts-polar-radius-axis-line"},v))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,s=i.angle,c=i.tickFormatter,d=i.stroke,f=Re(i,Ut),m=this.getTickTextAnchor(),l=b(f,!1),v=b(o,!1),y=a.map(function(h,g){var O=r.getTickValueCoord(h),j=R(R(R(R({textAnchor:m,transform:"rotate(".concat(90-s,", ").concat(O.x,", ").concat(O.y,")")},l),{},{stroke:"none",fill:d},v),{},{index:g},O),{},{payload:h});return u.createElement(S,G({className:N("recharts-polar-radius-axis-tick",Ve(o)),key:"tick-".concat(h.coordinate)},Ge(r.props,h,g)),e.renderTickItem(o,j,c?c(h.value,g):h.value))});return u.createElement(S,{className:"recharts-polar-radius-axis-ticks"},y)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.axisLine,o=r.tick;return!i||!i.length?null:u.createElement(S,{className:N("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),o&&this.renderTicks(),pt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,i,a){var o;return u.isValidElement(r)?o=u.cloneElement(r,i):B(r)?o=r(i):o=u.createElement(Ke,G({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),o}}])})(A.PureComponent);ne(U,"displayName","PolarRadiusAxis");ne(U,"axisType","radiusAxis");ne(U,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function q(t){"@babel/helpers - typeof";return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(t)}function D(){return D=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},D.apply(this,arguments)}function De(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function L(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?De(Object(n),!0).forEach(function(r){ie(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):De(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ir(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ie(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Qe(r.key),r)}}function ar(t,e,n){return e&&Ie(t.prototype,e),n&&Ie(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function or(t,e,n){return e=ee(e),sr(t,Xe()?Reflect.construct(e,n||[],ee(t).constructor):e.apply(t,n))}function sr(t,e){if(e&&(q(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cr(t)}function cr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xe=function(){return!!t})()}function ee(t){return ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ee(t)}function lr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&me(t,e)}function me(t,e){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},me(t,e)}function ie(t,e,n){return e=Qe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qe(t){var e=ur(t,"string");return q(e)=="symbol"?e:e+""}function ur(t,e){if(q(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(q(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var fr=Math.PI/180,Me=1e-5,Y=(function(t){function e(){return ir(this,e),or(this,e,arguments)}return lr(e,t),ar(e,[{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.cx,o=i.cy,s=i.radius,c=i.orientation,d=i.tickSize,f=d||8,m=w(a,o,s,r.coordinate),l=w(a,o,s+(c==="inner"?-1:1)*f,r.coordinate);return{x1:m.x,y1:m.y,x2:l.x,y2:l.y}}},{key:"getTickTextAnchor",value:function(r){var i=this.props.orientation,a=Math.cos(-r.coordinate*fr),o;return a>Me?o=i==="outer"?"start":"end":a<-Me?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.radius,s=r.axisLine,c=r.axisLineType,d=L(L({},b(this.props,!1)),{},{fill:"none"},b(s,!1));if(c==="circle")return u.createElement(He,D({className:"recharts-polar-angle-axis-line"},d,{cx:i,cy:a,r:o}));var f=this.props.ticks,m=f.map(function(l){return w(i,a,o,l.coordinate)});return u.createElement(Ze,D({className:"recharts-polar-angle-axis-line"},d,{points:m}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,c=i.tickFormatter,d=i.stroke,f=b(this.props,!1),m=b(o,!1),l=L(L({},f),{},{fill:"none"},b(s,!1)),v=a.map(function(y,h){var g=r.getTickLineCoord(y),O=r.getTickTextAnchor(y),j=L(L(L({textAnchor:O},f),{},{stroke:"none",fill:d},m),{},{index:h,payload:y,x:g.x2,y:g.y2});return u.createElement(S,D({className:N("recharts-polar-angle-axis-tick",Ve(o)),key:"tick-".concat(y.coordinate)},Ge(r.props,y,h)),s&&u.createElement("line",D({className:"recharts-polar-angle-axis-tick-line"},l,g)),o&&e.renderTickItem(o,j,c?c(y.value,h):y.value))});return u.createElement(S,{className:"recharts-polar-angle-axis-ticks"},v)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!i||!i.length?null:u.createElement(S,{className:N("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var o;return u.isValidElement(r)?o=u.cloneElement(r,i):B(r)?o=r(i):o=u.createElement(Ke,D({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])})(A.PureComponent);ie(Y,"displayName","PolarAngleAxis");ie(Y,"axisType","angleAxis");ie(Y,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var ue,Ce;function pr(){if(Ce)return ue;Ce=1;function t(e){return e&&e.length?e[0]:void 0}return ue=t,ue}var fe,Be;function dr(){return Be||(Be=1,fe=pr()),fe}var mr=dr();const yr=he(mr);var hr=["key"];function W(t){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(t)}function vr(t,e){if(t==null)return{};var n=gr(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function gr(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function te(){return te=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},te.apply(this,arguments)}function Fe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Fe(Object(n),!0).forEach(function(r){E(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function br(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ze(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tt(r.key),r)}}function xr(t,e,n){return e&&ze(t.prototype,e),n&&ze(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pr(t,e,n){return e=re(e),Or(t,et()?Reflect.construct(e,n||[],re(t).constructor):e.apply(t,n))}function Or(t,e){if(e&&(W(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jr(t)}function jr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function et(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(et=function(){return!!t})()}function re(t){return re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},re(t)}function kr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ye(t,e)}function ye(t,e){return ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ye(t,e)}function E(t,e,n){return e=tt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tt(t){var e=wr(t,"string");return W(e)=="symbol"?e:e+""}function wr(t,e){if(W(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(W(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var J=(function(t){function e(){var n;br(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Pr(this,e,[].concat(i)),E(n,"state",{isAnimationFinished:!1}),E(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),B(o)&&o()}),E(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),B(o)&&o()}),E(n,"handleMouseEnter",function(o){var s=n.props.onMouseEnter;s&&s(n.props,o)}),E(n,"handleMouseLeave",function(o){var s=n.props.onMouseLeave;s&&s(n.props,o)}),n}return kr(e,t),xr(e,[{key:"renderDots",value:function(r){var i=this.props,a=i.dot,o=i.dataKey,s=b(this.props,!1),c=b(a,!0),d=r.map(function(f,m){var l=P(P(P({key:"dot-".concat(m),r:3},s),c),{},{dataKey:o,cx:f.x,cy:f.y,index:m,payload:f});return e.renderDotItem(a,l)});return u.createElement(S,{className:"recharts-radar-dots"},d)}},{key:"renderPolygonStatically",value:function(r){var i=this.props,a=i.shape,o=i.dot,s=i.isRange,c=i.baseLinePoints,d=i.connectNulls,f;return u.isValidElement(a)?f=u.cloneElement(a,P(P({},this.props),{},{points:r})):B(a)?f=a(P(P({},this.props),{},{points:r})):f=u.createElement(Ze,te({},b(this.props,!0),{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,points:r,baseLinePoints:s?c:null,connectNulls:d})),u.createElement(S,{className:"recharts-radar-polygon"},f,o?this.renderDots(r):null)}},{key:"renderPolygonWithAnimation",value:function(){var r=this,i=this.props,a=i.points,o=i.isAnimationActive,s=i.animationBegin,c=i.animationDuration,d=i.animationEasing,f=i.animationId,m=this.state.prevPoints;return u.createElement(dt,{begin:s,duration:c,isActive:o,easing:d,from:{t:0},to:{t:1},key:"radar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(l){var v=l.t,y=m&&m.length/a.length,h=a.map(function(g,O){var j=m&&m[Math.floor(O*y)];if(j){var ae=X(j.x,g.x),oe=X(j.y,g.y);return P(P({},g),{},{x:ae(v),y:oe(v)})}var x=X(g.cx,g.x),$=X(g.cy,g.y);return P(P({},g),{},{x:x(v),y:$(v)})});return r.renderPolygonStatically(h)})}},{key:"renderPolygon",value:function(){var r=this.props,i=r.points,a=r.isAnimationActive,o=r.isRange,s=this.state.prevPoints;return a&&i&&i.length&&!o&&(!s||!mt(s,i))?this.renderPolygonWithAnimation():this.renderPolygonStatically(i)}},{key:"render",value:function(){var r=this.props,i=r.hide,a=r.className,o=r.points,s=r.isAnimationActive;if(i||!o||!o.length)return null;var c=this.state.isAnimationFinished,d=N("recharts-radar",a);return u.createElement(S,{className:d},this.renderPolygon(),(!s||c)&&yt.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"renderDotItem",value:function(r,i){var a;if(u.isValidElement(r))a=u.cloneElement(r,i);else if(B(r))a=r(i);else{var o=i.key,s=vr(i,hr);a=u.createElement(He,te({},s,{key:o,className:N("recharts-radar-dot",typeof r!="boolean"?r.className:"")}))}return a}}])})(A.PureComponent);E(J,"displayName","Radar");E(J,"defaultProps",{angleAxisId:0,radiusAxisId:0,hide:!1,activeDot:!0,dot:!1,legendType:"rect",isAnimationActive:!ht.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});E(J,"getComposedData",function(t){var e=t.radiusAxis,n=t.angleAxis,r=t.displayedData,i=t.dataKey,a=t.bandSize,o=n.cx,s=n.cy,c=!1,d=[],f=n.type!=="number"?a??0:0;r.forEach(function(l,v){var y=we(l,n.dataKey,v),h=we(l,i),g=n.scale(y)+f,O=Array.isArray(h)?vt(h):h,j=_e(O)?void 0:e.scale(O);Array.isArray(h)&&h.length>=2&&(c=!0),d.push(P(P({},w(o,s,j,g)),{},{name:y,value:h,cx:o,cy:s,radius:j,angle:g,payload:l}))});var m=[];return c&&d.forEach(function(l){if(Array.isArray(l.value)){var v=yr(l.value),y=_e(v)?void 0:e.scale(v);m.push(P(P({},l),{},{radius:y},w(o,s,y,l.angle)))}else m.push(l)}),{points:d,isRange:c,baseLinePoints:m}});var _r=gt({chartName:"RadarChart",GraphicalChild:J,axisComponents:[{axisType:"angleAxis",AxisComp:Y},{axisType:"radiusAxis",AxisComp:U}],formatAxisMap:bt,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const zr=()=>{const{userProfile:t}=it(),[e,n]=A.useState([]),[r,i]=A.useState([]),[a,o]=A.useState("N/A"),[s,c]=A.useState(!0),[d,f]=A.useState(!1),m=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];return A.useEffect(()=>{if(!t?.uid){c(!1);return}const l=t.role==="student"?t.grade:null,y=st(l)[0]??"gen-math",h=ke.find(x=>x.id===y)?.modules||[],g=new Map;ke.forEach(x=>{x.modules.forEach($=>g.set($.id,x.id))});const O=h.map((x,$)=>({id:x.id,name:x.title.length>15?x.title.substring(0,15).trim()+"...":x.title,color:m[$%m.length]}));i(O);const j=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}],ae=x=>{let $=-1,ve="N/A";const ge=j.map(_=>{const K={metric:_.label,fullMark:100};return h.forEach(k=>{const I=g.get(k.id),M=I?x?.subjects?.[I]?.modulesProgress?.[k.id]:null,be=M?.progress||0,rt=x?.lessons??{},xe=k.lessons.length?k.lessons.reduce((Oe,je)=>{const se=rt?.[je.id]?.progressPercent;if(typeof se=="number"&&Number.isFinite(se))return Oe+Math.max(0,Math.min(100,se));const nt=!!M?.lessonsCompleted?.includes?.(je.id);return Oe+(nt?100:0)},0)/k.lessons.length:0,Pe=k.quizzes.length?(M?.quizzesCompleted?.length||0)/k.quizzes.length*100:0;let C=0;_.key==="progress"?C=be:_.key==="concept"?C=xe:_.key==="application"?C=Pe:_.key==="engagement"?C=Math.min(100,(xe+Pe*2)/1.5):_.key==="consistency"&&(C=Math.min(100,40+be*.6)),K[k.id]=C||0}),K});h.forEach(_=>{let K=0;ge.forEach(I=>{const M=I[_.id];K+=typeof M=="number"?M:0});const k=K/j.length;k>$&&($=k,ve=O.find(I=>I.id===_.id)?.name||"N/A")}),o(ve),n(ge),c(!1)};c(!0);const oe=at(t.uid,x=>{ae(x)});return()=>oe()},[t?.uid]),p.jsxs(ot.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:()=>f(!0),onMouseLeave:()=>f(!1),children:[p.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"}),p.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"}),p.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 relative z-10 gap-4",children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx("span",{className:"p-2 bg-violet-100 text-violet-600 rounded-xl",children:p.jsx(ct,{size:20,className:"stroke-[2.5]"})}),p.jsx("h3",{className:"text-xl font-display font-extrabold text-[#0a1628] tracking-tight",children:"Competency Matrix"})]}),p.jsx("p",{className:"text-sm text-[#5a6578] font-body ml-12",children:"Your realtime performance across modules"})]}),p.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:[p.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-white shadow-sm border border-slate-100",children:p.jsx(lt,{size:14,className:"text-amber-500"})}),p.jsxs("div",{children:[p.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:"Top Module"}),p.jsx("p",{className:"text-sm font-bold text-slate-700",children:a})]})]})]}),p.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?p.jsx("div",{className:"w-full h-full flex items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-3",children:[p.jsx("div",{className:"w-8 h-8 border-4 border-violet-200 border-t-violet-500 rounded-full animate-spin"}),p.jsx("p",{className:"text-sm text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):p.jsx(xt,{width:"100%",height:"100%",children:p.jsxs(_r,{cx:"50%",cy:"50%",outerRadius:d?"75%":"70%",data:e,children:[p.jsx(Ue,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),p.jsx(Y,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600,fontFamily:"Inter, sans-serif"}}),p.jsx(U,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),r.map(l=>p.jsx(J,{name:l.name,dataKey:l.id,stroke:l.color,strokeWidth:2,fill:l.color,fillOpacity:.35,dot:{r:3,fill:"#fff",stroke:l.color,strokeWidth:2},activeDot:{r:5,fill:l.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},l.id)),p.jsx(Pt,{cursor:!1,content:({active:l,payload:v})=>l&&v&&v.length?p.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:[p.jsx("p",{className:"font-display font-bold text-slate-800 text-sm mb-3",children:v[0].payload.metric}),p.jsx("div",{className:"flex flex-col gap-2",children:v.map(y=>p.jsxs("div",{className:"flex items-center justify-between gap-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:y.stroke}}),p.jsx("span",{className:"text-xs font-bold text-slate-600 uppercase tracking-wide truncate max-w-[120px]",title:String(y.name),children:String(y.name)})]}),p.jsxs("span",{className:"text-sm font-black",style:{color:y.stroke},children:[Math.round(y.value),"%"]})]},y.name))})]}):null})]})})}),!s&&r.length>0&&p.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 md:gap-5 mt-[5px] z-10 relative",children:r.map(l=>p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:l.color}}),p.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-widest",children:l.name.length>15?l.name.substring(0,12)+"...":l.name})]},l.id))})]})};export{zr as CompetencyRadarChart};
 
1
+ import{c as u,g as he,r as A,j as p}from"./vendor-react-Dexh7fmo.js";import{u as it,q as at,m as ot}from"./index-CmBdDSkw.js";import{g as st,s as ke}from"./subjects-wOHUanD9.js";import{B as ct}from"./brain-DfMjTiNx.js";import{S as lt}from"./sparkles-D6B_TX7M.js";import{f as b,x as w,y as qe,z as ut,A as We,D as ft,b as B,T as Ke,L as S,E as Ve,d as Ge,e as pt,F as He,H as dt,I as X,J as mt,K as yt,G as ht,M as we,N as vt,O as _e,r as gt,P as bt,R as xt,v as Pt}from"./generateCategoricalChart-CiUYzAvW.js";import{c as N}from"./clsx-B-dksMZM.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./trending-up-6u76yy2e.js";import"./chart-column-DzJCKCOe.js";var Ot=["points","className","baseLinePoints","connectNulls"];function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},F.apply(this,arguments)}function jt(t,e){if(t==null)return{};var n=kt(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function kt(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Ae(t){return Et(t)||At(t)||_t(t)||wt()}function wt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _t(t,e){if(t){if(typeof t=="string")return pe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(t,e)}}function At(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Et(t){if(Array.isArray(t))return pe(t)}function pe(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Ee=function(e){return e&&e.x===+e.x&&e.y===+e.y},St=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(r){Ee(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),Ee(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},V=function(e,n){var r=St(e);n&&(r=[r.reduce(function(a,o){return[].concat(Ae(a),Ae(o))},[])]);var i=r.map(function(a){return a.reduce(function(o,s,c){return"".concat(o).concat(c===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return r.length===1?"".concat(i,"Z"):i},Nt=function(e,n,r){var i=V(e,r);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(V(n.reverse(),r).slice(1))},Ze=function(e){var n=e.points,r=e.className,i=e.baseLinePoints,a=e.connectNulls,o=jt(e,Ot);if(!n||!n.length)return null;var s=N("recharts-polygon",r);if(i&&i.length){var c=o.stroke&&o.stroke!=="none",d=Nt(n,i,a);return u.createElement("g",{className:s},u.createElement("path",F({},b(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",stroke:"none",d})),c?u.createElement("path",F({},b(o,!0),{fill:"none",d:V(n,a)})):null,c?u.createElement("path",F({},b(o,!0),{fill:"none",d:V(i,a)})):null)}var f=V(n,a);return u.createElement("path",F({},b(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))},Tt=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function H(t){"@babel/helpers - typeof";return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(t)}function $t(t,e){if(t==null)return{};var n=Rt(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Rt(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function T(){return T=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},T.apply(this,arguments)}function Se(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Z(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Se(Object(n),!0).forEach(function(r){Lt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Se(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Lt(t,e,n){return e=Dt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dt(t){var e=It(t,"string");return H(e)=="symbol"?e:e+""}function It(t,e){if(H(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(H(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Mt=function(e,n,r,i){var a="";return i.forEach(function(o,s){var c=w(n,r,e,o);s?a+="L ".concat(c.x,",").concat(c.y):a+="M ".concat(c.x,",").concat(c.y)}),a+="Z",a},Ct=function(e){var n=e.cx,r=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.polarAngles,s=e.radialLines;if(!o||!o.length||!s)return null;var c=Z({stroke:"#ccc"},b(e,!1));return u.createElement("g",{className:"recharts-polar-grid-angle"},o.map(function(d){var f=w(n,r,i,d),m=w(n,r,a,d);return u.createElement("line",T({},c,{key:"line-".concat(d),x1:f.x,y1:f.y,x2:m.x,y2:m.y}))}))},Bt=function(e){var n=e.cx,r=e.cy,i=e.radius,a=e.index,o=Z(Z({stroke:"#ccc"},b(e,!1)),{},{fill:"none"});return u.createElement("circle",T({},o,{className:N("recharts-polar-grid-concentric-circle",e.className),key:"circle-".concat(a),cx:n,cy:r,r:i}))},Ft=function(e){var n=e.radius,r=e.index,i=Z(Z({stroke:"#ccc"},b(e,!1)),{},{fill:"none"});return u.createElement("path",T({},i,{className:N("recharts-polar-grid-concentric-polygon",e.className),key:"path-".concat(r),d:Mt(n,e.cx,e.cy,e.polarAngles)}))},zt=function(e){var n=e.polarRadius,r=e.gridType;return!n||!n.length?null:u.createElement("g",{className:"recharts-polar-grid-concentric"},n.map(function(i,a){var o=a;return r==="circle"?u.createElement(Bt,T({key:o},e,{radius:i,index:a})):u.createElement(Ft,T({key:o},e,{radius:i,index:a}))}))},Ue=function(e){var n=e.cx,r=n===void 0?0:n,i=e.cy,a=i===void 0?0:i,o=e.innerRadius,s=o===void 0?0:o,c=e.outerRadius,d=c===void 0?0:c,f=e.gridType,m=f===void 0?"polygon":f,l=e.radialLines,v=l===void 0?!0:l,y=$t(e,Tt);return d<=0?null:u.createElement("g",{className:"recharts-polar-grid"},u.createElement(Ct,T({cx:r,cy:a,innerRadius:s,outerRadius:d,gridType:m,radialLines:v},y)),u.createElement(zt,T({cx:r,cy:a,innerRadius:s,outerRadius:d,gridType:m,radialLines:v},y)))};Ue.displayName="PolarGrid";var ce,Ne;function qt(){if(Ne)return ce;Ne=1;var t=qe(),e=ut(),n=We();function r(i,a){return i&&i.length?t(i,n(a,2),e):void 0}return ce=r,ce}var Wt=qt();const Kt=he(Wt);var le,Te;function Vt(){if(Te)return le;Te=1;var t=qe(),e=We(),n=ft();function r(i,a){return i&&i.length?t(i,e(a,2),n):void 0}return le=r,le}var Gt=Vt();const Ht=he(Gt);var Zt=["cx","cy","angle","ticks","axisLine"],Ut=["ticks","tick","angle","tickFormatter","stroke"];function z(t){"@babel/helpers - typeof";return z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(t)}function G(){return G=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},G.apply(this,arguments)}function $e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function R(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$e(Object(n),!0).forEach(function(r){ne(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Re(t,e){if(t==null)return{};var n=Yt(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function Yt(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function Jt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Le(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Je(r.key),r)}}function Xt(t,e,n){return e&&Le(t.prototype,e),n&&Le(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qt(t,e,n){return e=Q(e),er(t,Ye()?Reflect.construct(e,n||[],Q(t).constructor):e.apply(t,n))}function er(t,e){if(e&&(z(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tr(t)}function tr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ye(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ye=function(){return!!t})()}function Q(t){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(t)}function rr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&de(t,e)}function de(t,e){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},de(t,e)}function ne(t,e,n){return e=Je(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Je(t){var e=nr(t,"string");return z(e)=="symbol"?e:e+""}function nr(t,e){if(z(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(z(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var U=(function(t){function e(){return Jt(this,e),Qt(this,e,arguments)}return rr(e,t),Xt(e,[{key:"getTickValueCoord",value:function(r){var i=r.coordinate,a=this.props,o=a.angle,s=a.cx,c=a.cy;return w(s,c,i,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,i;switch(r){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.angle,s=r.ticks,c=Kt(s,function(f){return f.coordinate||0}),d=Ht(s,function(f){return f.coordinate||0});return{cx:i,cy:a,startAngle:o,endAngle:o,innerRadius:d.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.angle,s=r.ticks,c=r.axisLine,d=Re(r,Zt),f=s.reduce(function(y,h){return[Math.min(y[0],h.coordinate),Math.max(y[1],h.coordinate)]},[1/0,-1/0]),m=w(i,a,f[0],o),l=w(i,a,f[1],o),v=R(R(R({},b(d,!1)),{},{fill:"none"},b(c,!1)),{},{x1:m.x,y1:m.y,x2:l.x,y2:l.y});return u.createElement("line",G({className:"recharts-polar-radius-axis-line"},v))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,s=i.angle,c=i.tickFormatter,d=i.stroke,f=Re(i,Ut),m=this.getTickTextAnchor(),l=b(f,!1),v=b(o,!1),y=a.map(function(h,g){var O=r.getTickValueCoord(h),j=R(R(R(R({textAnchor:m,transform:"rotate(".concat(90-s,", ").concat(O.x,", ").concat(O.y,")")},l),{},{stroke:"none",fill:d},v),{},{index:g},O),{},{payload:h});return u.createElement(S,G({className:N("recharts-polar-radius-axis-tick",Ve(o)),key:"tick-".concat(h.coordinate)},Ge(r.props,h,g)),e.renderTickItem(o,j,c?c(h.value,g):h.value))});return u.createElement(S,{className:"recharts-polar-radius-axis-ticks"},y)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.axisLine,o=r.tick;return!i||!i.length?null:u.createElement(S,{className:N("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),o&&this.renderTicks(),pt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,i,a){var o;return u.isValidElement(r)?o=u.cloneElement(r,i):B(r)?o=r(i):o=u.createElement(Ke,G({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),o}}])})(A.PureComponent);ne(U,"displayName","PolarRadiusAxis");ne(U,"axisType","radiusAxis");ne(U,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function q(t){"@babel/helpers - typeof";return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(t)}function D(){return D=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},D.apply(this,arguments)}function De(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function L(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?De(Object(n),!0).forEach(function(r){ie(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):De(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ir(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ie(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Qe(r.key),r)}}function ar(t,e,n){return e&&Ie(t.prototype,e),n&&Ie(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function or(t,e,n){return e=ee(e),sr(t,Xe()?Reflect.construct(e,n||[],ee(t).constructor):e.apply(t,n))}function sr(t,e){if(e&&(q(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cr(t)}function cr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xe=function(){return!!t})()}function ee(t){return ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ee(t)}function lr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&me(t,e)}function me(t,e){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},me(t,e)}function ie(t,e,n){return e=Qe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qe(t){var e=ur(t,"string");return q(e)=="symbol"?e:e+""}function ur(t,e){if(q(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(q(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var fr=Math.PI/180,Me=1e-5,Y=(function(t){function e(){return ir(this,e),or(this,e,arguments)}return lr(e,t),ar(e,[{key:"getTickLineCoord",value:function(r){var i=this.props,a=i.cx,o=i.cy,s=i.radius,c=i.orientation,d=i.tickSize,f=d||8,m=w(a,o,s,r.coordinate),l=w(a,o,s+(c==="inner"?-1:1)*f,r.coordinate);return{x1:m.x,y1:m.y,x2:l.x,y2:l.y}}},{key:"getTickTextAnchor",value:function(r){var i=this.props.orientation,a=Math.cos(-r.coordinate*fr),o;return a>Me?o=i==="outer"?"start":"end":a<-Me?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.cx,a=r.cy,o=r.radius,s=r.axisLine,c=r.axisLineType,d=L(L({},b(this.props,!1)),{},{fill:"none"},b(s,!1));if(c==="circle")return u.createElement(He,D({className:"recharts-polar-angle-axis-line"},d,{cx:i,cy:a,r:o}));var f=this.props.ticks,m=f.map(function(l){return w(i,a,o,l.coordinate)});return u.createElement(Ze,D({className:"recharts-polar-angle-axis-line"},d,{points:m}))}},{key:"renderTicks",value:function(){var r=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,c=i.tickFormatter,d=i.stroke,f=b(this.props,!1),m=b(o,!1),l=L(L({},f),{},{fill:"none"},b(s,!1)),v=a.map(function(y,h){var g=r.getTickLineCoord(y),O=r.getTickTextAnchor(y),j=L(L(L({textAnchor:O},f),{},{stroke:"none",fill:d},m),{},{index:h,payload:y,x:g.x2,y:g.y2});return u.createElement(S,D({className:N("recharts-polar-angle-axis-tick",Ve(o)),key:"tick-".concat(y.coordinate)},Ge(r.props,y,h)),s&&u.createElement("line",D({className:"recharts-polar-angle-axis-tick-line"},l,g)),o&&e.renderTickItem(o,j,c?c(y.value,h):y.value))});return u.createElement(S,{className:"recharts-polar-angle-axis-ticks"},v)}},{key:"render",value:function(){var r=this.props,i=r.ticks,a=r.radius,o=r.axisLine;return a<=0||!i||!i.length?null:u.createElement(S,{className:N("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,i,a){var o;return u.isValidElement(r)?o=u.cloneElement(r,i):B(r)?o=r(i):o=u.createElement(Ke,D({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])})(A.PureComponent);ie(Y,"displayName","PolarAngleAxis");ie(Y,"axisType","angleAxis");ie(Y,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var ue,Ce;function pr(){if(Ce)return ue;Ce=1;function t(e){return e&&e.length?e[0]:void 0}return ue=t,ue}var fe,Be;function dr(){return Be||(Be=1,fe=pr()),fe}var mr=dr();const yr=he(mr);var hr=["key"];function W(t){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(t)}function vr(t,e){if(t==null)return{};var n=gr(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function gr(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function te(){return te=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},te.apply(this,arguments)}function Fe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function P(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Fe(Object(n),!0).forEach(function(r){E(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function br(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ze(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tt(r.key),r)}}function xr(t,e,n){return e&&ze(t.prototype,e),n&&ze(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pr(t,e,n){return e=re(e),Or(t,et()?Reflect.construct(e,n||[],re(t).constructor):e.apply(t,n))}function Or(t,e){if(e&&(W(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jr(t)}function jr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function et(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(et=function(){return!!t})()}function re(t){return re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},re(t)}function kr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ye(t,e)}function ye(t,e){return ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ye(t,e)}function E(t,e,n){return e=tt(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tt(t){var e=wr(t,"string");return W(e)=="symbol"?e:e+""}function wr(t,e){if(W(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(W(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var J=(function(t){function e(){var n;br(this,e);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=Pr(this,e,[].concat(i)),E(n,"state",{isAnimationFinished:!1}),E(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),B(o)&&o()}),E(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),B(o)&&o()}),E(n,"handleMouseEnter",function(o){var s=n.props.onMouseEnter;s&&s(n.props,o)}),E(n,"handleMouseLeave",function(o){var s=n.props.onMouseLeave;s&&s(n.props,o)}),n}return kr(e,t),xr(e,[{key:"renderDots",value:function(r){var i=this.props,a=i.dot,o=i.dataKey,s=b(this.props,!1),c=b(a,!0),d=r.map(function(f,m){var l=P(P(P({key:"dot-".concat(m),r:3},s),c),{},{dataKey:o,cx:f.x,cy:f.y,index:m,payload:f});return e.renderDotItem(a,l)});return u.createElement(S,{className:"recharts-radar-dots"},d)}},{key:"renderPolygonStatically",value:function(r){var i=this.props,a=i.shape,o=i.dot,s=i.isRange,c=i.baseLinePoints,d=i.connectNulls,f;return u.isValidElement(a)?f=u.cloneElement(a,P(P({},this.props),{},{points:r})):B(a)?f=a(P(P({},this.props),{},{points:r})):f=u.createElement(Ze,te({},b(this.props,!0),{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,points:r,baseLinePoints:s?c:null,connectNulls:d})),u.createElement(S,{className:"recharts-radar-polygon"},f,o?this.renderDots(r):null)}},{key:"renderPolygonWithAnimation",value:function(){var r=this,i=this.props,a=i.points,o=i.isAnimationActive,s=i.animationBegin,c=i.animationDuration,d=i.animationEasing,f=i.animationId,m=this.state.prevPoints;return u.createElement(dt,{begin:s,duration:c,isActive:o,easing:d,from:{t:0},to:{t:1},key:"radar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(l){var v=l.t,y=m&&m.length/a.length,h=a.map(function(g,O){var j=m&&m[Math.floor(O*y)];if(j){var ae=X(j.x,g.x),oe=X(j.y,g.y);return P(P({},g),{},{x:ae(v),y:oe(v)})}var x=X(g.cx,g.x),$=X(g.cy,g.y);return P(P({},g),{},{x:x(v),y:$(v)})});return r.renderPolygonStatically(h)})}},{key:"renderPolygon",value:function(){var r=this.props,i=r.points,a=r.isAnimationActive,o=r.isRange,s=this.state.prevPoints;return a&&i&&i.length&&!o&&(!s||!mt(s,i))?this.renderPolygonWithAnimation():this.renderPolygonStatically(i)}},{key:"render",value:function(){var r=this.props,i=r.hide,a=r.className,o=r.points,s=r.isAnimationActive;if(i||!o||!o.length)return null;var c=this.state.isAnimationFinished,d=N("recharts-radar",a);return u.createElement(S,{className:d},this.renderPolygon(),(!s||c)&&yt.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"renderDotItem",value:function(r,i){var a;if(u.isValidElement(r))a=u.cloneElement(r,i);else if(B(r))a=r(i);else{var o=i.key,s=vr(i,hr);a=u.createElement(He,te({},s,{key:o,className:N("recharts-radar-dot",typeof r!="boolean"?r.className:"")}))}return a}}])})(A.PureComponent);E(J,"displayName","Radar");E(J,"defaultProps",{angleAxisId:0,radiusAxisId:0,hide:!1,activeDot:!0,dot:!1,legendType:"rect",isAnimationActive:!ht.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});E(J,"getComposedData",function(t){var e=t.radiusAxis,n=t.angleAxis,r=t.displayedData,i=t.dataKey,a=t.bandSize,o=n.cx,s=n.cy,c=!1,d=[],f=n.type!=="number"?a??0:0;r.forEach(function(l,v){var y=we(l,n.dataKey,v),h=we(l,i),g=n.scale(y)+f,O=Array.isArray(h)?vt(h):h,j=_e(O)?void 0:e.scale(O);Array.isArray(h)&&h.length>=2&&(c=!0),d.push(P(P({},w(o,s,j,g)),{},{name:y,value:h,cx:o,cy:s,radius:j,angle:g,payload:l}))});var m=[];return c&&d.forEach(function(l){if(Array.isArray(l.value)){var v=yr(l.value),y=_e(v)?void 0:e.scale(v);m.push(P(P({},l),{},{radius:y},w(o,s,y,l.angle)))}else m.push(l)}),{points:d,isRange:c,baseLinePoints:m}});var _r=gt({chartName:"RadarChart",GraphicalChild:J,axisComponents:[{axisType:"angleAxis",AxisComp:Y},{axisType:"radiusAxis",AxisComp:U}],formatAxisMap:bt,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const zr=()=>{const{userProfile:t}=it(),[e,n]=A.useState([]),[r,i]=A.useState([]),[a,o]=A.useState("N/A"),[s,c]=A.useState(!0),[d,f]=A.useState(!1),m=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];return A.useEffect(()=>{if(!t?.uid){c(!1);return}const l=t.role==="student"?t.grade:null,y=st(l)[0]??"gen-math",h=ke.find(x=>x.id===y)?.modules||[],g=new Map;ke.forEach(x=>{x.modules.forEach($=>g.set($.id,x.id))});const O=h.map((x,$)=>({id:x.id,name:x.title.length>15?x.title.substring(0,15).trim()+"...":x.title,color:m[$%m.length]}));i(O);const j=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}],ae=x=>{let $=-1,ve="N/A";const ge=j.map(_=>{const K={metric:_.label,fullMark:100};return h.forEach(k=>{const I=g.get(k.id),M=I?x?.subjects?.[I]?.modulesProgress?.[k.id]:null,be=M?.progress||0,rt=x?.lessons??{},xe=k.lessons.length?k.lessons.reduce((Oe,je)=>{const se=rt?.[je.id]?.progressPercent;if(typeof se=="number"&&Number.isFinite(se))return Oe+Math.max(0,Math.min(100,se));const nt=!!M?.lessonsCompleted?.includes?.(je.id);return Oe+(nt?100:0)},0)/k.lessons.length:0,Pe=k.quizzes.length?(M?.quizzesCompleted?.length||0)/k.quizzes.length*100:0;let C=0;_.key==="progress"?C=be:_.key==="concept"?C=xe:_.key==="application"?C=Pe:_.key==="engagement"?C=Math.min(100,(xe+Pe*2)/1.5):_.key==="consistency"&&(C=Math.min(100,40+be*.6)),K[k.id]=C||0}),K});h.forEach(_=>{let K=0;ge.forEach(I=>{const M=I[_.id];K+=typeof M=="number"?M:0});const k=K/j.length;k>$&&($=k,ve=O.find(I=>I.id===_.id)?.name||"N/A")}),o(ve),n(ge),c(!1)};c(!0);const oe=at(t.uid,x=>{ae(x)});return()=>oe()},[t?.uid]),p.jsxs(ot.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:()=>f(!0),onMouseLeave:()=>f(!1),children:[p.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"}),p.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"}),p.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 relative z-10 gap-4",children:[p.jsxs("div",{children:[p.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[p.jsx("span",{className:"p-2 bg-violet-100 text-violet-600 rounded-xl",children:p.jsx(ct,{size:20,className:"stroke-[2.5]"})}),p.jsx("h3",{className:"text-xl font-display font-extrabold text-[#0a1628] tracking-tight",children:"Competency Matrix"})]}),p.jsx("p",{className:"text-sm text-[#5a6578] font-body ml-12",children:"Your realtime performance across modules"})]}),p.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:[p.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-white shadow-sm border border-slate-100",children:p.jsx(lt,{size:14,className:"text-amber-500"})}),p.jsxs("div",{children:[p.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:"Top Module"}),p.jsx("p",{className:"text-sm font-bold text-slate-700",children:a})]})]})]}),p.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?p.jsx("div",{className:"w-full h-full flex items-center justify-center",children:p.jsxs("div",{className:"flex flex-col items-center gap-3",children:[p.jsx("div",{className:"w-8 h-8 border-4 border-violet-200 border-t-violet-500 rounded-full animate-spin"}),p.jsx("p",{className:"text-sm text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):p.jsx(xt,{width:"100%",height:"100%",children:p.jsxs(_r,{cx:"50%",cy:"50%",outerRadius:d?"75%":"70%",data:e,children:[p.jsx(Ue,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),p.jsx(Y,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600,fontFamily:"Inter, sans-serif"}}),p.jsx(U,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),r.map(l=>p.jsx(J,{name:l.name,dataKey:l.id,stroke:l.color,strokeWidth:2,fill:l.color,fillOpacity:.35,dot:{r:3,fill:"#fff",stroke:l.color,strokeWidth:2},activeDot:{r:5,fill:l.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},l.id)),p.jsx(Pt,{cursor:!1,content:({active:l,payload:v})=>l&&v&&v.length?p.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:[p.jsx("p",{className:"font-display font-bold text-slate-800 text-sm mb-3",children:v[0].payload.metric}),p.jsx("div",{className:"flex flex-col gap-2",children:v.map(y=>p.jsxs("div",{className:"flex items-center justify-between gap-4",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:y.stroke}}),p.jsx("span",{className:"text-xs font-bold text-slate-600 uppercase tracking-wide truncate max-w-[120px]",title:String(y.name),children:String(y.name)})]}),p.jsxs("span",{className:"text-sm font-black",style:{color:y.stroke},children:[Math.round(y.value),"%"]})]},y.name))})]}):null})]})})}),!s&&r.length>0&&p.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 md:gap-5 mt-[5px] z-10 relative",children:r.map(l=>p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{backgroundColor:l.color}}),p.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-widest",children:l.name.length>15?l.name.substring(0,12)+"...":l.name})]},l.id))})]})};export{zr as CompetencyRadarChart};
assets/{CompositeAvatar-CphZ-OWw.js β†’ CompositeAvatar-DSWWcDP7.js} RENAMED
@@ -1 +1 @@
1
- import{j as t}from"./vendor-react-Dexh7fmo.js";import{g as e}from"./avatarData-DykDiQ_Y.js";import{m as s}from"./index-DGWrSMOK.js";const g=({layers:a,className:o="w-10 h-10 bg-slate-200 rounded-full",fallbackSrc:m})=>{const n=e(a?.top),i=e(a?.bottom),l=e(a?.shoes),r=e(a?.accessory),c=t.jsx("img",{src:"/avatar/avatar_body_base.png",alt:"base body",className:"absolute inset-0 w-full h-full object-contain z-10"}),u=t.jsxs(s.div,{className:"absolute inset-0 w-full h-full z-50 pointer-events-none",animate:{rotate:[-2,2,-2],y:[0,-3,0]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},style:{originY:.7,originX:.5},children:[t.jsx(s.img,{src:"/avatar/left_horn.png",alt:"left horn",className:"absolute inset-0 w-full h-full object-contain origin-[50%_45%] z-0",animate:{rotate:[-4,4,-4]},transition:{repeat:1/0,duration:4,ease:"easeInOut"}}),t.jsx(s.img,{src:"/avatar/right_horn.png",alt:"right horn",className:"absolute inset-0 w-full h-full object-contain origin-[50%_45%] z-0",animate:{rotate:[4,-4,4]},transition:{repeat:1/0,duration:4,ease:"easeInOut"}}),t.jsx("img",{src:"/avatar/avatar_head_base.png",alt:"head base",className:"absolute inset-0 w-full h-full object-contain z-10"}),t.jsx(s.img,{src:"/avatar/eyes_default.png",alt:"Avatar Eyes",className:"absolute inset-0 w-full h-full object-contain z-10",style:{originY:"50%"},animate:{scaleY:[1,.1,1]},transition:{duration:.2,repeat:1/0,repeatDelay:3.8,ease:"easeInOut"}}),r&&t.jsx("img",{src:r,alt:"accessory",className:"absolute inset-0 w-full h-full object-contain z-20"})]});return!a||!a.top&&!a.bottom&&!a.shoes&&!a.accessory?t.jsxs("div",{className:`relative overflow-hidden ${o}`,children:[c,u]}):t.jsxs("div",{className:`relative overflow-hidden ${o}`,children:[c,i&&t.jsx("img",{src:i,alt:"bottom",className:"absolute inset-0 w-full h-full object-contain z-20"}),l&&t.jsx("img",{src:l,alt:"shoes",className:"absolute inset-0 w-full h-full object-contain z-30"}),n&&t.jsx("img",{src:n,alt:"top",className:"absolute inset-0 w-full h-full object-contain z-40"}),u]})};export{g as C};
 
1
+ import{j as t}from"./vendor-react-Dexh7fmo.js";import{g as e}from"./avatarData-BW_TX0b4.js";import{m as s}from"./index-CmBdDSkw.js";const g=({layers:a,className:o="w-10 h-10 bg-slate-200 rounded-full",fallbackSrc:m})=>{const n=e(a?.top),i=e(a?.bottom),l=e(a?.shoes),r=e(a?.accessory),c=t.jsx("img",{src:"/avatar/avatar_body_base.png",alt:"base body",className:"absolute inset-0 w-full h-full object-contain z-10"}),u=t.jsxs(s.div,{className:"absolute inset-0 w-full h-full z-50 pointer-events-none",animate:{rotate:[-2,2,-2],y:[0,-3,0]},transition:{repeat:1/0,duration:4,ease:"easeInOut"},style:{originY:.7,originX:.5},children:[t.jsx(s.img,{src:"/avatar/left_horn.png",alt:"left horn",className:"absolute inset-0 w-full h-full object-contain origin-[50%_45%] z-0",animate:{rotate:[-4,4,-4]},transition:{repeat:1/0,duration:4,ease:"easeInOut"}}),t.jsx(s.img,{src:"/avatar/right_horn.png",alt:"right horn",className:"absolute inset-0 w-full h-full object-contain origin-[50%_45%] z-0",animate:{rotate:[4,-4,4]},transition:{repeat:1/0,duration:4,ease:"easeInOut"}}),t.jsx("img",{src:"/avatar/avatar_head_base.png",alt:"head base",className:"absolute inset-0 w-full h-full object-contain z-10"}),t.jsx(s.img,{src:"/avatar/eyes_default.png",alt:"Avatar Eyes",className:"absolute inset-0 w-full h-full object-contain z-10",style:{originY:"50%"},animate:{scaleY:[1,.1,1]},transition:{duration:.2,repeat:1/0,repeatDelay:3.8,ease:"easeInOut"}}),r&&t.jsx("img",{src:r,alt:"accessory",className:"absolute inset-0 w-full h-full object-contain z-20"})]});return!a||!a.top&&!a.bottom&&!a.shoes&&!a.accessory?t.jsxs("div",{className:`relative overflow-hidden ${o}`,children:[c,u]}):t.jsxs("div",{className:`relative overflow-hidden ${o}`,children:[c,i&&t.jsx("img",{src:i,alt:"bottom",className:"absolute inset-0 w-full h-full object-contain z-20"}),l&&t.jsx("img",{src:l,alt:"shoes",className:"absolute inset-0 w-full h-full object-contain z-30"}),n&&t.jsx("img",{src:n,alt:"top",className:"absolute inset-0 w-full h-full object-contain z-40"}),u]})};export{g as C};
assets/{ConfirmModal-B9CUrvQP.js β†’ ConfirmModal-BO6r5veY.js} RENAMED
@@ -1 +1 @@
1
- import{j as e}from"./vendor-react-Dexh7fmo.js";import{B as i}from"./button-DWdPuxDU.js";import{e as f,m as r,T as h}from"./index-DGWrSMOK.js";import{X as y}from"./x-Bj25rnWX.js";import{T as j}from"./trash-2-CBQVcuBL.js";import{L as w}from"./log-out-DYYu4gFF.js";import"./vendor-radix-B-ht8aK0.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.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(j,{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(y,{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-Dexh7fmo.js";import{B as i}from"./button-BP5cklmU.js";import{e as f,m as r,T as h}from"./index-CmBdDSkw.js";import{X as y}from"./x-BDSBB3q9.js";import{T as j}from"./trash-2-BGLuKCox.js";import{L as w}from"./log-out-QZHYEhcR.js";import"./vendor-radix-CxzAJozq.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.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(j,{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(y,{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/{DashboardAvatar-MX9hSo-6.js β†’ DashboardAvatar-2y_SuM8T.js} RENAMED
@@ -1 +1 @@
1
- import{j as a}from"./vendor-react-Dexh7fmo.js";import{g as e}from"./avatarData-DykDiQ_Y.js";import{m as r}from"./index-DGWrSMOK.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const x=({className:l="w-full h-full",layers:s})=>{const t="absolute inset-0 w-full h-full object-contain object-bottom",o=e(s?.top),i=e(s?.bottom),n=e(s?.shoes),c=e(s?.accessory);return a.jsxs("div",{className:`relative flex items-end justify-center ${l}`,children:[a.jsx("img",{src:"/avatar/avatar_body_base.png",alt:"Avatar Body",className:`${t} z-10`}),i&&a.jsx("img",{src:i,alt:"Pants",className:`${t} z-[12]`}),n&&a.jsx("img",{src:n,alt:"Shoes",className:`${t} z-[11]`}),o&&a.jsx("img",{src:o,alt:"Uniform",className:`${t} z-[13]`}),a.jsxs(r.div,{className:"absolute inset-0 w-full h-full z-30",style:{originY:"80%"},animate:{rotate:[-2,2,-2]},transition:{duration:4,ease:"easeInOut",repeat:1/0},children:[a.jsx("img",{src:"/avatar/avatar_head_base.png",alt:"Avatar Head",className:`${t} z-[1]`}),a.jsx(r.img,{src:"/avatar/eyes_default.png",alt:"Avatar Eyes",className:`${t} z-[2]`,style:{originY:"50%"},animate:{scaleY:[1,.1,1]},transition:{duration:.2,repeat:1/0,repeatDelay:3.8,ease:"easeInOut"}}),a.jsxs(r.div,{className:`${t} z-[3]`,style:{originY:"bottom"},animate:{rotate:[1,-1,1]},transition:{duration:3.5,ease:"easeInOut",repeat:1/0},children:[a.jsx("img",{src:"/avatar/left_horn.png",alt:"Left Horn",className:t}),a.jsx("img",{src:"/avatar/right_horn.png",alt:"Right Horn",className:t})]}),c&&a.jsx("img",{src:c,alt:"Accessory",className:`${t} z-[4]`})]})]})};export{x as DashboardAvatar,x as default};
 
1
+ import{j as a}from"./vendor-react-Dexh7fmo.js";import{g as e}from"./avatarData-BW_TX0b4.js";import{m as r}from"./index-CmBdDSkw.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const x=({className:l="w-full h-full",layers:s})=>{const t="absolute inset-0 w-full h-full object-contain object-bottom",o=e(s?.top),i=e(s?.bottom),n=e(s?.shoes),c=e(s?.accessory);return a.jsxs("div",{className:`relative flex items-end justify-center ${l}`,children:[a.jsx("img",{src:"/avatar/avatar_body_base.png",alt:"Avatar Body",className:`${t} z-10`}),i&&a.jsx("img",{src:i,alt:"Pants",className:`${t} z-[12]`}),n&&a.jsx("img",{src:n,alt:"Shoes",className:`${t} z-[11]`}),o&&a.jsx("img",{src:o,alt:"Uniform",className:`${t} z-[13]`}),a.jsxs(r.div,{className:"absolute inset-0 w-full h-full z-30",style:{originY:"80%"},animate:{rotate:[-2,2,-2]},transition:{duration:4,ease:"easeInOut",repeat:1/0},children:[a.jsx("img",{src:"/avatar/avatar_head_base.png",alt:"Avatar Head",className:`${t} z-[1]`}),a.jsx(r.img,{src:"/avatar/eyes_default.png",alt:"Avatar Eyes",className:`${t} z-[2]`,style:{originY:"50%"},animate:{scaleY:[1,.1,1]},transition:{duration:.2,repeat:1/0,repeatDelay:3.8,ease:"easeInOut"}}),a.jsxs(r.div,{className:`${t} z-[3]`,style:{originY:"bottom"},animate:{rotate:[1,-1,1]},transition:{duration:3.5,ease:"easeInOut",repeat:1/0},children:[a.jsx("img",{src:"/avatar/left_horn.png",alt:"Left Horn",className:t}),a.jsx("img",{src:"/avatar/right_horn.png",alt:"Right Horn",className:t})]}),c&&a.jsx("img",{src:c,alt:"Accessory",className:`${t} z-[4]`})]})]})};export{x as DashboardAvatar,x as default};
assets/{DiagnosticAssessmentModal-BoOvPWwv.js β†’ DiagnosticAssessmentModal-DG6T8nsY.js} RENAMED
@@ -1 +1 @@
1
- import{r as m,c as z,j as e}from"./vendor-react-Dexh7fmo.js";import{B as E}from"./button-DWdPuxDU.js";import{M as ye}from"./MathAnswerInput-Bx58557t.js";import be from"./ScientificCalculator-BP-XvW_h.js";import{triggerDiagnosticCompleted as ge}from"./automationService-1THdsq3v.js";import{m as g,C as T,e as O,T as Q}from"./index-DGWrSMOK.js";import{B as J}from"./brain-DHmY5cbv.js";import{X as Z}from"./x-Bj25rnWX.js";import{C as ee}from"./circle-check-big-mv2CRLCE.js";import{C as ve}from"./chevron-right-DxXkA9aZ.js";import{C as we}from"./chart-column-CJzwyNMx.js";import{T as je}from"./trending-up-B2MPUPwk.js";import"./vendor-radix-B-ht8aK0.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./apiService-BuaHZ1Ho.js";import"./chevron-up-BJyzaJs7.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const H="iar-v2-deped-g11-core-g12-candidate-shortform",ae=[{id:"iar-fn-01",topicArea:"Functions",gradeLevel:"G11",quarter:1,difficulty:"basic",competencyCode:"M11GM-Ia-2",competencyDescription:"Evaluates a function and solves basic linear expressions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Solve for x: 3x - 4 = 17",options:["5","6","7","8"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:35},{id:"iar-fn-02",topicArea:"Functions",gradeLevel:"G11",quarter:1,difficulty:"standard",competencyCode:"M11GM-Ib-5",competencyDescription:"Finds the domain of a rational function.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"What is the domain of f(x) = 5 / (x - 2)?",options:["All real numbers","x > 2","x β‰  2","x < 2"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-fn-03",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"standard",competencyCode:"M11GM-Ie-f-1",competencyDescription:"Solves exponential equations in real-life growth contexts.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"A quantity doubles every hour. If it starts at 3, what is the value after 4 hours?",acceptableNumericAnswers:[48],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-fn-04",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"challenge",competencyCode:"M11GM-Ii-4",competencyDescription:"Determines intercepts and asymptotic behavior of logarithmic functions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Which statement is true for f(x) = log(x - 1)?",options:["Domain is all real numbers.","Vertical asymptote is x = 1.","x-intercept is always 0.","Range is x > 1."],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-fn-c1",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"standard",competencyCode:"M11GM-Id-2",competencyDescription:"Determines the inverse of a one-to-one function.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"If f(x) = 2x + 3, what is f⁻¹(11)?",acceptableNumericAnswers:[4],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:35},{id:"iar-bm-01",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"basic",competencyCode:"M11GM-IIa-b-1",competencyDescription:"Computes simple interest and maturity value.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"Find the simple interest on PHP 8,000 at 5% annual rate for 2 years.",acceptableNumericAnswers:[800],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-bm-02",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIa-2",competencyDescription:"Distinguishes simple and compound interest contexts.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Which statement correctly describes compound interest?",options:["Interest is based only on original principal.","Interest is computed once at maturity.","Interest is computed on principal plus accumulated interest.","Interest is always lower than simple interest."],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-bm-03",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIc-d-1",competencyDescription:"Computes annuity future value in basic settings.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"A student saves PHP 1,000 monthly for 6 months with no interest. What is the accumulated amount?",options:["PHP 5,000","PHP 6,000","PHP 7,000","PHP 12,000"],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-bm-04",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"challenge",competencyCode:"M11GM-IIf-3",competencyDescription:"Solves business and consumer loan scenarios.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"A borrower receives PHP 20,000 and repays PHP 22,400 after 1 year. What is the annual simple interest rate?",options:["8%","10%","12%","14%"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:60},{id:"iar-bm-c1",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIc-d-1",competencyDescription:"Finds future value and present value of annuities.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"Without interest, what is the present value of a 12-month annuity paying PHP 500 each month?",acceptableNumericAnswers:[6e3],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-lg-01",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"basic",competencyCode:"M11GM-IIg-1",competencyDescription:"Identifies and negates propositions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:'If p is "All triangles have three sides," what is not p?',options:["Some triangles have three sides.","No triangle has three sides.","At least one triangle does not have three sides.","All triangles are polygons."],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-lg-02",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIh-1",competencyDescription:"Determines truth values of compound propositions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"When p is true and q is false, what is the truth value of p -> q?",options:["True","False","Cannot be determined","Both true and false"],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-lg-03",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIi-1",competencyDescription:"Identifies common reasoning fallacies in short arguments.",answerType:"shortAnswerText",depedBasis:"depedPattern",prompt:'A post says, "Everyone in my class passed because we used this lucky pen." Type the best label for this weak reasoning.',acceptableTextAnswers:["false cause","false causation","post hoc","hasty generalization"],isConfidenceProbe:!1,scorable:!0,estimatedSeconds:60},{id:"iar-lg-04",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"challenge",competencyCode:"M11GM-IIi-2",competencyDescription:"Determines the validity of categorical syllogisms.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"All squares are rectangles. All rectangles are quadrilaterals. Therefore all squares are quadrilaterals. This argument is:",options:["Valid","Invalid","A fallacy of composition","A contradiction"],correctOptionIndex:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-lg-c1",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIj-1",competencyDescription:"Illustrates methods of proof and disproof.",answerType:"MCQ",depedBasis:"depedPattern",prompt:'To prove "if n is even then nΒ² is even," which method is commonly used?',options:["Direct proof","Proof by contradiction only","Survey method","Graph sketch only"],correctOptionIndex:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40}];function Ne(s){return s>=75?"Mastered":s>=40?"NeedsReview":"HighRisk"}function Ce(){return ae.filter(s=>s.depedBasis==="depedPattern"&&!!s.competencyCode)}function ke(s=ae){const n=s.reduce((p,h)=>p+h.estimatedSeconds,0);return Math.round(n/60*10)/10}const te={Functions:"Functions and Graphs",BusinessMath:"Business and Financial Mathematics",Logic:"Logic and Reasoning"},Me={atRiskSubjectIds:[],questionSetVersion:H},x=Ce(),se=s=>s.trim().toLowerCase().replace(/\s+/g," "),re=(s,n)=>{if(!s.scorable)return!1;if(s.answerType==="MCQ")return typeof n=="number"&&n===s.correctOptionIndex;if(s.answerType==="shortAnswerNumeric"){if(typeof n!="string")return!1;const p=Number(n);if(Number.isNaN(p))return!1;const h=s.numericTolerance??0;return(s.acceptableNumericAnswers||[]).some(B=>Math.abs(p-B)<=h)}if(s.answerType==="shortAnswerText"){if(typeof n!="string")return!1;const p=se(n);return(s.acceptableTextAnswers||[]).some(h=>se(h)===p)}return!1},Ae=s=>s==="Mastered"?"text-teal-600 bg-teal-50":s==="NeedsReview"?"text-amber-700 bg-amber-50":"text-red-600 bg-red-50",Ie=s=>s==="NeedsReview"?"Needs Review":s==="HighRisk"?"High Risk":"Mastered",et=({isOpen:s,onClose:n,onComplete:p,lrn:h,gradeLevel:B="Grade 11",workflowMode:ie="iar_only",assessmentType:N="initial_assessment"})=>{const[v,L]=m.useState("intro"),[y,W]=m.useState(0),[ne,_]=m.useState([]),[C,I]=m.useState(""),[w,j]=m.useState(!1),[oe,b]=m.useState(!1),[a,q]=m.useState(null),[u,$]=m.useState(null),[k,V]=m.useState([]),[Se,U]=m.useState(!1);z.useEffect(()=>{s&&(L("intro"),W(0),_([]),I(""),j(!1),b(!1),q(null),$(null),V([]))},[s]),z.useEffect(()=>{if(!s||v!=="test"){b(!1);return}if(y>0||w){b(!1);return}b(!0);const t=window.setTimeout(()=>{b(!1)},2800);return()=>window.clearTimeout(t)},[s,v,y,w]);const ce=()=>{p({status:"skipped",...Me}),n()},R=()=>{n()};z.useEffect(()=>{if(!s)return;const t=i=>{i.key==="Escape"&&R()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[s]);const le=()=>{L("test")},de=t=>{_(t),I(""),j(!1),y<x.length-1?setTimeout(()=>{W(i=>i+1)},300):pe(t)},K=t=>{const i=[...ne];i[y]=t,de(i)},G=()=>{C.trim()&&K(C.trim())},pe=async t=>{const i=[],S={Functions:{correct:0,total:0},BusinessMath:{correct:0,total:0},Logic:{correct:0,total:0}},fe={Functions:[],BusinessMath:[],Logic:[]},P={};x.forEach((r,c)=>{const l=t[c];if(r.answerType==="confidenceLikert"&&typeof l=="number"&&fe[r.topicArea].push(l+1),!r.scorable)return;const d=re(r,l);S[r.topicArea].total+=1,d&&(S[r.topicArea].correct+=1),P[r.topicArea]||(P[r.topicArea]=[]),P[r.topicArea].push({correct:d,questionId:r.id,difficulty:r.difficulty,gradeLevelTag:r.gradeLevel,quarter:r.quarter,answerType:r.answerType})});const o=Object.keys(S).reduce((r,c)=>{const{correct:l,total:d}=S[c],M=d>0?Math.round(l/d*100):0,A=Ne(M);return A!=="Mastered"&&i.push(c),r[c]={correct:l,total:d,scorePercent:M,classification:A},r},{}),D=x.filter(r=>r.scorable&&r.gradeLevel==="G12Candidate"),xe=D.reduce((r,c)=>{const l=x.findIndex(d=>d.id===c.id);return r+(re(c,t[l])?1:0)},0),F=D.length>0?xe/D.length:1,he={readyForFiniteMath:Object.values(o).filter(r=>r.classification==="Mastered").length/3>=.67&&o.Functions.classification!=="HighRisk"&&o.BusinessMath.classification!=="HighRisk"&&F>=.5,readyForAdvancedStats:o.Logic.classification==="Mastered"&&F>=.67,readyForCalcIntro:o.Functions.classification==="Mastered"&&F>=.67,needsStrongerFunctions:o.Functions.classification!=="Mastered",needsStrongerBusinessMath:o.BusinessMath.classification!=="Mastered"};if(Object.keys(o).sort((r,c)=>{const l=o[r],d=o[c],M=X=>X==="HighRisk"?0:X==="NeedsReview"?1:2,A=M(l.classification)-M(d.classification);return A!==0?A:l.scorePercent-d.scorePercent}),V(i),q(o),$(he),L("results"),h){U(!0);try{const r=Object.keys(o).map(c=>({subject:c,score:o[c].scorePercent}));await ge(h,r,B,P,ie,N),console.log("[OK] Automation: diagnostic pipeline completed")}catch(r){console.error("[WARN] Automation: diagnostic pipeline failed:",r)}finally{U(!1)}}},me=()=>{if(!a||!u){p({status:"completed",atRiskSubjectIds:k,questionSetVersion:H}),n();return}p({status:"completed",atRiskSubjectIds:k,topicScores:{Functions:a.Functions.scorePercent,BusinessMath:a.BusinessMath.scorePercent,Logic:a.Logic.scorePercent},topicClassifications:{Functions:a.Functions.classification,BusinessMath:a.BusinessMath.classification,Logic:a.Logic.classification},priorityTopics:Object.keys(a).sort((t,i)=>a[t].scorePercent-a[i].scorePercent),g12ReadinessIndicators:u,questionSetVersion:H}),n()},f=x[y],Y=Math.round(y/x.length*100),ue=ke(x);return s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:()=>{R()},children:[e.jsxs(g.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"bg-white rounded-3xl shadow-2xl max-w-2xl w-full flex flex-col max-h-[90vh] pointer-events-auto overflow-hidden relative z-[51]",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"px-8 py-6 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-10 h-10 bg-sky-100 rounded-xl flex items-center justify-center text-sky-600",children:e.jsx(J,{size:24})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold text-[#0a1628]",children:N==="followup_diagnostic"?"Deep Diagnostic":"Initial Assessment"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 relative",children:[e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>{j(!w),b(!1)},className:`relative w-10 h-10 rounded-xl flex items-center justify-center transition-all duration-200 border-2 ${w?"bg-sky-100 border-sky-300 text-sky-700 shadow-sm":"bg-white border-[#dde3eb] text-slate-500 hover:text-sky-600 hover:border-sky-200 hover:bg-sky-50"}`,title:"Toggle Calculator",children:e.jsx(T,{size:20})}),e.jsx(O,{children:s&&v==="test"&&oe&&!w&&e.jsxs(g.div,{initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.95},className:"absolute right-0 top-full mt-3 w-[260px] bg-[#0a1628] text-white border border-[#2a3648] rounded-2xl p-4 shadow-2xl z-50 pointer-events-none",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-sky-500/20 flex items-center justify-center flex-shrink-0",children:e.jsx(T,{size:16,className:"text-sky-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-sm mb-1",children:"Calculator Available"}),e.jsx("p",{className:"text-xs text-slate-300 leading-relaxed",children:"You can freely use the scientific calculator at any time during this quiz."})]})]}),e.jsx("div",{className:"absolute -top-2 right-4 w-4 h-4 bg-[#0a1628] border-l border-t border-[#2a3648] rotate-45 rounded-tl-sm"})]})})]}),e.jsx("button",{onClick:()=>{R()},className:"w-10 h-10 rounded-xl flex items-center justify-center text-slate-500 border-2 border-transparent hover:text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] transition-all",title:"Close assessment",children:e.jsx(Z,{size:20})})]})]}),e.jsx("div",{className:"p-8 overflow-y-auto",children:e.jsxs(O,{mode:"wait",children:[v==="intro"&&e.jsxs(g.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"text-center space-y-6",children:[e.jsx("div",{className:"w-32 h-32 bg-sky-50 rounded-full flex items-center justify-center mx-auto mb-6",children:e.jsx(T,{size:64,className:"text-sky-600"})}),e.jsx("h3",{className:"text-2xl font-bold text-[#0a1628]",children:N==="followup_diagnostic"?"Let's close the gaps":"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[#5a6578] max-w-md mx-auto leading-relaxed",children:N==="followup_diagnostic"?"You have pending weak-area checks from your initial assessment. Complete this deep diagnostic to unlock regular modules and practice.":`To personalize your learning path, complete a DepEd competency-based SHS diagnostic (${x.length} items, around ${ue} minutes).`}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 max-w-lg mx-auto text-left",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-4 rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-[#0a1628] mb-1",children:[e.jsx(ee,{size:16,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-xs text-[#5a6578] pl-6",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-4 rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-[#0a1628] mb-1",children:[e.jsx(Q,{size:16,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-xs text-[#5a6578] pl-6",children:"Spot areas that need more attention early."})]})]}),e.jsxs("div",{className:"pt-4 space-y-3",children:[e.jsx(E,{onClick:le,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-8 py-6 rounded-xl text-lg font-bold shadow-lg shadow-sky-200 w-full max-w-xs mx-auto",children:N==="followup_diagnostic"?"Start Deep Diagnostic":"Start Assessment"}),e.jsx("button",{onClick:()=>{ce()},className:"block mx-auto text-sm text-slate-500 hover:text-[#5a6578] transition-colors font-medium",children:"Skip for now β†’"})]})]},"intro"),v==="test"&&e.jsxs(g.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm font-bold text-[#5a6578] mb-2",children:[e.jsxs("span",{children:["Question ",y+1," of ",x.length]}),e.jsxs("span",{children:[Y,"% Completed"]})]}),e.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden mb-8",children:e.jsx(g.div,{className:"h-full bg-sky-600 rounded-full",initial:{width:0},animate:{width:`${Y}%`}})}),e.jsxs("div",{className:"bg-[#edf1f7] p-6 rounded-2xl border border-[#dde3eb] mb-6",children:[e.jsxs("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500 mb-2",children:[te[f.topicArea]," β€’ ",f.difficulty]}),e.jsx("h3",{className:"text-xl font-bold text-[#0a1628] leading-relaxed",children:f.prompt})]}),(f.answerType==="MCQ"||f.answerType==="confidenceLikert")&&e.jsx("div",{className:"grid grid-cols-1 gap-3",children:(f.options||[]).map((t,i)=>e.jsxs("button",{onClick:()=>K(i),className:"w-full text-left p-4 rounded-xl border-2 border-[#dde3eb] hover:border-indigo-600 hover:bg-sky-50 transition-all font-medium text-[#0a1628] group flex items-center justify-between",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-8 h-8 rounded-lg bg-white border border-[#dde3eb] flex items-center justify-center text-sm font-bold text-[#5a6578] group-hover:border-sky-300 group-hover:text-sky-600",children:String.fromCharCode(65+i)}),t]}),e.jsx(ve,{size:18,className:"opacity-0 group-hover:opacity-100 text-sky-600 transition-opacity"})]},i))}),(f.answerType==="shortAnswerNumeric"||f.answerType==="shortAnswerText")&&e.jsxs("div",{className:"space-y-3",children:[f.answerType==="shortAnswerNumeric"?e.jsx(e.Fragment,{children:e.jsx(ye,{value:C,onChange:I,placeholder:"Type numeric answer",onSubmit:G,onCalculatorOpen:()=>{j(!0),b(!1)}})}):e.jsx("input",{id:"diagnostic-short-answer",name:"diagnostic-short-answer","aria-label":"Short answer response",value:C,onChange:t=>I(t.target.value),onKeyDown:t=>{t.key==="Enter"&&G()},className:"w-full p-4 rounded-xl border-2 border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-200 focus:border-sky-500",placeholder:"Type short answer"}),e.jsx(E,{onClick:G,disabled:!C.trim(),className:"w-full bg-sky-600 hover:bg-sky-700 text-white py-3 rounded-xl font-bold",children:"Submit Answer"})]})]},"test"),v==="results"&&e.jsxs(g.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center space-y-6",children:[e.jsx("div",{className:"w-24 h-24 bg-teal-100 rounded-full flex items-center justify-center mx-auto mb-4 animate-bounce",children:e.jsx(ee,{size:48,className:"text-teal-600"})}),e.jsx("h3",{className:"text-2xl font-bold text-[#0a1628]",children:"Assessment Completed!"}),e.jsx("p",{className:"text-[#5a6578]",children:"We computed topic-level placement from your IAR responses."}),e.jsxs("div",{className:"bg-[#edf1f7] rounded-2xl p-6 border border-[#dde3eb] text-left space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.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:e.jsx(we,{size:18,strokeWidth:2.4})}),e.jsx("h4",{className:"font-display font-black text-[22px] text-slate-800 tracking-tight",children:"Topic Analysis"})]}),e.jsx("div",{className:"space-y-3",children:a&&Object.keys(a).map(t=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-[#0a1628]",children:te[t]}),e.jsxs("p",{className:"text-xs text-slate-500",children:[a[t].correct,"/",a[t].total," correct β€’ ",a[t].scorePercent,"%"]})]}),e.jsxs("span",{className:`text-xs font-bold px-2 py-1 rounded-lg flex items-center gap-1 ${Ae(a[t].classification)}`,children:[a[t].classification==="Mastered"?e.jsx(je,{size:12}):e.jsx(Q,{size:12}),Ie(a[t].classification)]})]},t))})]}),u&&e.jsxs("div",{className:"bg-sky-50 rounded-2xl p-6 border border-sky-100 text-left space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.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:e.jsx(J,{size:18,strokeWidth:2.4})}),e.jsx("h4",{className:"font-display font-black text-[22px] text-slate-800 tracking-tight",children:"Grade 12 Readiness Signals"})]}),e.jsx("p",{className:"text-xs text-slate-600",children:"These indicators come from challenge and candidate items only."}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 text-xs",children:[e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${u.readyForFiniteMath?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Finite Math: ",u.readyForFiniteMath?"Ready":"Build More"]}),e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${u.readyForAdvancedStats?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Advanced Stats: ",u.readyForAdvancedStats?"Ready":"Build More"]}),e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${u.readyForCalcIntro?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Calculus Intro: ",u.readyForCalcIntro?"Ready":"Build More"]})]})]}),k.length>0&&e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-rose-50 border border-rose-100 rounded-xl text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-rose-100 border border-rose-200 flex items-center justify-center text-rose-600 shadow-inner shrink-0",children:e.jsx(Q,{size:18,strokeWidth:2.3})}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-display font-black text-[20px] tracking-tight text-rose-800 leading-none mb-1",children:"Attention Needed"}),e.jsxs("p",{className:"text-rose-700 text-xs mt-1",children:["We flagged ",k.length," topic area",k.length>1?"s":""," for review. In IAR + Diagnostic mode, focused deep diagnostics may launch before full unlock."]})]})]}),e.jsx("div",{className:"pt-4",children:e.jsx(E,{onClick:me,className:"bg-sky-600 hover:bg-sky-700 text-white px-8 py-4 rounded-xl text-lg font-bold w-full",children:"Go to Dashboard"})})]},"results")]})})]}),e.jsx(O,{children:w&&e.jsxs(g.div,{drag:!0,dragMomentum:!1,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{type:"spring",damping:25,stiffness:200},style:{position:"absolute",top:"50%",left:"calc(50% + 390px)",y:"-50%"},className:"w-[420px] max-w-[calc(100vw-24px)] bg-white rounded-3xl shadow-2xl border border-slate-200 flex flex-col pointer-events-auto overflow-hidden z-[60]",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0 cursor-move",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-sky-100 flex items-center justify-center text-sky-600",children:e.jsx(T,{size:18})}),e.jsx("h3",{className:"font-bold text-[#0a1628] select-none",children:"Scientific Calc"})]}),e.jsx("button",{onClick:t=>{t.stopPropagation(),j(!1)},className:"w-8 h-8 flex items-center justify-center text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-lg transition-colors cursor-pointer",title:"Close Calculator",children:e.jsx(Z,{size:16})})]}),e.jsx("div",{className:"p-4 bg-[#f7f9fc]",children:e.jsx(be,{isOpen:!0,onClose:()=>j(!1),inline:!0})})]})})]}):null};export{et as default};
 
1
+ import{r as m,c as z,j as e}from"./vendor-react-Dexh7fmo.js";import{B as E}from"./button-BP5cklmU.js";import{M as ye}from"./MathAnswerInput-DOzNwadV.js";import be from"./ScientificCalculator-B0rqpddr.js";import{triggerDiagnosticCompleted as ge}from"./automationService-IMphlGK7.js";import{m as g,C as T,e as O,T as Q}from"./index-CmBdDSkw.js";import{B as J}from"./brain-DfMjTiNx.js";import{X as Z}from"./x-BDSBB3q9.js";import{C as ee}from"./circle-check-big-C_XnLpga.js";import{C as ve}from"./chevron-right-BSCyuP_x.js";import{C as we}from"./chart-column-DzJCKCOe.js";import{T as je}from"./trending-up-6u76yy2e.js";import"./vendor-radix-CxzAJozq.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./apiService-ZZIWaV70.js";import"./chevron-up-CwQX0CFg.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const H="iar-v2-deped-g11-core-g12-candidate-shortform",ae=[{id:"iar-fn-01",topicArea:"Functions",gradeLevel:"G11",quarter:1,difficulty:"basic",competencyCode:"M11GM-Ia-2",competencyDescription:"Evaluates a function and solves basic linear expressions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Solve for x: 3x - 4 = 17",options:["5","6","7","8"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:35},{id:"iar-fn-02",topicArea:"Functions",gradeLevel:"G11",quarter:1,difficulty:"standard",competencyCode:"M11GM-Ib-5",competencyDescription:"Finds the domain of a rational function.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"What is the domain of f(x) = 5 / (x - 2)?",options:["All real numbers","x > 2","x β‰  2","x < 2"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-fn-03",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"standard",competencyCode:"M11GM-Ie-f-1",competencyDescription:"Solves exponential equations in real-life growth contexts.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"A quantity doubles every hour. If it starts at 3, what is the value after 4 hours?",acceptableNumericAnswers:[48],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-fn-04",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"challenge",competencyCode:"M11GM-Ii-4",competencyDescription:"Determines intercepts and asymptotic behavior of logarithmic functions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Which statement is true for f(x) = log(x - 1)?",options:["Domain is all real numbers.","Vertical asymptote is x = 1.","x-intercept is always 0.","Range is x > 1."],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-fn-c1",topicArea:"Functions",gradeLevel:"G11",quarter:2,difficulty:"standard",competencyCode:"M11GM-Id-2",competencyDescription:"Determines the inverse of a one-to-one function.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"If f(x) = 2x + 3, what is f⁻¹(11)?",acceptableNumericAnswers:[4],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:35},{id:"iar-bm-01",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"basic",competencyCode:"M11GM-IIa-b-1",competencyDescription:"Computes simple interest and maturity value.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"Find the simple interest on PHP 8,000 at 5% annual rate for 2 years.",acceptableNumericAnswers:[800],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-bm-02",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIa-2",competencyDescription:"Distinguishes simple and compound interest contexts.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"Which statement correctly describes compound interest?",options:["Interest is based only on original principal.","Interest is computed once at maturity.","Interest is computed on principal plus accumulated interest.","Interest is always lower than simple interest."],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-bm-03",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIc-d-1",competencyDescription:"Computes annuity future value in basic settings.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"A student saves PHP 1,000 monthly for 6 months with no interest. What is the accumulated amount?",options:["PHP 5,000","PHP 6,000","PHP 7,000","PHP 12,000"],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-bm-04",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"challenge",competencyCode:"M11GM-IIf-3",competencyDescription:"Solves business and consumer loan scenarios.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"A borrower receives PHP 20,000 and repays PHP 22,400 after 1 year. What is the annual simple interest rate?",options:["8%","10%","12%","14%"],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:60},{id:"iar-bm-c1",topicArea:"BusinessMath",gradeLevel:"G11",quarter:3,difficulty:"standard",competencyCode:"M11GM-IIc-d-1",competencyDescription:"Finds future value and present value of annuities.",answerType:"shortAnswerNumeric",depedBasis:"depedPattern",prompt:"Without interest, what is the present value of a 12-month annuity paying PHP 500 each month?",acceptableNumericAnswers:[6e3],numericTolerance:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-lg-01",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"basic",competencyCode:"M11GM-IIg-1",competencyDescription:"Identifies and negates propositions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:'If p is "All triangles have three sides," what is not p?',options:["Some triangles have three sides.","No triangle has three sides.","At least one triangle does not have three sides.","All triangles are polygons."],correctOptionIndex:2,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:45},{id:"iar-lg-02",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIh-1",competencyDescription:"Determines truth values of compound propositions.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"When p is true and q is false, what is the truth value of p -> q?",options:["True","False","Cannot be determined","Both true and false"],correctOptionIndex:1,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40},{id:"iar-lg-03",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIi-1",competencyDescription:"Identifies common reasoning fallacies in short arguments.",answerType:"shortAnswerText",depedBasis:"depedPattern",prompt:'A post says, "Everyone in my class passed because we used this lucky pen." Type the best label for this weak reasoning.',acceptableTextAnswers:["false cause","false causation","post hoc","hasty generalization"],isConfidenceProbe:!1,scorable:!0,estimatedSeconds:60},{id:"iar-lg-04",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"challenge",competencyCode:"M11GM-IIi-2",competencyDescription:"Determines the validity of categorical syllogisms.",answerType:"MCQ",depedBasis:"depedPattern",prompt:"All squares are rectangles. All rectangles are quadrilaterals. Therefore all squares are quadrilaterals. This argument is:",options:["Valid","Invalid","A fallacy of composition","A contradiction"],correctOptionIndex:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:55},{id:"iar-lg-c1",topicArea:"Logic",gradeLevel:"G11",quarter:4,difficulty:"standard",competencyCode:"M11GM-IIj-1",competencyDescription:"Illustrates methods of proof and disproof.",answerType:"MCQ",depedBasis:"depedPattern",prompt:'To prove "if n is even then nΒ² is even," which method is commonly used?',options:["Direct proof","Proof by contradiction only","Survey method","Graph sketch only"],correctOptionIndex:0,isConfidenceProbe:!1,scorable:!0,estimatedSeconds:40}];function Ne(s){return s>=75?"Mastered":s>=40?"NeedsReview":"HighRisk"}function Ce(){return ae.filter(s=>s.depedBasis==="depedPattern"&&!!s.competencyCode)}function ke(s=ae){const n=s.reduce((p,h)=>p+h.estimatedSeconds,0);return Math.round(n/60*10)/10}const te={Functions:"Functions and Graphs",BusinessMath:"Business and Financial Mathematics",Logic:"Logic and Reasoning"},Me={atRiskSubjectIds:[],questionSetVersion:H},x=Ce(),se=s=>s.trim().toLowerCase().replace(/\s+/g," "),re=(s,n)=>{if(!s.scorable)return!1;if(s.answerType==="MCQ")return typeof n=="number"&&n===s.correctOptionIndex;if(s.answerType==="shortAnswerNumeric"){if(typeof n!="string")return!1;const p=Number(n);if(Number.isNaN(p))return!1;const h=s.numericTolerance??0;return(s.acceptableNumericAnswers||[]).some(B=>Math.abs(p-B)<=h)}if(s.answerType==="shortAnswerText"){if(typeof n!="string")return!1;const p=se(n);return(s.acceptableTextAnswers||[]).some(h=>se(h)===p)}return!1},Ae=s=>s==="Mastered"?"text-teal-600 bg-teal-50":s==="NeedsReview"?"text-amber-700 bg-amber-50":"text-red-600 bg-red-50",Ie=s=>s==="NeedsReview"?"Needs Review":s==="HighRisk"?"High Risk":"Mastered",et=({isOpen:s,onClose:n,onComplete:p,lrn:h,gradeLevel:B="Grade 11",workflowMode:ie="iar_only",assessmentType:N="initial_assessment"})=>{const[v,L]=m.useState("intro"),[y,W]=m.useState(0),[ne,_]=m.useState([]),[C,I]=m.useState(""),[w,j]=m.useState(!1),[oe,b]=m.useState(!1),[a,q]=m.useState(null),[u,$]=m.useState(null),[k,V]=m.useState([]),[Se,U]=m.useState(!1);z.useEffect(()=>{s&&(L("intro"),W(0),_([]),I(""),j(!1),b(!1),q(null),$(null),V([]))},[s]),z.useEffect(()=>{if(!s||v!=="test"){b(!1);return}if(y>0||w){b(!1);return}b(!0);const t=window.setTimeout(()=>{b(!1)},2800);return()=>window.clearTimeout(t)},[s,v,y,w]);const ce=()=>{p({status:"skipped",...Me}),n()},R=()=>{n()};z.useEffect(()=>{if(!s)return;const t=i=>{i.key==="Escape"&&R()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[s]);const le=()=>{L("test")},de=t=>{_(t),I(""),j(!1),y<x.length-1?setTimeout(()=>{W(i=>i+1)},300):pe(t)},K=t=>{const i=[...ne];i[y]=t,de(i)},G=()=>{C.trim()&&K(C.trim())},pe=async t=>{const i=[],S={Functions:{correct:0,total:0},BusinessMath:{correct:0,total:0},Logic:{correct:0,total:0}},fe={Functions:[],BusinessMath:[],Logic:[]},P={};x.forEach((r,c)=>{const l=t[c];if(r.answerType==="confidenceLikert"&&typeof l=="number"&&fe[r.topicArea].push(l+1),!r.scorable)return;const d=re(r,l);S[r.topicArea].total+=1,d&&(S[r.topicArea].correct+=1),P[r.topicArea]||(P[r.topicArea]=[]),P[r.topicArea].push({correct:d,questionId:r.id,difficulty:r.difficulty,gradeLevelTag:r.gradeLevel,quarter:r.quarter,answerType:r.answerType})});const o=Object.keys(S).reduce((r,c)=>{const{correct:l,total:d}=S[c],M=d>0?Math.round(l/d*100):0,A=Ne(M);return A!=="Mastered"&&i.push(c),r[c]={correct:l,total:d,scorePercent:M,classification:A},r},{}),D=x.filter(r=>r.scorable&&r.gradeLevel==="G12Candidate"),xe=D.reduce((r,c)=>{const l=x.findIndex(d=>d.id===c.id);return r+(re(c,t[l])?1:0)},0),F=D.length>0?xe/D.length:1,he={readyForFiniteMath:Object.values(o).filter(r=>r.classification==="Mastered").length/3>=.67&&o.Functions.classification!=="HighRisk"&&o.BusinessMath.classification!=="HighRisk"&&F>=.5,readyForAdvancedStats:o.Logic.classification==="Mastered"&&F>=.67,readyForCalcIntro:o.Functions.classification==="Mastered"&&F>=.67,needsStrongerFunctions:o.Functions.classification!=="Mastered",needsStrongerBusinessMath:o.BusinessMath.classification!=="Mastered"};if(Object.keys(o).sort((r,c)=>{const l=o[r],d=o[c],M=X=>X==="HighRisk"?0:X==="NeedsReview"?1:2,A=M(l.classification)-M(d.classification);return A!==0?A:l.scorePercent-d.scorePercent}),V(i),q(o),$(he),L("results"),h){U(!0);try{const r=Object.keys(o).map(c=>({subject:c,score:o[c].scorePercent}));await ge(h,r,B,P,ie,N),console.log("[OK] Automation: diagnostic pipeline completed")}catch(r){console.error("[WARN] Automation: diagnostic pipeline failed:",r)}finally{U(!1)}}},me=()=>{if(!a||!u){p({status:"completed",atRiskSubjectIds:k,questionSetVersion:H}),n();return}p({status:"completed",atRiskSubjectIds:k,topicScores:{Functions:a.Functions.scorePercent,BusinessMath:a.BusinessMath.scorePercent,Logic:a.Logic.scorePercent},topicClassifications:{Functions:a.Functions.classification,BusinessMath:a.BusinessMath.classification,Logic:a.Logic.classification},priorityTopics:Object.keys(a).sort((t,i)=>a[t].scorePercent-a[i].scorePercent),g12ReadinessIndicators:u,questionSetVersion:H}),n()},f=x[y],Y=Math.round(y/x.length*100),ue=ke(x);return s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:()=>{R()},children:[e.jsxs(g.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"bg-white rounded-3xl shadow-2xl max-w-2xl w-full flex flex-col max-h-[90vh] pointer-events-auto overflow-hidden relative z-[51]",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"px-8 py-6 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-10 h-10 bg-sky-100 rounded-xl flex items-center justify-center text-sky-600",children:e.jsx(J,{size:24})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold text-[#0a1628]",children:N==="followup_diagnostic"?"Deep Diagnostic":"Initial Assessment"}),e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 relative",children:[e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>{j(!w),b(!1)},className:`relative w-10 h-10 rounded-xl flex items-center justify-center transition-all duration-200 border-2 ${w?"bg-sky-100 border-sky-300 text-sky-700 shadow-sm":"bg-white border-[#dde3eb] text-slate-500 hover:text-sky-600 hover:border-sky-200 hover:bg-sky-50"}`,title:"Toggle Calculator",children:e.jsx(T,{size:20})}),e.jsx(O,{children:s&&v==="test"&&oe&&!w&&e.jsxs(g.div,{initial:{opacity:0,y:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.95},className:"absolute right-0 top-full mt-3 w-[260px] bg-[#0a1628] text-white border border-[#2a3648] rounded-2xl p-4 shadow-2xl z-50 pointer-events-none",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-sky-500/20 flex items-center justify-center flex-shrink-0",children:e.jsx(T,{size:16,className:"text-sky-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-sm mb-1",children:"Calculator Available"}),e.jsx("p",{className:"text-xs text-slate-300 leading-relaxed",children:"You can freely use the scientific calculator at any time during this quiz."})]})]}),e.jsx("div",{className:"absolute -top-2 right-4 w-4 h-4 bg-[#0a1628] border-l border-t border-[#2a3648] rotate-45 rounded-tl-sm"})]})})]}),e.jsx("button",{onClick:()=>{R()},className:"w-10 h-10 rounded-xl flex items-center justify-center text-slate-500 border-2 border-transparent hover:text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] transition-all",title:"Close assessment",children:e.jsx(Z,{size:20})})]})]}),e.jsx("div",{className:"p-8 overflow-y-auto",children:e.jsxs(O,{mode:"wait",children:[v==="intro"&&e.jsxs(g.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"text-center space-y-6",children:[e.jsx("div",{className:"w-32 h-32 bg-sky-50 rounded-full flex items-center justify-center mx-auto mb-6",children:e.jsx(T,{size:64,className:"text-sky-600"})}),e.jsx("h3",{className:"text-2xl font-bold text-[#0a1628]",children:N==="followup_diagnostic"?"Let's close the gaps":"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[#5a6578] max-w-md mx-auto leading-relaxed",children:N==="followup_diagnostic"?"You have pending weak-area checks from your initial assessment. Complete this deep diagnostic to unlock regular modules and practice.":`To personalize your learning path, complete a DepEd competency-based SHS diagnostic (${x.length} items, around ${ue} minutes).`}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 max-w-lg mx-auto text-left",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-4 rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-[#0a1628] mb-1",children:[e.jsx(ee,{size:16,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-xs text-[#5a6578] pl-6",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-4 rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-[#0a1628] mb-1",children:[e.jsx(Q,{size:16,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-xs text-[#5a6578] pl-6",children:"Spot areas that need more attention early."})]})]}),e.jsxs("div",{className:"pt-4 space-y-3",children:[e.jsx(E,{onClick:le,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-8 py-6 rounded-xl text-lg font-bold shadow-lg shadow-sky-200 w-full max-w-xs mx-auto",children:N==="followup_diagnostic"?"Start Deep Diagnostic":"Start Assessment"}),e.jsx("button",{onClick:()=>{ce()},className:"block mx-auto text-sm text-slate-500 hover:text-[#5a6578] transition-colors font-medium",children:"Skip for now β†’"})]})]},"intro"),v==="test"&&e.jsxs(g.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm font-bold text-[#5a6578] mb-2",children:[e.jsxs("span",{children:["Question ",y+1," of ",x.length]}),e.jsxs("span",{children:[Y,"% Completed"]})]}),e.jsx("div",{className:"h-2 bg-[#edf1f7] rounded-full overflow-hidden mb-8",children:e.jsx(g.div,{className:"h-full bg-sky-600 rounded-full",initial:{width:0},animate:{width:`${Y}%`}})}),e.jsxs("div",{className:"bg-[#edf1f7] p-6 rounded-2xl border border-[#dde3eb] mb-6",children:[e.jsxs("p",{className:"text-xs font-bold uppercase tracking-wide text-slate-500 mb-2",children:[te[f.topicArea]," β€’ ",f.difficulty]}),e.jsx("h3",{className:"text-xl font-bold text-[#0a1628] leading-relaxed",children:f.prompt})]}),(f.answerType==="MCQ"||f.answerType==="confidenceLikert")&&e.jsx("div",{className:"grid grid-cols-1 gap-3",children:(f.options||[]).map((t,i)=>e.jsxs("button",{onClick:()=>K(i),className:"w-full text-left p-4 rounded-xl border-2 border-[#dde3eb] hover:border-indigo-600 hover:bg-sky-50 transition-all font-medium text-[#0a1628] group flex items-center justify-between",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-8 h-8 rounded-lg bg-white border border-[#dde3eb] flex items-center justify-center text-sm font-bold text-[#5a6578] group-hover:border-sky-300 group-hover:text-sky-600",children:String.fromCharCode(65+i)}),t]}),e.jsx(ve,{size:18,className:"opacity-0 group-hover:opacity-100 text-sky-600 transition-opacity"})]},i))}),(f.answerType==="shortAnswerNumeric"||f.answerType==="shortAnswerText")&&e.jsxs("div",{className:"space-y-3",children:[f.answerType==="shortAnswerNumeric"?e.jsx(e.Fragment,{children:e.jsx(ye,{value:C,onChange:I,placeholder:"Type numeric answer",onSubmit:G,onCalculatorOpen:()=>{j(!0),b(!1)}})}):e.jsx("input",{id:"diagnostic-short-answer",name:"diagnostic-short-answer","aria-label":"Short answer response",value:C,onChange:t=>I(t.target.value),onKeyDown:t=>{t.key==="Enter"&&G()},className:"w-full p-4 rounded-xl border-2 border-[#dde3eb] focus:outline-none focus:ring-2 focus:ring-sky-200 focus:border-sky-500",placeholder:"Type short answer"}),e.jsx(E,{onClick:G,disabled:!C.trim(),className:"w-full bg-sky-600 hover:bg-sky-700 text-white py-3 rounded-xl font-bold",children:"Submit Answer"})]})]},"test"),v==="results"&&e.jsxs(g.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"text-center space-y-6",children:[e.jsx("div",{className:"w-24 h-24 bg-teal-100 rounded-full flex items-center justify-center mx-auto mb-4 animate-bounce",children:e.jsx(ee,{size:48,className:"text-teal-600"})}),e.jsx("h3",{className:"text-2xl font-bold text-[#0a1628]",children:"Assessment Completed!"}),e.jsx("p",{className:"text-[#5a6578]",children:"We computed topic-level placement from your IAR responses."}),e.jsxs("div",{className:"bg-[#edf1f7] rounded-2xl p-6 border border-[#dde3eb] text-left space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.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:e.jsx(we,{size:18,strokeWidth:2.4})}),e.jsx("h4",{className:"font-display font-black text-[22px] text-slate-800 tracking-tight",children:"Topic Analysis"})]}),e.jsx("div",{className:"space-y-3",children:a&&Object.keys(a).map(t=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-xl border border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-[#0a1628]",children:te[t]}),e.jsxs("p",{className:"text-xs text-slate-500",children:[a[t].correct,"/",a[t].total," correct β€’ ",a[t].scorePercent,"%"]})]}),e.jsxs("span",{className:`text-xs font-bold px-2 py-1 rounded-lg flex items-center gap-1 ${Ae(a[t].classification)}`,children:[a[t].classification==="Mastered"?e.jsx(je,{size:12}):e.jsx(Q,{size:12}),Ie(a[t].classification)]})]},t))})]}),u&&e.jsxs("div",{className:"bg-sky-50 rounded-2xl p-6 border border-sky-100 text-left space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.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:e.jsx(J,{size:18,strokeWidth:2.4})}),e.jsx("h4",{className:"font-display font-black text-[22px] text-slate-800 tracking-tight",children:"Grade 12 Readiness Signals"})]}),e.jsx("p",{className:"text-xs text-slate-600",children:"These indicators come from challenge and candidate items only."}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 text-xs",children:[e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${u.readyForFiniteMath?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Finite Math: ",u.readyForFiniteMath?"Ready":"Build More"]}),e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${u.readyForAdvancedStats?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Advanced Stats: ",u.readyForAdvancedStats?"Ready":"Build More"]}),e.jsxs("span",{className:`px-2 py-1 rounded-md font-bold ${u.readyForCalcIntro?"bg-teal-50 text-teal-700":"bg-slate-100 text-slate-600"}`,children:["Calculus Intro: ",u.readyForCalcIntro?"Ready":"Build More"]})]})]}),k.length>0&&e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-rose-50 border border-rose-100 rounded-xl text-left",children:[e.jsx("div",{className:"w-10 h-10 rounded-[14px] bg-rose-100 border border-rose-200 flex items-center justify-center text-rose-600 shadow-inner shrink-0",children:e.jsx(Q,{size:18,strokeWidth:2.3})}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-display font-black text-[20px] tracking-tight text-rose-800 leading-none mb-1",children:"Attention Needed"}),e.jsxs("p",{className:"text-rose-700 text-xs mt-1",children:["We flagged ",k.length," topic area",k.length>1?"s":""," for review. In IAR + Diagnostic mode, focused deep diagnostics may launch before full unlock."]})]})]}),e.jsx("div",{className:"pt-4",children:e.jsx(E,{onClick:me,className:"bg-sky-600 hover:bg-sky-700 text-white px-8 py-4 rounded-xl text-lg font-bold w-full",children:"Go to Dashboard"})})]},"results")]})})]}),e.jsx(O,{children:w&&e.jsxs(g.div,{drag:!0,dragMomentum:!1,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{type:"spring",damping:25,stiffness:200},style:{position:"absolute",top:"50%",left:"calc(50% + 390px)",y:"-50%"},className:"w-[420px] max-w-[calc(100vw-24px)] bg-white rounded-3xl shadow-2xl border border-slate-200 flex flex-col pointer-events-auto overflow-hidden z-[60]",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0 cursor-move",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-xl bg-sky-100 flex items-center justify-center text-sky-600",children:e.jsx(T,{size:18})}),e.jsx("h3",{className:"font-bold text-[#0a1628] select-none",children:"Scientific Calc"})]}),e.jsx("button",{onClick:t=>{t.stopPropagation(),j(!1)},className:"w-8 h-8 flex items-center justify-center text-slate-500 hover:text-[#0a1628] hover:bg-[#dde3eb] rounded-lg transition-colors cursor-pointer",title:"Close Calculator",children:e.jsx(Z,{size:16})})]}),e.jsx("div",{className:"p-4 bg-[#f7f9fc]",children:e.jsx(be,{isOpen:!0,onClose:()=>j(!1),inline:!0})})]})})]}):null};export{et as default};
assets/{FloatingAITutor-DYvlvoVe.js β†’ FloatingAITutor-BhjMn9CN.js} RENAMED
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-BI4vbcO7.js","assets/index-DGWrSMOK.js","assets/vendor-react-Dexh7fmo.js","assets/vendor-firebase-auth-COrkgW0P.js","assets/vendor-firebase-core-DQ-pMjxd.js","assets/vendor-firebase-firestore-CkuVbeP5.js","assets/vendor-firebase-storage-BOeKE_0n.js","assets/vendor-firebase-analytics-CCo6E2f7.js","assets/index-CR2i2gnI.css","assets/vendor-markdown-C5ikSDMA.js","assets/vendor-markdown-CBmFCdgC.css","assets/apiService-BuaHZ1Ho.js"])))=>i.map(i=>d[i]);
2
- import{c as S,z as A,_ as w,m as p,B as M}from"./index-DGWrSMOK.js";import{r as a,j as e}from"./vendor-react-Dexh7fmo.js";import{M as f}from"./minus-BjTBUAx2.js";import{X as b}from"./x-Bj25rnWX.js";import{S as C}from"./send-nCgvy9cZ.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/**
3
  * @license lucide-react v0.487.0 - ISC
4
  *
5
  * This source code is licensed under the ISC license.
6
  * See the LICENSE file in the root directory of this source tree.
7
- */const L=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],E=S("maximize-2",L),O=a.lazy(()=>w(()=>import("./ChatMarkdown-BI4vbcO7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),X=({constraintsRef:T,onFullScreen:y})=>{const{activeSessionId:n,setActiveSessionId:g,createNewSession:j,getActiveSession:v,sendMessage:N,isLoading:o}=A(),[s,r]=a.useState(!1),[l,c]=a.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[i,d]=a.useState(""),u=a.useRef(null);a.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",l?"1":"0")},[l]),a.useEffect(()=>{s&&w(async()=>{const{warmupBackend:t}=await import("./apiService-BuaHZ1Ho.js");return{warmupBackend:t}},__vite__mapDeps([11,1,2,3,4,5,6,7,8])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("Floating tutor warmup skipped:",t)})},[s]),a.useEffect(()=>{if(s&&!n){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"})},_=j(t);g(_)}},[s]);const m=v()?.messages||[],k=()=>{u.current?.scrollIntoView({behavior:"smooth"})};a.useEffect(()=>{k()},[m]);const x=async()=>{if(!i.trim()||!n||o)return;const t=i.trim();d(""),await N(n,t)},I=()=>{y()},h=()=>{r(!1),c(!0)},z=()=>{c(!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:{maxHeight:s?"32rem":"0"},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:I,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(E,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:h,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:e.jsx(f,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>r(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(b,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[m.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(a.Suspense,{fallback:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}),children:e.jsx(O,{children:t.text})}),e.jsx("p",{className:`text-[10px] mt-1 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children: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:u})]}),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:i,onChange:t=>d(t.target.value),onKeyPress:t=>t.key==="Enter"&&x(),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:x,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:!i.trim()||o,children:e.jsx(C,{size:18})})]})})]}),e.jsx("div",{className:"pointer-events-auto relative self-end",children:l?e.jsx(p.button,{type:"button",onClick:z,whileHover:{scale:1.08},whileTap:{scale:.95},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",children:e.jsx(M,{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:h,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(f,{size:12})}),e.jsx(p.button,{type:"button",onClick:()=>r(!s),whileHover:{scale:1.1},whileTap:{scale:.9},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",children:s?e.jsx(b,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})})]})};export{X as default};
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatMarkdown-XT9mMuBR.js","assets/index-CmBdDSkw.js","assets/vendor-react-Dexh7fmo.js","assets/vendor-firebase-auth-COrkgW0P.js","assets/vendor-firebase-core-DQ-pMjxd.js","assets/vendor-firebase-firestore-CkuVbeP5.js","assets/vendor-firebase-storage-BOeKE_0n.js","assets/vendor-firebase-analytics-CCo6E2f7.js","assets/index-CR2i2gnI.css","assets/vendor-markdown-C5ikSDMA.js","assets/vendor-markdown-CBmFCdgC.css","assets/apiService-ZZIWaV70.js"])))=>i.map(i=>d[i]);
2
+ import{c as S,z as A,_ as w,m as p,B as M}from"./index-CmBdDSkw.js";import{r as a,j as e}from"./vendor-react-Dexh7fmo.js";import{M as f}from"./minus-8VjeOOlm.js";import{X as b}from"./x-BDSBB3q9.js";import{S as C}from"./send-OMGWblBc.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/**
3
  * @license lucide-react v0.487.0 - ISC
4
  *
5
  * This source code is licensed under the ISC license.
6
  * See the LICENSE file in the root directory of this source tree.
7
+ */const L=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],E=S("maximize-2",L),O=a.lazy(()=>w(()=>import("./ChatMarkdown-XT9mMuBR.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),X=({constraintsRef:T,onFullScreen:y})=>{const{activeSessionId:n,setActiveSessionId:g,createNewSession:j,getActiveSession:v,sendMessage:N,isLoading:o}=A(),[s,r]=a.useState(!1),[l,c]=a.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[i,d]=a.useState(""),u=a.useRef(null);a.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",l?"1":"0")},[l]),a.useEffect(()=>{s&&w(async()=>{const{warmupBackend:t}=await import("./apiService-ZZIWaV70.js");return{warmupBackend:t}},__vite__mapDeps([11,1,2,3,4,5,6,7,8])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("Floating tutor warmup skipped:",t)})},[s]),a.useEffect(()=>{if(s&&!n){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"})},_=j(t);g(_)}},[s]);const m=v()?.messages||[],k=()=>{u.current?.scrollIntoView({behavior:"smooth"})};a.useEffect(()=>{k()},[m]);const x=async()=>{if(!i.trim()||!n||o)return;const t=i.trim();d(""),await N(n,t)},I=()=>{y()},h=()=>{r(!1),c(!0)},z=()=>{c(!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:{maxHeight:s?"32rem":"0"},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:I,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(E,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:h,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:e.jsx(f,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>r(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(b,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[m.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(a.Suspense,{fallback:e.jsx("p",{className:"text-sm whitespace-pre-wrap",children:t.text}),children:e.jsx(O,{children:t.text})}),e.jsx("p",{className:`text-[10px] mt-1 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children: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:u})]}),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:i,onChange:t=>d(t.target.value),onKeyPress:t=>t.key==="Enter"&&x(),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:x,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:!i.trim()||o,children:e.jsx(C,{size:18})})]})})]}),e.jsx("div",{className:"pointer-events-auto relative self-end",children:l?e.jsx(p.button,{type:"button",onClick:z,whileHover:{scale:1.08},whileTap:{scale:.95},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",children:e.jsx(M,{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:h,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(f,{size:12})}),e.jsx(p.button,{type:"button",onClick:()=>r(!s),whileHover:{scale:1.1},whileTap:{scale:.9},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",children:s?e.jsx(b,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"})})]})})]})};export{X as default};
assets/GradesPage-BIf0hX4r.js DELETED
@@ -1,2 +0,0 @@
1
- import{r as n,j as e}from"./vendor-react-Dexh7fmo.js";import{B as S}from"./button-DWdPuxDU.js";import{u as $,m as H,g as W}from"./index-DGWrSMOK.js";import{g as V,S as k}from"./subjects-DDYtJwQO.js";import{A as T}from"./award-DpLN2BvV.js";import{T as A}from"./trending-up-B2MPUPwk.js";import{T as C}from"./target-7Gevl8jn.js";import{C as P}from"./calendar-19p2TrVX.js";import{D as _}from"./download-DINpalm9.js";import{T as J,F as K}from"./trending-down-C7JHnrbb.js";import{C as X}from"./chevron-right-DxXkA9aZ.js";import"./vendor-radix-B-ht8aK0.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./chart-column-CJzwyNMx.js";const je=()=>{const{currentUser:p,userProfile:Q}=$(),[o,u]=n.useState("all"),[f,D]=n.useState("all"),[Y,j]=n.useState(!0),[i,R]=n.useState(null),E=Q?.grade,g=V(E),y=new Set(g);n.useEffect(()=>{(async()=>{if(p){j(!0);try{const s=await W(p.uid);R(s)}catch(s){console.error("Error loading grades:",s)}finally{j(!1)}}})()},[p]);const N=i?.quizAttempts||[],M=i?.totalQuizzesCompleted||0,h=i?.averageScore||0,U=h>0?Math.min(h/25,4).toFixed(2):"0.00",F={"gen-math":"blue","stats-prob":"cyan","pre-calc":"teal","basic-calc":"orange"},b=k.reduce((t,s)=>(t[s.id]={label:s.name,color:F[s.id]||"slate"},t),{}),c=k.filter(t=>y.has(t.id)).map(t=>t.name),v=Object.entries(i?.subjects||{}).filter(([t])=>y.has(t)).map(([t,s])=>{const a=b[t]||{label:t,color:"slate"},d=N.filter(l=>l.quizId?.startsWith(t)),m=d.length>0?Math.round(d.reduce((l,r)=>l+r.score,0)/d.length):Math.round(s.progress);return{subject:a.label,average:m,quizzes:d.length||s.completedModules,color:a.color,trend:"up"}}),G=g.map(t=>{const s=b[t]||{label:t,color:"slate"};return{subject:s.label,average:0,quizzes:0,color:s.color,trend:"up"}}),I=v.length>0?v:G,w=N.sort((t,s)=>new Date(s.completedAt).getTime()-new Date(t.completedAt).getTime()).slice(0,10).map((t,s)=>({id:s+1,title:t.quizId?.replace(/-/g," ").replace(/\b\w/g,a=>a.toUpperCase())||`Quiz ${s+1}`,subject:Object.entries(b).find(([a])=>t.quizId?.startsWith(a))?.[1]?.label||"General",score:t.score,total:100,date:t.completedAt instanceof Date?t.completedAt.toISOString().split("T")[0]:new Date(t.completedAt).toISOString().split("T")[0],type:t.quizId?.includes("practice")?"practice":"module",status:t.score>=60?"passed":"failed"})).filter(t=>c.includes(t.subject)),x={gpa:parseFloat(U),totalQuizzes:M,averageScore:h,trendValue:0},z=w.filter(t=>{if(!c.includes(t.subject))return!1;const s=o==="all"||t.subject===o,a=f==="all"||t.type===f;return s&&a});n.useEffect(()=>{o!=="all"&&(c.includes(o)||u("all"))},[c,o]);const O=()=>{const t=["Quiz","Subject","Type","Score","Date","Status"],s=w.map(r=>[r.title,r.subject,r.type,`${r.score}%`,r.date,r.status]),a=[t,...s].map(r=>r.join(",")).join(`
2
- `),d=new Blob([a],{type:"text/csv;charset=utf-8;"}),m=URL.createObjectURL(d),l=document.createElement("a");l.href=m,l.download=`mathpulse-grades-${new Date().toISOString().split("T")[0]}.csv`,l.click(),URL.revokeObjectURL(m)},L=t=>t>=90?"text-emerald-600 bg-emerald-50":t>=80?"text-sky-600 bg-sky-50":t>=70?"text-rose-600 bg-rose-50":"text-red-600 bg-red-50",B=t=>t>=90?"A":t>=80?"B":t>=70?"C":t>=60?"D":"F";return e.jsxs("div",{className:"space-y-6 px-4 sm:px-6 xl:px-10 py-6 sm:py-8",children:[e.jsxs("div",{className:"bg-gradient-to-br from-white via-sky-50/30 to-white rounded-2xl p-7 card-elevated-lg relative overflow-hidden border border-slate-200/80",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/40 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-sky-100/40 rounded-full -translate-y-1/2 translate-x-1/2"}),e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(T,{size:18,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Overall GPA"})]}),e.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:x.gpa}),e.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[e.jsx(A,{size:14,className:"text-emerald-500"}),e.jsxs("span",{className:"text-xs text-slate-500 font-body",children:["+",x.trendValue,"% this month"]})]})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(C,{size:18,className:"text-sky-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Average Score"})]}),e.jsxs("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:[x.averageScore,"%"]}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"Across all subjects"})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(P,{size:18,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Total Quizzes"})]}),e.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:x.totalQuizzes}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"Completed"})]}),e.jsxs("div",{className:"bg-white rounded-lg p-4 border border-slate-200/80 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(T,{size:18,className:"text-rose-500"}),e.jsx("span",{className:"text-xs text-slate-500 font-body",children:"Grade Rank"})]}),e.jsx("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:"Top 15%"}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-2",children:"In your class"})]})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.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:e.jsx(C,{size:20,strokeWidth:2.5})}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Subject Performance"})]}),e.jsxs(S,{variant:"outline",size:"sm",className:"rounded-lg font-body border-[#dde3eb] text-[#5a6578]",onClick:O,children:[e.jsx(_,{size:16,className:"mr-2"}),"Export Report"]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-4",children:I.map(t=>e.jsxs(H.div,{whileHover:{scale:1.02},className:"bg-white rounded-xl p-5 border border-[#dde3eb] card-elevated cursor-pointer",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-display font-bold text-[#0a1628] mb-1",children:t.subject}),e.jsxs("p",{className:"text-xs text-[#5a6578] font-body",children:[t.quizzes," quizzes completed"]})]}),e.jsx("div",{className:`w-14 h-14 rounded-lg bg-${t.color}-50 flex items-center justify-center`,children:e.jsx("span",{className:`text-xl font-display font-bold text-${t.color}-600`,children:B(t.average)})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-3xl font-display font-bold text-[#0a1628]",children:[t.average,"%"]}),e.jsx("p",{className:"text-xs text-[#5a6578] font-body mt-1",children:"Average"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[t.trend==="up"?e.jsx(A,{size:18,className:"text-green-500"}):e.jsx(J,{size:18,className:"text-red-500"}),e.jsx(X,{size:16,className:"text-[#d1cec6]"})]})]})]},t.subject))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.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:e.jsx(P,{size:20,strokeWidth:2.5})}),e.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:"Quiz History"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:o,onChange:t=>u(t.target.value),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm font-body bg-white text-[#0a1628]",children:[e.jsx("option",{value:"all",children:"All Subjects"}),c.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsxs("select",{value:f,onChange:t=>D(t.target.value),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm font-body bg-white text-[#0a1628]",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"practice",children:"Practice"}),e.jsx("option",{value:"module",children:"Module"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl border border-[#dde3eb] card-elevated overflow-hidden",children:[e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-[#f7f9fc] border-b border-[#dde3eb]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Quiz"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Subject"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Type"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Score"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Date"}),e.jsx("th",{className:"px-6 py-3 text-left text-[10px] font-body font-semibold text-[#5a6578] uppercase tracking-wider",children:"Action"})]})}),e.jsx("tbody",{children:z.map(t=>e.jsxs("tr",{className:"border-b border-[#edf1f7] hover:bg-[#f7f9fc] transition-colors",children:[e.jsx("td",{className:"px-6 py-4",children:e.jsx("p",{className:"font-body font-semibold text-[#0a1628] text-sm",children:t.title})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-[#5a6578] font-body",children:t.subject})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"px-2.5 py-1 bg-[#edf1f7] text-[#5a6578] text-xs font-body font-semibold rounded-md capitalize",children:t.type})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:`px-2.5 py-1 rounded-md text-sm font-body font-semibold ${L(t.score)}`,children:[t.score,"%"]}),e.jsxs("span",{className:"text-xs text-slate-500 font-body",children:["(",t.score,"/",t.total,")"]})]})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx("span",{className:"text-sm text-[#5a6578] font-body",children:t.date})}),e.jsx("td",{className:"px-6 py-4",children:e.jsx(S,{variant:"outline",size:"sm",className:"rounded-lg",children:"Review"})})]},t.id))})]}),z.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(K,{size:40,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] font-body",children:"No quizzes found with current filters"}),e.jsx("p",{className:"text-xs text-slate-500 font-body mt-1",children:"Try adjusting your filters"})]})]})]})]})};export{je as default};
 
 
 
assets/GradesPage-Bi5pcR2x.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import{r as i,j as e}from"./vendor-react-Dexh7fmo.js";import{B as v}from"./button-BP5cklmU.js";import{u as H,g as V}from"./index-CmBdDSkw.js";import{g as W,S as P}from"./subjects-wOHUanD9.js";import{C as Y}from"./calendar-CP-HCx1y.js";import{D as J}from"./download-DMZBRA1T.js";import{A as K}from"./award-COlS18fi.js";import{T as $}from"./target-BCguvjbb.js";import{T as E}from"./trending-up-6u76yy2e.js";import{F as R}from"./funnel-BHtkrar1.js";import"./vendor-radix-CxzAJozq.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./chart-column-DzJCKCOe.js";const be=()=>{const{currentUser:c,userProfile:w}=H(),[o,N]=i.useState("all"),[m,M]=i.useState("all"),[Q,y]=i.useState(!0),[h,D]=i.useState(null),F=w?.grade,S=W(F),_=new Set(S);i.useEffect(()=>{(async()=>{if(c){y(!0);try{const s=await V(c.uid);D(s)}catch(s){console.error("Failed to load progress for grades:",s)}finally{y(!1)}}})()},[c]);const k=h?.quizAttempts||[],U=h?.totalQuizzesCompleted||0,g=h?.averageScore||0,L=g>0?Math.min(g/25,4).toFixed(2):"0.00",O={"gen-math":"indigo","stats-prob":"violet","pre-calc":"fuchsia","basic-calc":"purple"},A={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"}},f=P.reduce((t,s)=>(t[s.id]={label:s.name,color:O[s.id]||"slate"},t),{}),d=P.filter(t=>_.has(t.id)).map(t=>t.name),T=Object.entries(h?.subjects||{}).filter(([t])=>_.has(t)).map(([t,s])=>{const r=f[t]||{label:t,color:"slate"},a=k.filter(x=>x.quizId?.startsWith(t)),n=a.length>0?Math.round(a.reduce((x,b)=>x+b.score,0)/a.length):Math.round(s.progress);return{subject:r.label,average:n,quizzes:a.length||s.completedModules,color:r.color}}),I=S.map(t=>{const s=f[t]||{label:t,color:"slate"};return{subject:s.label,average:0,quizzes:0,color:s.color}}),z=T.length>0?T:I,C=k.slice().sort((t,s)=>new Date(s.completedAt).getTime()-new Date(t.completedAt).getTime()).slice(0,10).map((t,s)=>{const a=Object.entries(f).find(([n])=>t.quizId?.startsWith(n))?.[1]?.label||"General";return{id:s+1,title:t.quizId?.replace(/-/g," ").replace(/\b\w/g,n=>n.toUpperCase())||`Quiz ${s+1}`,subject:a,score:t.score,date:t.completedAt instanceof Date?t.completedAt.toISOString().split("T")[0]:new Date(t.completedAt).toISOString().split("T")[0],type:t.quizId?.includes("practice")?"practice":"module",status:t.score>=80?"Excellent":t.score>=60?"Passing":"Needs Review"}}).filter(t=>d.includes(t.subject)),u=C.filter(t=>{if(!d.includes(t.subject))return!1;const s=o==="all"||t.subject===o,r=m==="all"||t.type===m;return s&&r});i.useEffect(()=>{o!=="all"&&(d.includes(o)||N("all"))},[d,o]);const B=()=>{const t=l=>{const j=String(l??"");return/[",\n]/.test(j)?`"${j.replace(/"/g,'""')}"`:j},s=[],r=w?.displayName||c?.displayName||c?.email||"Student",a=new Date().toISOString().split("T")[0];s.push("Grade Report"),s.push(`Student,${t(r)}`),s.push(`Export Date,${t(a)}`),s.push(`Subject Filter,${t(o)}`),s.push(`Type Filter,${t(m)}`),s.push(""),s.push("Subject Performance"),s.push("Subject,Average Score"),z.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"),u.length===0?s.push("No quiz data available for the selected filters"):u.forEach(l=>{s.push([t(l.title),t(l.subject),t(l.score),t(l.date),t(l.type),t(l.status)].join(","))});const n=s.join(`
2
+ `),x=new Blob([n],{type:"text/csv;charset=utf-8;"}),b=window.URL.createObjectURL(x),p=document.createElement("a"),G=r.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";p.href=b,p.setAttribute("download",`grade-report-${G}-${a}.csv`),document.body.appendChild(p),p.click(),document.body.removeChild(p),window.URL.revokeObjectURL(b)};return Q?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(Y,{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:B,children:[e.jsx(J,{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(K,{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:L})})]})]}),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($,{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:[g,"%"]})})]})]}),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(E,{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:o,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"}),d.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsx(R,{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:m,onChange:t=>M(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(R,{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:u.length>0?u.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($,{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:z.map((t,s)=>{const r=A[t.color]||A.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 ${r.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 ${r.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{width:`${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(E,{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:C.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{be as default};
assets/{HeroBanner-DgRlQubI.js β†’ HeroBanner-BzMF9ktr.js} RENAMED
@@ -1,7 +1,7 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-MX9hSo-6.js","assets/vendor-react-Dexh7fmo.js","assets/avatarData-DykDiQ_Y.js","assets/index-DGWrSMOK.js","assets/vendor-firebase-auth-COrkgW0P.js","assets/vendor-firebase-core-DQ-pMjxd.js","assets/vendor-firebase-firestore-CkuVbeP5.js","assets/vendor-firebase-storage-BOeKE_0n.js","assets/vendor-firebase-analytics-CCo6E2f7.js","assets/index-CR2i2gnI.css"])))=>i.map(i=>d[i]);
2
- import{c as x,m as t,Z as c,A as p,_ as b}from"./index-DGWrSMOK.js";import{j as e,r}from"./vendor-react-Dexh7fmo.js";import{B as h}from"./brain-DHmY5cbv.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/**
3
  * @license lucide-react v0.487.0 - ISC
4
  *
5
  * This source code is licensed under the ISC license.
6
  * See the LICENSE file in the root directory of this source tree.
7
- */const g=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],u=x("hand",g),v=r.lazy(()=>b(()=>import("./DashboardAvatar-MX9hSo-6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),A=({userName:a="Student",userLevel:o=1,avatarLayers:l,onContinueLearning:n,showAssessmentTooltip:i,onOpenAssessment:d})=>{const m=()=>{const s=new Date().getHours();return s<12?"Good Morning":s<18?"Good Afternoon":"Good Evening"};return e.jsxs(t.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,ease:[.22,1,.36,1]},className:"relative w-full mt-0 rounded-[2rem] p-6 lg:p-8 bg-gradient-to-br from-white via-sky-50/50 to-white border border-slate-200/80 card-elevated-lg",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-[2rem] pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/50 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-96 h-96 bg-sky-100/40 rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-64 h-64 bg-rose-100/30 rounded-full blur-3xl translate-y-1/2 -translate-x-1/4"}),e.jsx("div",{className:"absolute inset-0 bg-dot-pattern opacity-40"})]}),e.jsx("div",{className:"relative z-10 flex min-h-[140px] lg:min-h-[160px] items-center justify-between gap-6 pb-0",children:e.jsxs("div",{className:"flex-1 min-w-0 pr-40 lg:pr-[280px] py-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-sky-100 border border-sky-200",children:e.jsxs("span",{className:"text-xs md:text-sm font-body font-bold text-sky-700",children:["Level ",o]})}),e.jsxs("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-rose-50 border border-rose-200",children:[e.jsx(c,{size:14,className:"inline -mt-0.5 text-rose-500 mr-1"}),e.jsx("span",{className:"text-xs md:text-sm font-body font-bold text-rose-700",children:"Active"})]})]}),e.jsxs("h1",{className:"text-xl md:text-2xl lg:text-3xl font-display font-black text-[#0a1628] mb-1.5 tracking-tight leading-[1.1]",children:[m(),", ",a,"! ",e.jsx(u,{size:20,className:"inline -mt-1 ml-1"})]}),e.jsx("p",{className:"text-slate-500 mb-1 text-xs md:text-sm font-body font-bold",children:"Today is a great day to move one step forward in math mastery."}),e.jsx("p",{className:"text-[11px] md:text-xs text-slate-400 font-body mb-4",children:"Focus on your next recommended lesson and keep your momentum."}),e.jsxs(t.button,{onClick:n,whileHover:{scale:1.03},whileTap:{scale:.97},className:"mt-2 bg-gradient-to-r from-purple-600 to-[#9956DE] text-white px-5 py-2 rounded-xl font-body font-bold text-sm shadow-lg shadow-purple-500/20 hover:shadow-purple-500/30 transition-all flex items-center gap-2 group",children:["Continue Learning",e.jsx(p,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})}),i&&e.jsx(t.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:d,className:"absolute hidden md:block right-[150px] lg:right-[250px] bottom-16 lg:bottom-20 z-30 cursor-pointer drop-shadow-lg group",children:e.jsxs("div",{className:"bg-white px-4 py-3 rounded-2xl rounded-br-sm border-2 border-amber-300 relative transition-all group-hover:bg-amber-50 group-hover:border-amber-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-amber-500",children:e.jsx(h,{size:16})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-amber-900 leading-tight",children:["Don't forget to take the",e.jsx("br",{}),"Initial Assessment!"]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-amber-300 border-b-amber-300 rotate-45 group-hover:bg-amber-50 group-hover:border-r-amber-400 group-hover:border-b-amber-400 transition-colors"})]})}),e.jsx("div",{className:"hidden md:block absolute right-0 lg:right-10 bottom-0 w-[150px] lg:w-[270px] pointer-events-none z-20",style:{clipPath:"inset(-100% -50% 0 -50%)"},children:e.jsx("div",{className:"relative w-full aspect-[4/5] translate-y-[21%] lg:translate-y-[19%] drop-shadow-2xl",children:e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"w-full h-full scale-[1.25] lg:scale-[1.3] origin-bottom"}),children:e.jsx(v,{layers:l,className:"w-full h-full scale-[1.25] lg:scale-[1.3] origin-bottom"})})})})]})};export{A as default};
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-2y_SuM8T.js","assets/vendor-react-Dexh7fmo.js","assets/avatarData-BW_TX0b4.js","assets/index-CmBdDSkw.js","assets/vendor-firebase-auth-COrkgW0P.js","assets/vendor-firebase-core-DQ-pMjxd.js","assets/vendor-firebase-firestore-CkuVbeP5.js","assets/vendor-firebase-storage-BOeKE_0n.js","assets/vendor-firebase-analytics-CCo6E2f7.js","assets/index-CR2i2gnI.css"])))=>i.map(i=>d[i]);
2
+ import{c as x,m as t,Z as c,A as p,_ as b}from"./index-CmBdDSkw.js";import{j as e,r}from"./vendor-react-Dexh7fmo.js";import{B as h}from"./brain-DfMjTiNx.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/**
3
  * @license lucide-react v0.487.0 - ISC
4
  *
5
  * This source code is licensed under the ISC license.
6
  * See the LICENSE file in the root directory of this source tree.
7
+ */const g=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],u=x("hand",g),v=r.lazy(()=>b(()=>import("./DashboardAvatar-2y_SuM8T.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),A=({userName:a="Student",userLevel:o=1,avatarLayers:l,onContinueLearning:n,showAssessmentTooltip:i,onOpenAssessment:d})=>{const m=()=>{const s=new Date().getHours();return s<12?"Good Morning":s<18?"Good Afternoon":"Good Evening"};return e.jsxs(t.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,ease:[.22,1,.36,1]},className:"relative w-full mt-0 rounded-[2rem] p-6 lg:p-8 bg-gradient-to-br from-white via-sky-50/50 to-white border border-slate-200/80 card-elevated-lg",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-[2rem] pointer-events-none",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-sky-400/50 to-transparent"}),e.jsx("div",{className:"absolute top-0 right-0 w-96 h-96 bg-sky-100/40 rounded-full blur-3xl -translate-y-1/2 translate-x-1/4"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-64 h-64 bg-rose-100/30 rounded-full blur-3xl translate-y-1/2 -translate-x-1/4"}),e.jsx("div",{className:"absolute inset-0 bg-dot-pattern opacity-40"})]}),e.jsx("div",{className:"relative z-10 flex min-h-[140px] lg:min-h-[160px] items-center justify-between gap-6 pb-0",children:e.jsxs("div",{className:"flex-1 min-w-0 pr-40 lg:pr-[280px] py-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-sky-100 border border-sky-200",children:e.jsxs("span",{className:"text-xs md:text-sm font-body font-bold text-sky-700",children:["Level ",o]})}),e.jsxs("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-rose-50 border border-rose-200",children:[e.jsx(c,{size:14,className:"inline -mt-0.5 text-rose-500 mr-1"}),e.jsx("span",{className:"text-xs md:text-sm font-body font-bold text-rose-700",children:"Active"})]})]}),e.jsxs("h1",{className:"text-xl md:text-2xl lg:text-3xl font-display font-black text-[#0a1628] mb-1.5 tracking-tight leading-[1.1]",children:[m(),", ",a,"! ",e.jsx(u,{size:20,className:"inline -mt-1 ml-1"})]}),e.jsx("p",{className:"text-slate-500 mb-1 text-xs md:text-sm font-body font-bold",children:"Today is a great day to move one step forward in math mastery."}),e.jsx("p",{className:"text-[11px] md:text-xs text-slate-400 font-body mb-4",children:"Focus on your next recommended lesson and keep your momentum."}),e.jsxs(t.button,{onClick:n,whileHover:{scale:1.03},whileTap:{scale:.97},className:"mt-2 bg-gradient-to-r from-purple-600 to-[#9956DE] text-white px-5 py-2 rounded-xl font-body font-bold text-sm shadow-lg shadow-purple-500/20 hover:shadow-purple-500/30 transition-all flex items-center gap-2 group",children:["Continue Learning",e.jsx(p,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})}),i&&e.jsx(t.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:d,className:"absolute hidden md:block right-[150px] lg:right-[250px] bottom-16 lg:bottom-20 z-30 cursor-pointer drop-shadow-lg group",children:e.jsxs("div",{className:"bg-white px-4 py-3 rounded-2xl rounded-br-sm border-2 border-amber-300 relative transition-all group-hover:bg-amber-50 group-hover:border-amber-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-amber-500",children:e.jsx(h,{size:16})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-amber-900 leading-tight",children:["Don't forget to take the",e.jsx("br",{}),"Initial Assessment!"]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-amber-300 border-b-amber-300 rotate-45 group-hover:bg-amber-50 group-hover:border-r-amber-400 group-hover:border-b-amber-400 transition-colors"})]})}),e.jsx("div",{className:"hidden md:block absolute right-0 lg:right-10 bottom-0 w-[150px] lg:w-[270px] pointer-events-none z-20",style:{clipPath:"inset(-100% -50% 0 -50%)"},children:e.jsx("div",{className:"relative w-full aspect-[4/5] translate-y-[21%] lg:translate-y-[19%] drop-shadow-2xl",children:e.jsx(r.Suspense,{fallback:e.jsx("div",{className:"w-full h-full scale-[1.25] lg:scale-[1.3] origin-bottom"}),children:e.jsx(v,{layers:l,className:"w-full h-full scale-[1.25] lg:scale-[1.3] origin-bottom"})})})})]})};export{A as default};
assets/{LeaderboardPage-C97hWKsZ.js β†’ LeaderboardPage-DIZVn39b.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as o,j as e}from"./vendor-react-Dexh7fmo.js";import{c as O,E as R,e as W,m as d,F as A,l as X,u as $,G as H}from"./index-DGWrSMOK.js";import{X as U}from"./x-Bj25rnWX.js";import{B as y}from"./book-open-B5Xvd1JL.js";import{T as B}from"./target-7Gevl8jn.js";import{A as k}from"./award-DpLN2BvV.js";import{C as q}from"./clock-qHFbMxrB.js";import{T as v}from"./trophy-73YPSH67.js";import{T as P}from"./trending-up-B2MPUPwk.js";import{L as M}from"./loader-circle-BUf2fYcT.js";import{S as G}from"./star-DqP0S0c5.js";import{U as L}from"./user-Br5UzORP.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{r as o,j as e}from"./vendor-react-Dexh7fmo.js";import{c as O,E as R,e as W,m as d,F as A,l as X,u as $,G as H}from"./index-CmBdDSkw.js";import{X as U}from"./x-BDSBB3q9.js";import{B as y}from"./book-open-BH_yilLK.js";import{T as B}from"./target-BCguvjbb.js";import{A as k}from"./award-COlS18fi.js";import{C as q}from"./clock-jSWTKlqH.js";import{T as v}from"./trophy-DrL6Ph2J.js";import{T as P}from"./trending-up-6u76yy2e.js";import{L as M}from"./loader-circle-BfAbw6jC.js";import{S as G}from"./star-B7mp4xEi.js";import{U as L}from"./user-C4mm1EOG.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{LearningPath-CTKb6bQc.js β†’ LearningPath-LYxnZA3A.js} RENAMED
@@ -1 +1 @@
1
- import{r as p,c as h,j as t}from"./vendor-react-Dexh7fmo.js";import{u as S,o as k,p as v,g as w,A as C}from"./index-DGWrSMOK.js";import{g as L,s as M}from"./subjects-DDYtJwQO.js";import{M as A}from"./ModuleFolderCard-BGJM_1PJ.js";import{B as E}from"./book-open-B5Xvd1JL.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./trending-up-B2MPUPwk.js";import"./chart-column-CJzwyNMx.js";import"./clock-qHFbMxrB.js";const H=({onNavigateToModules:c,atRiskSubjects:g=[],priorityTopics:d=[]})=>{const{userProfile:i}=S(),[x,f]=p.useState(null),b=i?.grade,j=L(b),m=M.filter(e=>j.includes(e.id)),l=m.find(e=>e.id==="gen-math")??m[0],a=h.useMemo(()=>{const e=d.length>0?d:g.map(s=>k(s)).filter(s=>s!==null),r=new Set;return e.filter(s=>r.has(s)?!1:(r.add(s),!0))},[d,g]),P=h.useMemo(()=>{const e=l?.modules??[];if(a.length===0)return e;const r=new Map(a.map((s,o)=>[v[s],o]));return[...e].sort((s,o)=>{const n=r.get(s.id)??Number.POSITIVE_INFINITY,N=r.get(o.id)??Number.POSITIVE_INFINITY;return n-N})},[l?.modules,a]);p.useEffect(()=>{i?.uid&&w(i.uid).then(f).catch(console.error)},[i?.uid]);const u=P.slice(0,4).map(e=>{const o=x?.subjects?.[l.id]?.modulesProgress?.[e.id]?.lessonsCompleted?.length||0,n=e.lessons.length>0?Math.round(o/e.lessons.length*100):0;return{...e,progress:n,status:n===100?"Completed":n>0?"In Progress":"Not Started"}}),I=u.some(e=>e.progress>0)?"Continue Learning":"Start Learning";return t.jsxs("div",{children:[t.jsxs("div",{className:"flex justify-between items-center mb-6 px-1",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.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:t.jsx(E,{size:20,strokeWidth:2.5})}),t.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:I})]}),t.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 ",t.jsx(C,{size:16})]})]}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4 gap-6",children:u.map((e,r)=>t.jsx(A,{module:e,index:r,onClick:()=>c?.(e.id),isAtRisk:a.length>0,badgeLabel:e.status!=="Not Started"?e.status:void 0},e.id))})]})};export{H as default};
 
1
+ import{r as p,c as h,j as t}from"./vendor-react-Dexh7fmo.js";import{u as S,o as k,p as v,g as w,A as C}from"./index-CmBdDSkw.js";import{g as L,s as M}from"./subjects-wOHUanD9.js";import{M as A}from"./ModuleFolderCard-BSQZpGub.js";import{B as E}from"./book-open-BH_yilLK.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./trending-up-6u76yy2e.js";import"./chart-column-DzJCKCOe.js";import"./clock-jSWTKlqH.js";const H=({onNavigateToModules:c,atRiskSubjects:g=[],priorityTopics:d=[]})=>{const{userProfile:i}=S(),[x,f]=p.useState(null),b=i?.grade,j=L(b),m=M.filter(e=>j.includes(e.id)),l=m.find(e=>e.id==="gen-math")??m[0],a=h.useMemo(()=>{const e=d.length>0?d:g.map(s=>k(s)).filter(s=>s!==null),r=new Set;return e.filter(s=>r.has(s)?!1:(r.add(s),!0))},[d,g]),P=h.useMemo(()=>{const e=l?.modules??[];if(a.length===0)return e;const r=new Map(a.map((s,o)=>[v[s],o]));return[...e].sort((s,o)=>{const n=r.get(s.id)??Number.POSITIVE_INFINITY,N=r.get(o.id)??Number.POSITIVE_INFINITY;return n-N})},[l?.modules,a]);p.useEffect(()=>{i?.uid&&w(i.uid).then(f).catch(console.error)},[i?.uid]);const u=P.slice(0,4).map(e=>{const o=x?.subjects?.[l.id]?.modulesProgress?.[e.id]?.lessonsCompleted?.length||0,n=e.lessons.length>0?Math.round(o/e.lessons.length*100):0;return{...e,progress:n,status:n===100?"Completed":n>0?"In Progress":"Not Started"}}),I=u.some(e=>e.progress>0)?"Continue Learning":"Start Learning";return t.jsxs("div",{children:[t.jsxs("div",{className:"flex justify-between items-center mb-6 px-1",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.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:t.jsx(E,{size:20,strokeWidth:2.5})}),t.jsx("h2",{className:"font-display font-black text-[24px] text-slate-800 tracking-tight",children:I})]}),t.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 ",t.jsx(C,{size:16})]})]}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-3 gap-6",children:u.map((e,r)=>t.jsx(A,{module:e,index:r,onClick:()=>c?.(e.id),isAtRisk:a.length>0,badgeLabel:e.status!=="Not Started"?e.status:void 0},e.id))})]})};export{H as default};
assets/{LoginPage-BTBes4zQ.js β†’ LoginPage-DTFoLFv7.js} RENAMED
@@ -1 +1 @@
1
- import{r as s,j as e}from"./vendor-react-Dexh7fmo.js";import{B as Me}from"./button-DWdPuxDU.js";import{I as D}from"./input-DBkKXOmF.js";import{m as r,A as te,s as se,a as Ee,b as ae}from"./index-DGWrSMOK.js";import{S as Te}from"./sparkles-DxmNHQEo.js";import{B as Re}from"./brain-DHmY5cbv.js";import{T as Ce}from"./trending-up-B2MPUPwk.js";import{A as Ie}from"./award-DpLN2BvV.js";import{U as re}from"./users-BRS21lR4.js";import{G as ie}from"./graduation-cap-Cr-ek4Bs.js";import{B as oe}from"./book-open-B5Xvd1JL.js";import{M as Le}from"./mail-D-r4ZWDN.js";import{L as le}from"./lock-C6XEepuP.js";import{E as De}from"./eye-off-DCr0gD8u.js";import{E as Be}from"./eye-pSTVqBYO.js";import{S as ze}from"./shield-check-B-VFrdlh.js";import"./vendor-radix-B-ht8aK0.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const ne="/assets/shader-bg-DA7bEbBA.mp4",qe=[{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)}],B="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. ${B}`: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},ut=()=>{const i=["Grade 11","Grade 12"],c={"Grade 11":["STEM A","STEM B","ABM A","HUMSS A"],"Grade 12":["STEM A","STEM B","ABM A","HUMSS A"]},o={teacher:["Mathematics","Science","English","Technology","Humanities"]},[d,h]=s.useState(""),[b,z]=s.useState(""),[A,de]=s.useState(!1),[l,q]=s.useState(!1),[M,me]=s.useState(""),[n,O]=s.useState("student"),[f,ue]=s.useState("Grade 11"),[w,_]=s.useState(c["Grade 11"][0]),[g,G]=s.useState("Mathematics"),[V,x]=s.useState(!1),[v,u]=s.useState(null),[pe,xe]=s.useState(!1),[ye,he]=s.useState(!1),[E,fe]=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&&fe(t)},I=s.useMemo(()=>qe.map(t=>({...t,met:t.test(b)})),[b]),be=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 m=!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(m)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),()=>{m=!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)&&G(o.teacher[0])},[g,n]),s.useEffect(()=>{const t=c[f]||[];t.length>0&&!t.includes(w)&&_(t[0])},[f,w]);const Ne=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:ie,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:oe,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:ze,color:"rose"}],ke=async(t,a,m)=>{u(null),x(!0),h(t),z(a),O(m),q(!1);try{se(m),await ae(t,a)}catch(p){u(ce(p,"Demo sign-in failed. Please try again.")),x(!1)}},Se=async t=>{t.preventDefault(),u(null),x(!0);try{if(l){if(!M.trim()){u("Please enter your name"),x(!1);return}if(n==="student"&&!f){u("Please select a grade level"),x(!1);return}if(n!=="student"&&!g){u("Please select a department"),x(!1);return}if(n==="admin"){u("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!be){u(`Password does not meet signup requirements. ${B}`),x(!1);return}se(n),await Ee(d,b,M,n,n==="student"?{grade:f,section:w}:{department:g})}else await ae(d,b)}catch(a){const m=l?`Sign-up failed. ${B}`:"Sign-in failed. Please check your credentials and try again.";u(ce(a,m)),x(!1)}};return e.jsxs("div",{className:"h-screen w-full flex items-center justify-center px-6 overflow-hidden relative",style:{background:"linear-gradient(135deg, #f0f9ff 0%, #f8fafc 30%, #fff1f2 60%, #f0f9ff 100%)"},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",style:{opacity: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",style:{opacity:we},src:ne}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at 30% 50%, rgba(240,249,255,0.2) 0%, rgba(248,250,252,0.5) 50%, rgba(255,241,242,0.4) 80%, rgba(248,250,252,0.85) 100%)"}}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply",style:{background:"radial-gradient(circle, rgba(168,85,247,0.3) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply",style:{background:"radial-gradient(circle, rgba(236,72,153,0.25) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen",style:{background:"radial-gradient(circle, rgba(56,189,248,0.2) 0%, transparent 70%)"}}),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(Te,{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:Re,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Ce,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:Ie,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,a)=>{const m=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(m,{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(re,{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=>me(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(ie,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:f,onChange:t=>ue(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(re,{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[f]||[]).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(oe,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:g,onChange:t=>G(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(le,{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:b,onChange:t=>z(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(Be,{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:V,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:[V?"Please wait...":l?"Create Account":"Sign In",e.jsx(te,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{q(!l),u(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,m={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 ${m[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(te,{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(le,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{ut as default};
 
1
+ import{r as s,j as e}from"./vendor-react-Dexh7fmo.js";import{B as Me}from"./button-BP5cklmU.js";import{I as D}from"./input-DBkKXOmF.js";import{m as r,A as te,s as se,a as Ee,b as ae}from"./index-CmBdDSkw.js";import{S as Te}from"./sparkles-D6B_TX7M.js";import{B as Re}from"./brain-DfMjTiNx.js";import{T as Ce}from"./trending-up-6u76yy2e.js";import{A as Ie}from"./award-COlS18fi.js";import{U as re}from"./users-CdMqBLwG.js";import{G as ie}from"./graduation-cap-BxtuU7H1.js";import{B as oe}from"./book-open-BH_yilLK.js";import{M as Le}from"./mail-BuupduAm.js";import{L as le}from"./lock-Dt6Po_Oi.js";import{E as De}from"./eye-off-D800Xx6k.js";import{E as Be}from"./eye-DyGZzCgK.js";import{S as ze}from"./shield-check-CnzWVIYd.js";import"./vendor-radix-CxzAJozq.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const ne="/assets/shader-bg-DA7bEbBA.mp4",qe=[{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)}],B="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. ${B}`: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},ut=()=>{const i=["Grade 11","Grade 12"],c={"Grade 11":["STEM A","STEM B","ABM A","HUMSS A"],"Grade 12":["STEM A","STEM B","ABM A","HUMSS A"]},o={teacher:["Mathematics","Science","English","Technology","Humanities"]},[d,h]=s.useState(""),[b,z]=s.useState(""),[A,de]=s.useState(!1),[l,q]=s.useState(!1),[M,me]=s.useState(""),[n,O]=s.useState("student"),[f,ue]=s.useState("Grade 11"),[w,_]=s.useState(c["Grade 11"][0]),[g,G]=s.useState("Mathematics"),[V,x]=s.useState(!1),[v,u]=s.useState(null),[pe,xe]=s.useState(!1),[ye,he]=s.useState(!1),[E,fe]=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&&fe(t)},I=s.useMemo(()=>qe.map(t=>({...t,met:t.test(b)})),[b]),be=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 m=!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(m)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),()=>{m=!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)&&G(o.teacher[0])},[g,n]),s.useEffect(()=>{const t=c[f]||[];t.length>0&&!t.includes(w)&&_(t[0])},[f,w]);const Ne=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:ie,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:oe,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:ze,color:"rose"}],ke=async(t,a,m)=>{u(null),x(!0),h(t),z(a),O(m),q(!1);try{se(m),await ae(t,a)}catch(p){u(ce(p,"Demo sign-in failed. Please try again.")),x(!1)}},Se=async t=>{t.preventDefault(),u(null),x(!0);try{if(l){if(!M.trim()){u("Please enter your name"),x(!1);return}if(n==="student"&&!f){u("Please select a grade level"),x(!1);return}if(n!=="student"&&!g){u("Please select a department"),x(!1);return}if(n==="admin"){u("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!be){u(`Password does not meet signup requirements. ${B}`),x(!1);return}se(n),await Ee(d,b,M,n,n==="student"?{grade:f,section:w}:{department:g})}else await ae(d,b)}catch(a){const m=l?`Sign-up failed. ${B}`:"Sign-in failed. Please check your credentials and try again.";u(ce(a,m)),x(!1)}};return e.jsxs("div",{className:"h-screen w-full flex items-center justify-center px-6 overflow-hidden relative",style:{background:"linear-gradient(135deg, #f0f9ff 0%, #f8fafc 30%, #fff1f2 60%, #f0f9ff 100%)"},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",style:{opacity: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",style:{opacity:we},src:ne}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(ellipse at 30% 50%, rgba(240,249,255,0.2) 0%, rgba(248,250,252,0.5) 50%, rgba(255,241,242,0.4) 80%, rgba(248,250,252,0.85) 100%)"}}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply",style:{background:"radial-gradient(circle, rgba(168,85,247,0.3) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply",style:{background:"radial-gradient(circle, rgba(236,72,153,0.25) 0%, transparent 70%)"}}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen",style:{background:"radial-gradient(circle, rgba(56,189,248,0.2) 0%, transparent 70%)"}}),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(Te,{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:Re,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Ce,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:Ie,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,a)=>{const m=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(m,{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(re,{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=>me(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(ie,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:f,onChange:t=>ue(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(re,{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[f]||[]).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(oe,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:g,onChange:t=>G(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(le,{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:b,onChange:t=>z(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(Be,{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:V,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:[V?"Please wait...":l?"Create Account":"Sign In",e.jsx(te,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{q(!l),u(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,m={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 ${m[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(te,{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(le,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{ut as default};
assets/{LogoutActionButton-D-8gok3U.js β†’ LogoutActionButton-TpO-by05.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as a,m as s}from"./index-DGWrSMOK.js";import{j as e}from"./vendor-react-Dexh7fmo.js";import{c as n}from"./utils-BQQgILNW.js";import{L as i}from"./log-out-DYYu4gFF.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as a,m as s}from"./index-CmBdDSkw.js";import{j as e}from"./vendor-react-Dexh7fmo.js";import{c as n}from"./utils-BQQgILNW.js";import{L as i}from"./log-out-QZHYEhcR.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{MathAnswerInput-Bx58557t.js β†’ MathAnswerInput-DOzNwadV.js} RENAMED
@@ -1 +1 @@
1
- import{r as c,c as y,j as e}from"./vendor-react-Dexh7fmo.js";import{C as P}from"./index-DGWrSMOK.js";const N={0:"⁰",1:"ΒΉ",2:"Β²",3:"Β³",4:"⁴",5:"⁡",6:"⁢",7:"⁷",8:"⁸",9:"⁹"};function S(i){let t=i;return t=t.replace(/sin⁻¹/g,"sin<sup>-1</sup>"),t=t.replace(/cos⁻¹/g,"cos<sup>-1</sup>"),t=t.replace(/tan⁻¹/g,"tan<sup>-1</sup>"),t=t.replace(/⁻¹/g,"<sup>-1</sup>"),t=t.replace(/Β²/g,"<sup>2</sup>"),t=t.replace(/Β³/g,"<sup>3</sup>"),t=t.replace(/[⁰¹⁴⁡⁢⁷⁸⁹]/g,d=>`<sup>${{"⁰":"0","ΒΉ":"1","⁴":"4","⁡":"5","⁢":"6","⁷":"7","⁸":"8","⁹":"9"}[d]??d}</sup>`),t=t.replace(/√/g,"√"),t=t.replace(/Ο€/g,"Ο€"),t=t.replace(/<(?!\/?(?:sup|sub)\b)[^>]*>/gi,""),t}const R=({value:i,onChange:t,placeholder:d,onCalculatorOpen:h,onSubmit:f})=>{const[b,g]=c.useState(!1),[m,j]=c.useState(null),[w,v]=c.useState({top:0,left:0}),p=c.useRef(null),x=c.useRef(!1),s=c.useCallback(n=>{const o=p.current;if(!o){t(i+n);return}const l=o.selectionStart??i.length,u=o.selectionEnd??i.length,D=i.slice(0,l)+n+i.slice(u);t(D),setTimeout(()=>{o.setSelectionRange(l+n.length,l+n.length),o.focus()},0)},[i,t]),C=c.useCallback(n=>{const o=n.key;if(o==="Enter"){n.preventDefault(),f?.();return}if(o==="^"){x.current=!0,n.preventDefault();return}if(x.current){if(o==="-"){s("⁻"),n.preventDefault();return}if(/^[0-9]$/.test(o)&&N[o]){s(N[o]),x.current=!1,n.preventDefault();return}x.current=!1}if(o==="Tab"&&m!==null){s(m),j(null),n.preventDefault();return}setTimeout(()=>{const l=p.current?.value??i;if(l.endsWith("pi"))t(l.slice(0,-2)+"Ο€"),j(null);else if(l.endsWith("sqrt"))t(l.slice(0,-4)+"√");else if(l.endsWith("sin-1")||l.endsWith("sin^-1")){const u=l.endsWith("sin^-1")?6:5;t(l.slice(0,-u)+"sin⁻¹")}else if(l.endsWith("cos-1")||l.endsWith("cos^-1")){const u=l.endsWith("cos^-1")?6:5;t(l.slice(0,-u)+"cos⁻¹")}else if(l.endsWith("tan-1")||l.endsWith("tan^-1")){const u=l.endsWith("tan^-1")?6:5;t(l.slice(0,-u)+"tan⁻¹")}},0)},[i,t,m,s,f]),a=c.useCallback(()=>{if(p.current){const n=p.current.getBoundingClientRect();v({top:Math.max(20,n.bottom-280),left:Math.max(10,n.left-240)})}},[]),E=c.useCallback(()=>{a(),g(!0)},[a]);y.useEffect(()=>{const n=setTimeout(()=>{a(),g(!0)},50);return()=>clearTimeout(n)},[a]),y.useEffect(()=>{if(b)return window.addEventListener("resize",a),window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0)}},[b,a]);const T=c.useCallback(()=>{},[]),k=S(i),W=k!==i&&i.length>0,r="bg-slate-100 hover:bg-slate-200 text-[#0a1628] text-sm px-2 py-1 rounded-lg transition-colors";return e.jsxs("div",{className:"relative",children:[b&&e.jsxs("div",{className:"fixed z-[60] bg-white border border-slate-200 rounded-xl shadow-xl px-3 py-3 flex flex-col gap-3 w-[220px] pointer-events-auto",style:{top:w.top,left:w.left},onMouseDown:n=>n.preventDefault(),children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Powers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Square",onClick:()=>s("Β²"),children:"xΒ²"}),e.jsx("button",{type:"button",className:r,title:"Cube",onClick:()=>s("Β³"),children:"xΒ³"}),e.jsx("button",{type:"button",className:r,title:"Power",onClick:()=>s("^"),children:"xⁿ"}),e.jsx("button",{type:"button",className:r,title:"Inverse",onClick:()=>s("⁻¹"),children:"x⁻¹"}),e.jsx("button",{type:"button",className:r,title:"Square root",onClick:()=>s("√("),children:"√"}),e.jsx("button",{type:"button",className:r,title:"Cube root",onClick:()=>s("βˆ›("),children:"βˆ›"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Inverse Trig"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Inverse sine",onClick:()=>s("sin⁻¹("),children:"sin⁻¹"}),e.jsx("button",{type:"button",className:r,title:"Inverse cosine",onClick:()=>s("cos⁻¹("),children:"cos⁻¹"}),e.jsx("button",{type:"button",className:r,title:"Inverse tangent",onClick:()=>s("tan⁻¹("),children:"tan⁻¹"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Symbols"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Pi",onClick:()=>s("Ο€"),children:"Ο€"}),e.jsx("button",{type:"button",className:r,title:"Euler's number",onClick:()=>s("e"),children:"e"}),e.jsx("button",{type:"button",className:r,title:"Infinity",onClick:()=>s("∞"),children:"∞"}),e.jsx("button",{type:"button",className:r,title:"Plus-minus",onClick:()=>s("Β±"),children:"Β±"}),e.jsx("button",{type:"button",className:r,title:"Approximately",onClick:()=>s("β‰ˆ"),children:"β‰ˆ"}),e.jsx("button",{type:"button",className:r,title:"Degree",onClick:()=>s("Β°"),children:"Β°"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Other"}),e.jsxs("div",{className:"flex gap-1 items-center",children:[e.jsx("button",{type:"button",className:r,title:"Fraction",onClick:()=>s("(/)"),children:"a/b"}),e.jsx("div",{className:"ml-auto",children:e.jsxs("button",{type:"button",className:"bg-sky-600 hover:bg-rose-500 text-white text-xs px-3 py-1 rounded-lg flex items-center gap-1",onClick:()=>h?.(),children:[e.jsx(P,{size:12}),"Use Calc"]})})]})]})]}),e.jsx("input",{ref:p,id:"math-answer-input",name:"math-answer-input","aria-label":"Math answer input",type:"text",value:i,onChange:n=>t(n.target.value),onKeyDown:C,onFocus:E,onBlur:T,placeholder:d||"Type your answer... use ^ for powers e.g. x^2 for xΒ²",className:"w-full bg-white border border-slate-200 focus:border-sky-500 rounded-xl px-4 py-3 text-[#0a1628] font-mono text-base outline-none transition-colors"}),W&&e.jsx("div",{className:"text-rose-300 text-sm font-mono mt-1",dangerouslySetInnerHTML:{__html:k}})]})};export{R as M};
 
1
+ import{r as c,c as y,j as e}from"./vendor-react-Dexh7fmo.js";import{C as P}from"./index-CmBdDSkw.js";const N={0:"⁰",1:"ΒΉ",2:"Β²",3:"Β³",4:"⁴",5:"⁡",6:"⁢",7:"⁷",8:"⁸",9:"⁹"};function S(i){let t=i;return t=t.replace(/sin⁻¹/g,"sin<sup>-1</sup>"),t=t.replace(/cos⁻¹/g,"cos<sup>-1</sup>"),t=t.replace(/tan⁻¹/g,"tan<sup>-1</sup>"),t=t.replace(/⁻¹/g,"<sup>-1</sup>"),t=t.replace(/Β²/g,"<sup>2</sup>"),t=t.replace(/Β³/g,"<sup>3</sup>"),t=t.replace(/[⁰¹⁴⁡⁢⁷⁸⁹]/g,d=>`<sup>${{"⁰":"0","ΒΉ":"1","⁴":"4","⁡":"5","⁢":"6","⁷":"7","⁸":"8","⁹":"9"}[d]??d}</sup>`),t=t.replace(/√/g,"√"),t=t.replace(/Ο€/g,"Ο€"),t=t.replace(/<(?!\/?(?:sup|sub)\b)[^>]*>/gi,""),t}const R=({value:i,onChange:t,placeholder:d,onCalculatorOpen:h,onSubmit:f})=>{const[b,g]=c.useState(!1),[m,j]=c.useState(null),[w,v]=c.useState({top:0,left:0}),p=c.useRef(null),x=c.useRef(!1),s=c.useCallback(n=>{const o=p.current;if(!o){t(i+n);return}const l=o.selectionStart??i.length,u=o.selectionEnd??i.length,D=i.slice(0,l)+n+i.slice(u);t(D),setTimeout(()=>{o.setSelectionRange(l+n.length,l+n.length),o.focus()},0)},[i,t]),C=c.useCallback(n=>{const o=n.key;if(o==="Enter"){n.preventDefault(),f?.();return}if(o==="^"){x.current=!0,n.preventDefault();return}if(x.current){if(o==="-"){s("⁻"),n.preventDefault();return}if(/^[0-9]$/.test(o)&&N[o]){s(N[o]),x.current=!1,n.preventDefault();return}x.current=!1}if(o==="Tab"&&m!==null){s(m),j(null),n.preventDefault();return}setTimeout(()=>{const l=p.current?.value??i;if(l.endsWith("pi"))t(l.slice(0,-2)+"Ο€"),j(null);else if(l.endsWith("sqrt"))t(l.slice(0,-4)+"√");else if(l.endsWith("sin-1")||l.endsWith("sin^-1")){const u=l.endsWith("sin^-1")?6:5;t(l.slice(0,-u)+"sin⁻¹")}else if(l.endsWith("cos-1")||l.endsWith("cos^-1")){const u=l.endsWith("cos^-1")?6:5;t(l.slice(0,-u)+"cos⁻¹")}else if(l.endsWith("tan-1")||l.endsWith("tan^-1")){const u=l.endsWith("tan^-1")?6:5;t(l.slice(0,-u)+"tan⁻¹")}},0)},[i,t,m,s,f]),a=c.useCallback(()=>{if(p.current){const n=p.current.getBoundingClientRect();v({top:Math.max(20,n.bottom-280),left:Math.max(10,n.left-240)})}},[]),E=c.useCallback(()=>{a(),g(!0)},[a]);y.useEffect(()=>{const n=setTimeout(()=>{a(),g(!0)},50);return()=>clearTimeout(n)},[a]),y.useEffect(()=>{if(b)return window.addEventListener("resize",a),window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0)}},[b,a]);const T=c.useCallback(()=>{},[]),k=S(i),W=k!==i&&i.length>0,r="bg-slate-100 hover:bg-slate-200 text-[#0a1628] text-sm px-2 py-1 rounded-lg transition-colors";return e.jsxs("div",{className:"relative",children:[b&&e.jsxs("div",{className:"fixed z-[60] bg-white border border-slate-200 rounded-xl shadow-xl px-3 py-3 flex flex-col gap-3 w-[220px] pointer-events-auto",style:{top:w.top,left:w.left},onMouseDown:n=>n.preventDefault(),children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Powers"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Square",onClick:()=>s("Β²"),children:"xΒ²"}),e.jsx("button",{type:"button",className:r,title:"Cube",onClick:()=>s("Β³"),children:"xΒ³"}),e.jsx("button",{type:"button",className:r,title:"Power",onClick:()=>s("^"),children:"xⁿ"}),e.jsx("button",{type:"button",className:r,title:"Inverse",onClick:()=>s("⁻¹"),children:"x⁻¹"}),e.jsx("button",{type:"button",className:r,title:"Square root",onClick:()=>s("√("),children:"√"}),e.jsx("button",{type:"button",className:r,title:"Cube root",onClick:()=>s("βˆ›("),children:"βˆ›"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Inverse Trig"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Inverse sine",onClick:()=>s("sin⁻¹("),children:"sin⁻¹"}),e.jsx("button",{type:"button",className:r,title:"Inverse cosine",onClick:()=>s("cos⁻¹("),children:"cos⁻¹"}),e.jsx("button",{type:"button",className:r,title:"Inverse tangent",onClick:()=>s("tan⁻¹("),children:"tan⁻¹"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Symbols"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",className:r,title:"Pi",onClick:()=>s("Ο€"),children:"Ο€"}),e.jsx("button",{type:"button",className:r,title:"Euler's number",onClick:()=>s("e"),children:"e"}),e.jsx("button",{type:"button",className:r,title:"Infinity",onClick:()=>s("∞"),children:"∞"}),e.jsx("button",{type:"button",className:r,title:"Plus-minus",onClick:()=>s("Β±"),children:"Β±"}),e.jsx("button",{type:"button",className:r,title:"Approximately",onClick:()=>s("β‰ˆ"),children:"β‰ˆ"}),e.jsx("button",{type:"button",className:r,title:"Degree",onClick:()=>s("Β°"),children:"Β°"})]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-[#5a6578] uppercase tracking-wider mb-0.5 block",children:"Other"}),e.jsxs("div",{className:"flex gap-1 items-center",children:[e.jsx("button",{type:"button",className:r,title:"Fraction",onClick:()=>s("(/)"),children:"a/b"}),e.jsx("div",{className:"ml-auto",children:e.jsxs("button",{type:"button",className:"bg-sky-600 hover:bg-rose-500 text-white text-xs px-3 py-1 rounded-lg flex items-center gap-1",onClick:()=>h?.(),children:[e.jsx(P,{size:12}),"Use Calc"]})})]})]})]}),e.jsx("input",{ref:p,id:"math-answer-input",name:"math-answer-input","aria-label":"Math answer input",type:"text",value:i,onChange:n=>t(n.target.value),onKeyDown:C,onFocus:E,onBlur:T,placeholder:d||"Type your answer... use ^ for powers e.g. x^2 for xΒ²",className:"w-full bg-white border border-slate-200 focus:border-sky-500 rounded-xl px-4 py-3 text-[#0a1628] font-mono text-base outline-none transition-colors"}),W&&e.jsx("div",{className:"text-rose-300 text-sm font-mono mt-1",dangerouslySetInnerHTML:{__html:k}})]})};export{R as M};
assets/{ModuleFolderCard-BGJM_1PJ.js β†’ ModuleFolderCard-BSQZpGub.js} RENAMED
@@ -1 +1 @@
1
- import{j as e}from"./vendor-react-Dexh7fmo.js";import{m as d,T as n}from"./index-DGWrSMOK.js";import{B as x}from"./book-open-B5Xvd1JL.js";import{C as h}from"./clock-qHFbMxrB.js";const r=[{bg:"bg-[#9956DE]",tab:"bg-[#8248c2]",shadow:"shadow-[#9956DE]/30"},{bg:"bg-[#1FA7E1]",tab:"bg-[#198abf]",shadow:"shadow-[#1FA7E1]/30"},{bg:"bg-[#FFB356]",tab:"bg-[#e09841]",shadow:"shadow-[#FFB356]/30"},{bg:"bg-[#FB96BB]",tab:"bg-[#de7b9f]",shadow:"shadow-[#FB96BB]/30"}],g=({module:s,index:l,onClick:o,isAtRisk:i,badgeLabel:t})=>{const a=r[l%r.length];return e.jsxs(d.button,{whileHover:{y:-8},onClick:o,className:"relative text-left rounded-[1.4rem] overflow-visible min-h-[290px] bg-transparent group w-full",children:[e.jsx("div",{className:`absolute top-0 left-4 h-7 w-32 rounded-t-xl shadow-sm transition-colors duration-300 ${a.tab}`}),e.jsxs("div",{className:`relative mt-6 rounded-[1.4rem] p-6 transition-all duration-300 overflow-hidden flex flex-col h-[calc(100%-24px)] ${a.bg} shadow-[0_18px_30px_-20px_rgba(0,0,0,0.45)] group-hover:shadow-[0_24px_40px_-15px_rgba(0,0,0,0.5)]`,children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 mix-blend-overlay bg-white/40"}),e.jsx("div",{className:"absolute -bottom-8 right-[-20%] w-48 h-48 bg-white opacity-10 rounded-full transition-transform duration-500 group-hover:scale-110"}),e.jsx("div",{className:"absolute bottom-4 right-12 w-32 h-32 bg-white opacity-10 rounded-full transition-transform duration-500 group-hover:scale-110 delay-75"}),e.jsxs("div",{className:"relative z-10 flex-1 flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsx("span",{className:"px-3 py-1.5 rounded-full bg-white/20 text-white text-[10px] font-black uppercase tracking-wider backdrop-blur-sm shadow-sm border border-white/10",children:"General Mathematics"}),(t||s.status==="Locked")&&e.jsx("span",{className:"px-2.5 py-1 rounded-full bg-black/30 text-white/90 text-[10px] font-black uppercase tracking-wider backdrop-blur-sm",children:t||"Locked"})]}),e.jsx("h3",{className:"text-2xl md:text-[22px] font-display font-black text-white leading-[1.1] mb-2 drop-shadow-sm pr-4 line-clamp-2",children:s.title}),e.jsx("p",{className:"text-white/85 text-sm line-clamp-2 mb-6 font-medium leading-relaxed pr-2",children:s.subtitle||s.description||"Master this module to unlock the next level of your mathematical journey."}),e.jsxs("div",{className:"mt-auto",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white/20 rounded-xl text-white font-bold text-[13px] backdrop-blur-sm shadow-sm border border-white/10",children:[e.jsx(x,{size:14,className:"opacity-90"})," ",s.totalLessons||s.lessons?.length||0," lessons"]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white/20 rounded-xl text-white font-bold text-[13px] backdrop-blur-sm shadow-sm border border-white/10",children:[e.jsx(h,{size:14,className:"opacity-90"})," ",s.totalQuizzes||s.quizzes?.length||0," quizzes"]})]}),e.jsxs("div",{className:"flex justify-between text-white font-bold text-[13px] mb-1.5 drop-shadow-sm",children:[e.jsx("span",{children:"Progress"}),e.jsxs("span",{children:[s.progress>0?s.progress:0,"%"]})]}),e.jsx("div",{className:"w-full h-2.5 rounded-full bg-black/20 overflow-hidden shadow-inner flex-shrink-0",children:e.jsx("div",{className:"h-full bg-white rounded-full transition-all duration-1000 ease-out",style:{width:`${s.progress>0?s.progress:0}%`}})})]}),i&&e.jsxs("div",{className:"absolute -top-3 -right-2 bg-rose-500 text-white px-3 py-1.5 rounded-full text-[11px] font-black uppercase tracking-wider flex items-center gap-1.5 shadow-lg border border-rose-400 animate-pulse",children:[e.jsx(n,{size:12,strokeWidth:3})," Review"]})]})]})]})};export{g as M};
 
1
+ import{j as e}from"./vendor-react-Dexh7fmo.js";import{m as d,T as n}from"./index-CmBdDSkw.js";import{B as x}from"./book-open-BH_yilLK.js";import{C as h}from"./clock-jSWTKlqH.js";const r=[{bg:"bg-[#9956DE]",tab:"bg-[#8248c2]",shadow:"shadow-[#9956DE]/30"},{bg:"bg-[#1FA7E1]",tab:"bg-[#198abf]",shadow:"shadow-[#1FA7E1]/30"},{bg:"bg-[#FFB356]",tab:"bg-[#e09841]",shadow:"shadow-[#FFB356]/30"},{bg:"bg-[#FB96BB]",tab:"bg-[#de7b9f]",shadow:"shadow-[#FB96BB]/30"}],g=({module:s,index:l,onClick:o,isAtRisk:i,badgeLabel:t})=>{const a=r[l%r.length];return e.jsxs(d.button,{whileHover:{y:-8},onClick:o,className:"relative text-left rounded-[1.4rem] overflow-visible min-h-[290px] bg-transparent group w-full",children:[e.jsx("div",{className:`absolute top-0 left-4 h-7 w-32 rounded-t-xl shadow-sm transition-colors duration-300 ${a.tab}`}),e.jsxs("div",{className:`relative mt-6 rounded-[1.4rem] p-6 transition-all duration-300 overflow-hidden flex flex-col h-[calc(100%-24px)] ${a.bg} shadow-[0_18px_30px_-20px_rgba(0,0,0,0.45)] group-hover:shadow-[0_24px_40px_-15px_rgba(0,0,0,0.5)]`,children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 mix-blend-overlay bg-white/40"}),e.jsx("div",{className:"absolute -bottom-8 right-[-20%] w-48 h-48 bg-white opacity-10 rounded-full transition-transform duration-500 group-hover:scale-110"}),e.jsx("div",{className:"absolute bottom-4 right-12 w-32 h-32 bg-white opacity-10 rounded-full transition-transform duration-500 group-hover:scale-110 delay-75"}),e.jsxs("div",{className:"relative z-10 flex-1 flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsx("span",{className:"px-3 py-1.5 rounded-full bg-white/20 text-white text-[10px] font-black uppercase tracking-wider backdrop-blur-sm shadow-sm border border-white/10",children:"General Mathematics"}),(t||s.status==="Locked")&&e.jsx("span",{className:"px-2.5 py-1 rounded-full bg-black/30 text-white/90 text-[10px] font-black uppercase tracking-wider backdrop-blur-sm",children:t||"Locked"})]}),e.jsx("h3",{className:"text-2xl md:text-[22px] font-display font-black text-white leading-[1.1] mb-2 drop-shadow-sm pr-4 line-clamp-2",children:s.title}),e.jsx("p",{className:"text-white/85 text-sm line-clamp-2 mb-6 font-medium leading-relaxed pr-2",children:s.subtitle||s.description||"Master this module to unlock the next level of your mathematical journey."}),e.jsxs("div",{className:"mt-auto",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white/20 rounded-xl text-white font-bold text-[13px] backdrop-blur-sm shadow-sm border border-white/10",children:[e.jsx(x,{size:14,className:"opacity-90"})," ",s.totalLessons||s.lessons?.length||0," lessons"]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white/20 rounded-xl text-white font-bold text-[13px] backdrop-blur-sm shadow-sm border border-white/10",children:[e.jsx(h,{size:14,className:"opacity-90"})," ",s.totalQuizzes||s.quizzes?.length||0," quizzes"]})]}),e.jsxs("div",{className:"flex justify-between text-white font-bold text-[13px] mb-1.5 drop-shadow-sm",children:[e.jsx("span",{children:"Progress"}),e.jsxs("span",{children:[s.progress>0?s.progress:0,"%"]})]}),e.jsx("div",{className:"w-full h-2.5 rounded-full bg-black/20 overflow-hidden shadow-inner flex-shrink-0",children:e.jsx("div",{className:"h-full bg-white rounded-full transition-all duration-1000 ease-out",style:{width:`${s.progress>0?s.progress:0}%`}})})]}),i&&e.jsxs("div",{className:"absolute -top-3 -right-2 bg-rose-500 text-white px-3 py-1.5 rounded-full text-[11px] font-black uppercase tracking-wider flex items-center gap-1.5 shadow-lg border border-rose-400 animate-pulse",children:[e.jsx(n,{size:12,strokeWidth:3})," Review"]})]})]})]})};export{g as M};
assets/{ModulesPage-C8056uyx.js β†’ ModulesPage-D7B9Sp71.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as o,j as e,c as He}from"./vendor-react-Dexh7fmo.js";import{M as je}from"./ModuleFolderCard-BGJM_1PJ.js";import{B as K}from"./button-DWdPuxDU.js";import{I as Xe}from"./input-DBkKXOmF.js";import{c as R,m as h,Z as re,F as oe,e as ee,A as Ae,C as ue,u as Ce,q as Ye,r as Ue,v as Te,w as Ke,x as Je,g as et,o as tt,p as st,T as at,y as it}from"./index-DGWrSMOK.js";import{T as te}from"./trophy-73YPSH67.js";import{S as ve}from"./sparkles-DxmNHQEo.js";import{T as X}from"./target-7Gevl8jn.js";import{A as ce}from"./award-DpLN2BvV.js";import{S as Se}from"./star-DqP0S0c5.js";import{C as pe}from"./check-BONc3QkK.js";import{X as Y}from"./x-Bj25rnWX.js";import{C as nt}from"./circle-help-BOZYr6oH.js";import{a as ze,s as le,g as rt}from"./subjects-DDYtJwQO.js";import{T as fe}from"./trending-up-B2MPUPwk.js";import{B as U}from"./book-open-B5Xvd1JL.js";import{L as Me,c as ot,a as lt}from"./quizService-BkrCeM05.js";import{C as ne}from"./circle-check-big-mv2CRLCE.js";import{L as De}from"./lock-C6XEepuP.js";import{C as J}from"./clock-qHFbMxrB.js";import Pe from"./confetti.module-C94ZD2ww.js";import{triggerQuizSubmitted as ct}from"./automationService-1THdsq3v.js";import dt from"./ScientificCalculator-BP-XvW_h.js";import{M as xt}from"./MathAnswerInput-Bx58557t.js";import Ie from"./SupplementalBanner-COM6ABNZ.js";import{P as mt}from"./pen-line-CX1xh2Q2.js";import{C as ht}from"./chevron-right-DxXkA9aZ.js";import{S as pt}from"./search-O5gEqRZi.js";import"./vendor-radix-B-ht8aK0.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./chart-column-CJzwyNMx.js";import"./apiService-BuaHZ1Ho.js";import"./chevron-up-BJyzaJs7.js";import"./brain-DHmY5cbv.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{r as o,j as e,c as He}from"./vendor-react-Dexh7fmo.js";import{M as je}from"./ModuleFolderCard-BSQZpGub.js";import{B as K}from"./button-BP5cklmU.js";import{I as Xe}from"./input-DBkKXOmF.js";import{c as R,m as h,Z as re,F as oe,e as ee,A as Ae,C as ue,u as Ce,q as Ye,r as Ue,v as Te,w as Ke,x as Je,g as et,o as tt,p as st,T as at,y as it}from"./index-CmBdDSkw.js";import{T as te}from"./trophy-DrL6Ph2J.js";import{S as ve}from"./sparkles-D6B_TX7M.js";import{T as X}from"./target-BCguvjbb.js";import{A as ce}from"./award-COlS18fi.js";import{S as Se}from"./star-B7mp4xEi.js";import{C as pe}from"./check-D1XVAVXL.js";import{X as Y}from"./x-BDSBB3q9.js";import{C as nt}from"./circle-help-CCtzJ5sC.js";import{a as ze,s as le,g as rt}from"./subjects-wOHUanD9.js";import{T as fe}from"./trending-up-6u76yy2e.js";import{B as U}from"./book-open-BH_yilLK.js";import{L as Me,c as ot,a as lt}from"./quizService-YBJVdiN1.js";import{C as ne}from"./circle-check-big-C_XnLpga.js";import{L as De}from"./lock-Dt6Po_Oi.js";import{C as J}from"./clock-jSWTKlqH.js";import Pe from"./confetti.module-C94ZD2ww.js";import{triggerQuizSubmitted as ct}from"./automationService-IMphlGK7.js";import dt from"./ScientificCalculator-B0rqpddr.js";import{M as xt}from"./MathAnswerInput-DOzNwadV.js";import Ie from"./SupplementalBanner-CaXzjH7M.js";import{P as mt}from"./pen-line-CBic_SY8.js";import{C as ht}from"./chevron-right-BSCyuP_x.js";import{S as pt}from"./search-zqCwfHe1.js";import"./vendor-radix-CxzAJozq.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./chart-column-DzJCKCOe.js";import"./apiService-ZZIWaV70.js";import"./chevron-up-CwQX0CFg.js";import"./brain-DfMjTiNx.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{NotificationCenter-l7IdH4wu.js β†’ NotificationCenter-Djp-U1R4.js} RENAMED
@@ -1 +1 @@
1
- import{r as m,j as e}from"./vendor-react-Dexh7fmo.js";import{u as w,m as o,e as A,n as C,h as z,i as M}from"./index-DGWrSMOK.js";import{B as h}from"./bell-DeNrtKrI.js";import{C as E}from"./check-check-BDU3hkDf.js";import{X as R}from"./x-Bj25rnWX.js";import{B as T}from"./book-open-B5Xvd1JL.js";import{M as $}from"./message-square-DIXhbelM.js";import{C as B}from"./circle-alert-D8UKyVHS.js";import{T as H}from"./trophy-73YPSH67.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const W=({userRole:S="student"})=>{const{currentUser:l}=w(),[u,x]=m.useState(!1),[r,f]=m.useState([]),[D,p]=m.useState(!1);m.useEffect(()=>{(async()=>{if(l){p(!0);try{const N=(await C(l.uid,20)).map(s=>{let n="info";s.type==="achievement"?n="achievement":s.type==="risk_alert"||s.type==="reminder"?n="alert":s.type==="message"?n="message":n="info";const v=s.createdAt instanceof Date?s.createdAt:new Date(s.createdAt),k=Date.now()-v.getTime(),i=Math.floor(k/6e4);let d;return i<1?d="Just now":i<60?d=`${i} min ago`:i<1440?d=`${Math.floor(i/60)} hours ago`:d=`${Math.floor(i/1440)} days ago`,{id:s.id,type:n,title:s.title,message:s.message,time:d,read:s.read}});f(N)}catch(a){console.error("Error loading notifications:",a)}finally{p(!1)}}})()},[l]);const c=r.filter(t=>!t.read).length,b=()=>{f(r.map(t=>({...t,read:!0}))),l&&z(l.uid).catch(t=>console.error("Error marking all as read:",t))},g=t=>{f(r.map(a=>a.id===t?{...a,read:!0}:a)),M(t).catch(a=>console.error("Error marking as read:",a))},y=t=>{switch(t){case"achievement":return H;case"alert":return B;case"message":return $;case"info":return T;default:return h}},j=t=>{switch(t){case"achievement":return"bg-rose-500/10 text-rose-600";case"alert":return"bg-red-500/10 text-red-600";case"message":return"bg-sky-500/10 text-sky-600";case"info":return"bg-emerald-500/10 text-emerald-600";default:return"bg-[#edf1f7] text-[#5a6578]"}};return e.jsxs("div",{className:"relative",children:[e.jsxs(o.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>x(!u),className:"relative p-3 bg-[#edf1f7] rounded-xl text-[#5a6578] hover:bg-[#dde3eb] transition-colors",children:[e.jsx(h,{size:20}),c>0&&e.jsx(o.span,{initial:{scale:0},animate:{scale:1},className:"absolute -top-1 -right-1 w-5 h-5 bg-sky-600 text-white text-xs font-bold rounded-full flex items-center justify-center",children:c})]}),e.jsx(A,{children:u&&e.jsxs("div",{children:[e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>x(!1)}),e.jsxs(o.div,{initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{duration:.2},className:"absolute right-0 top-full mt-2 w-96 bg-[#f7f9fc] rounded-xl shadow-2xl border border-[#dde3eb] z-50 overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-gradient-to-r from-sky-600 to-sky-500",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-white",children:"Notifications"}),e.jsx("p",{className:"text-xs text-sky-100 mt-0.5",children:c>0?`${c} unread`:"All caught up!"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c>0&&e.jsx(o.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:b,className:"text-xs text-sky-400 hover:text-sky-300 font-bold",children:e.jsx(E,{size:18})}),e.jsx(o.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>x(!1),className:"text-slate-500 hover:text-sky-700",children:e.jsx(R,{size:18})})]})]}),e.jsx("div",{className:"max-h-96 overflow-y-auto",children:r.length===0?e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(h,{size:48,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] text-sm font-body",children:"No notifications yet"})]}):e.jsx("div",{children:r.map(t=>{const a=y(t.type);return e.jsx(o.div,{whileHover:{backgroundColor:"rgba(241, 245, 249, 0.5)"},onClick:()=>g(t.id),className:`p-4 border-b border-[#dde3eb] cursor-pointer transition-colors ${t.read?"":"bg-sky-50/40"}`,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${j(t.type)}`,children:e.jsx(a,{size:18})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] line-clamp-1 font-body",children:t.title}),!t.read&&e.jsx("span",{className:"w-2 h-2 bg-sky-600 rounded-full flex-shrink-0 mt-1.5"})]}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2 line-clamp-2 font-body",children:t.message}),e.jsx("p",{className:"text-xs text-slate-500",children:t.time})]})]})},t.id)})})}),r.length>0&&e.jsx("div",{className:"p-3 border-t border-[#dde3eb] text-center bg-[#edf1f7]",children:e.jsx("button",{className:"text-xs text-sky-600 hover:text-sky-700 font-bold font-body",children:"View All Notifications"})})]})]},"notification-panel")})]})};export{W as default};
 
1
+ import{r as m,j as e}from"./vendor-react-Dexh7fmo.js";import{u as w,m as o,e as A,n as C,h as z,i as M}from"./index-CmBdDSkw.js";import{B as h}from"./bell-B1VXtbbh.js";import{C as E}from"./check-check-TbgWzZ22.js";import{X as R}from"./x-BDSBB3q9.js";import{B as T}from"./book-open-BH_yilLK.js";import{M as $}from"./message-square-BxgAV6zJ.js";import{C as B}from"./circle-alert-DWP6udG1.js";import{T as H}from"./trophy-DrL6Ph2J.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const W=({userRole:S="student"})=>{const{currentUser:l}=w(),[u,x]=m.useState(!1),[r,f]=m.useState([]),[D,p]=m.useState(!1);m.useEffect(()=>{(async()=>{if(l){p(!0);try{const N=(await C(l.uid,20)).map(s=>{let n="info";s.type==="achievement"?n="achievement":s.type==="risk_alert"||s.type==="reminder"?n="alert":s.type==="message"?n="message":n="info";const v=s.createdAt instanceof Date?s.createdAt:new Date(s.createdAt),k=Date.now()-v.getTime(),i=Math.floor(k/6e4);let d;return i<1?d="Just now":i<60?d=`${i} min ago`:i<1440?d=`${Math.floor(i/60)} hours ago`:d=`${Math.floor(i/1440)} days ago`,{id:s.id,type:n,title:s.title,message:s.message,time:d,read:s.read}});f(N)}catch(a){console.error("Error loading notifications:",a)}finally{p(!1)}}})()},[l]);const c=r.filter(t=>!t.read).length,b=()=>{f(r.map(t=>({...t,read:!0}))),l&&z(l.uid).catch(t=>console.error("Error marking all as read:",t))},g=t=>{f(r.map(a=>a.id===t?{...a,read:!0}:a)),M(t).catch(a=>console.error("Error marking as read:",a))},y=t=>{switch(t){case"achievement":return H;case"alert":return B;case"message":return $;case"info":return T;default:return h}},j=t=>{switch(t){case"achievement":return"bg-rose-500/10 text-rose-600";case"alert":return"bg-red-500/10 text-red-600";case"message":return"bg-sky-500/10 text-sky-600";case"info":return"bg-emerald-500/10 text-emerald-600";default:return"bg-[#edf1f7] text-[#5a6578]"}};return e.jsxs("div",{className:"relative",children:[e.jsxs(o.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>x(!u),className:"relative p-3 bg-[#edf1f7] rounded-xl text-[#5a6578] hover:bg-[#dde3eb] transition-colors",children:[e.jsx(h,{size:20}),c>0&&e.jsx(o.span,{initial:{scale:0},animate:{scale:1},className:"absolute -top-1 -right-1 w-5 h-5 bg-sky-600 text-white text-xs font-bold rounded-full flex items-center justify-center",children:c})]}),e.jsx(A,{children:u&&e.jsxs("div",{children:[e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>x(!1)}),e.jsxs(o.div,{initial:{opacity:0,y:-10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{duration:.2},className:"absolute right-0 top-full mt-2 w-96 bg-[#f7f9fc] rounded-xl shadow-2xl border border-[#dde3eb] z-50 overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-[#dde3eb] flex items-center justify-between bg-gradient-to-r from-sky-600 to-sky-500",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-display font-bold text-white",children:"Notifications"}),e.jsx("p",{className:"text-xs text-sky-100 mt-0.5",children:c>0?`${c} unread`:"All caught up!"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c>0&&e.jsx(o.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:b,className:"text-xs text-sky-400 hover:text-sky-300 font-bold",children:e.jsx(E,{size:18})}),e.jsx(o.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>x(!1),className:"text-slate-500 hover:text-sky-700",children:e.jsx(R,{size:18})})]})]}),e.jsx("div",{className:"max-h-96 overflow-y-auto",children:r.length===0?e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(h,{size:48,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] text-sm font-body",children:"No notifications yet"})]}):e.jsx("div",{children:r.map(t=>{const a=y(t.type);return e.jsx(o.div,{whileHover:{backgroundColor:"rgba(241, 245, 249, 0.5)"},onClick:()=>g(t.id),className:`p-4 border-b border-[#dde3eb] cursor-pointer transition-colors ${t.read?"":"bg-sky-50/40"}`,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${j(t.type)}`,children:e.jsx(a,{size:18})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] line-clamp-1 font-body",children:t.title}),!t.read&&e.jsx("span",{className:"w-2 h-2 bg-sky-600 rounded-full flex-shrink-0 mt-1.5"})]}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2 line-clamp-2 font-body",children:t.message}),e.jsx("p",{className:"text-xs text-slate-500",children:t.time})]})]})},t.id)})})}),r.length>0&&e.jsx("div",{className:"p-3 border-t border-[#dde3eb] text-center bg-[#edf1f7]",children:e.jsx("button",{className:"text-xs text-sky-600 hover:text-sky-700 font-bold font-body",children:"View All Notifications"})})]})]},"notification-panel")})]})};export{W as default};
assets/{ProfileModal-CvubwvbT.js β†’ ProfileModal-CnV-otvQ.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r,j as e}from"./vendor-react-Dexh7fmo.js";import{B as c}from"./button-DWdPuxDU.js";import{I as l}from"./input-DBkKXOmF.js";import{c as u,e as P,m as k,G as A,L as B}from"./index-DGWrSMOK.js";import{C as R}from"./CompositeAvatar-CphZ-OWw.js";import{X as D}from"./x-Bj25rnWX.js";import{U as f}from"./users-BRS21lR4.js";import{M as F}from"./mail-D-r4ZWDN.js";import{A as b}from"./award-DpLN2BvV.js";import{B as w}from"./book-open-B5Xvd1JL.js";import{C as U}from"./calendar-19p2TrVX.js";import{G as _}from"./globe-CA6LY_zw.js";import{S as T}from"./save-B5SCmCsP.js";import"./vendor-radix-B-ht8aK0.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./avatarData-DykDiQ_Y.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-Dexh7fmo.js";import{B as c}from"./button-BP5cklmU.js";import{I as l}from"./input-DBkKXOmF.js";import{c as u,e as P,m as k,G as A,N as B}from"./index-CmBdDSkw.js";import{C as R}from"./CompositeAvatar-DSWWcDP7.js";import{X as D}from"./x-BDSBB3q9.js";import{U as f}from"./users-CdMqBLwG.js";import{M as F}from"./mail-BuupduAm.js";import{A as b}from"./award-COlS18fi.js";import{B as w}from"./book-open-BH_yilLK.js";import{C as U}from"./calendar-CP-HCx1y.js";import{G as _}from"./globe-ZtrF4mgA.js";import{S as T}from"./save-XQRYdTi9.js";import"./vendor-radix-CxzAJozq.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./avatarData-BW_TX0b4.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{QuizBattlePage-BhgM4TWz.js β†’ QuizBattlePage-C-kQ0NH9.js} RENAMED
The diff for this file is too large to render. See raw diff
 
assets/{RewardsModal-CtOcWG3R.js β†’ RewardsModal-DbFwQSQa.js} RENAMED
@@ -1 +1 @@
1
- import{j as e}from"./vendor-react-Dexh7fmo.js";import{X as h}from"./x-Bj25rnWX.js";import{l as o,F as d,Z as f}from"./index-DGWrSMOK.js";import{S as n}from"./star-DqP0S0c5.js";import{T as g}from"./trophy-73YPSH67.js";import{T as j}from"./target-7Gevl8jn.js";import{B as u}from"./book-open-B5Xvd1JL.js";import{A as N}from"./award-DpLN2BvV.js";import{C as v}from"./calendar-19p2TrVX.js";import{U as w}from"./users-BRS21lR4.js";import{T as y}from"./trending-up-B2MPUPwk.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const R=({isOpen:c,onClose:r,userLevel:t,currentXP:i,xpToNextLevel:a,totalXP:x,streak:m})=>{if(!c)return null;const b=[{id:"1",icon:n,title:"First Steps",description:"Complete your first video lesson",unlocked:!0,color:"text-[#9956DE]",bgColor:"bg-[#FB96BB]/20"},{id:"2",icon:g,title:"Quiz Master",description:"Score 100% on any quiz",unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"3",icon:d,title:"Week Warrior",description:"Maintain a 7-day login streak",progress:2,total:7,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"4",icon:j,title:"Practice Makes Perfect",description:"Complete 10 practice sets",progress:2,total:10,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"5",icon:u,title:"Knowledge Seeker",description:"Watch 20 video lessons",unlocked:!0,color:"text-[#1FA7E1]",bgColor:"bg-[#6ED1CF]/20"},{id:"6",icon:f,title:"Speed Learner",description:"Complete 5 lessons in one day",unlocked:!0,color:"text-[#FFB356]",bgColor:"bg-[#FFB356]/20"},{id:"7",icon:o,title:"Crown Achiever",description:"Reach Level 10",progress:4,total:10,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"8",icon:N,title:"XP Hunter",description:"Earn 1000 XP",unlocked:!0,color:"text-[#7274ED]",bgColor:"bg-[#7274ED]/15"},{id:"9",icon:v,title:"Dedicated Learner",description:"Maintain a 14-day streak",progress:2,total:14,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"10",icon:w,title:"Monthly Champion",description:"Maintain a 30-day streak",progress:2,total:30,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"}],p=[{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 login streak",xp:25}];return 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:r}),e.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[85vh] overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-6 text-white relative overflow-hidden",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.jsx("p",{className:"text-white/90 text-sm font-body",children:"Track your learning progress and unlock badges"})]}),e.jsx("button",{onClick:r,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(h,{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(o,{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:t})]}),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-[#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:x.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(d,{size:18,className:"text-[#FF8B8B]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Day Streak"})]}),e.jsxs("p",{className:"text-2xl font-bold",children:[m," days"]})]})]}),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 ",t]}),e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",t+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:[i," / ",a," 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",style:{width:`${i/a*100}%`}})})]})]})]}),e.jsxs("div",{className:"p-6 overflow-y-auto max-h-[calc(85vh-280px)]",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:b.map(s=>{const l=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(l,{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&&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",style:{width:`${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(y,{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:p.map((s,l)=>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"]})]},l))})]})]})]})]})};export{R as default};
 
1
+ import{j as e}from"./vendor-react-Dexh7fmo.js";import{X as h}from"./x-BDSBB3q9.js";import{l as o,F as d,Z as f}from"./index-CmBdDSkw.js";import{S as n}from"./star-B7mp4xEi.js";import{T as g}from"./trophy-DrL6Ph2J.js";import{T as j}from"./target-BCguvjbb.js";import{B as u}from"./book-open-BH_yilLK.js";import{A as N}from"./award-COlS18fi.js";import{C as v}from"./calendar-CP-HCx1y.js";import{U as w}from"./users-CdMqBLwG.js";import{T as y}from"./trending-up-6u76yy2e.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const R=({isOpen:c,onClose:r,userLevel:t,currentXP:i,xpToNextLevel:a,totalXP:x,streak:m})=>{if(!c)return null;const b=[{id:"1",icon:n,title:"First Steps",description:"Complete your first video lesson",unlocked:!0,color:"text-[#9956DE]",bgColor:"bg-[#FB96BB]/20"},{id:"2",icon:g,title:"Quiz Master",description:"Score 100% on any quiz",unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"3",icon:d,title:"Week Warrior",description:"Maintain a 7-day login streak",progress:2,total:7,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"4",icon:j,title:"Practice Makes Perfect",description:"Complete 10 practice sets",progress:2,total:10,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"5",icon:u,title:"Knowledge Seeker",description:"Watch 20 video lessons",unlocked:!0,color:"text-[#1FA7E1]",bgColor:"bg-[#6ED1CF]/20"},{id:"6",icon:f,title:"Speed Learner",description:"Complete 5 lessons in one day",unlocked:!0,color:"text-[#FFB356]",bgColor:"bg-[#FFB356]/20"},{id:"7",icon:o,title:"Crown Achiever",description:"Reach Level 10",progress:4,total:10,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"8",icon:N,title:"XP Hunter",description:"Earn 1000 XP",unlocked:!0,color:"text-[#7274ED]",bgColor:"bg-[#7274ED]/15"},{id:"9",icon:v,title:"Dedicated Learner",description:"Maintain a 14-day streak",progress:2,total:14,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"},{id:"10",icon:w,title:"Monthly Champion",description:"Maintain a 30-day streak",progress:2,total:30,unlocked:!1,color:"text-slate-500",bgColor:"bg-slate-100"}],p=[{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 login streak",xp:25}];return 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:r}),e.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[85vh] overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-6 text-white relative overflow-hidden",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.jsx("p",{className:"text-white/90 text-sm font-body",children:"Track your learning progress and unlock badges"})]}),e.jsx("button",{onClick:r,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(h,{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(o,{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:t})]}),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-[#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:x.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(d,{size:18,className:"text-[#FF8B8B]"}),e.jsx("span",{className:"text-xs font-medium text-white/90 font-body",children:"Day Streak"})]}),e.jsxs("p",{className:"text-2xl font-bold",children:[m," days"]})]})]}),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 ",t]}),e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",t+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:[i," / ",a," 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",style:{width:`${i/a*100}%`}})})]})]})]}),e.jsxs("div",{className:"p-6 overflow-y-auto max-h-[calc(85vh-280px)]",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:b.map(s=>{const l=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(l,{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&&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",style:{width:`${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(y,{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:p.map((s,l)=>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"]})]},l))})]})]})]})]})};export{R as default};
assets/{RightSidebar-kfU04N_d.js β†’ RightSidebar--rSxCGQy.js} RENAMED
@@ -1 +1 @@
1
- import{r as m,j as e}from"./vendor-react-Dexh7fmo.js";import{e as g,m as r,Z as f,F as p,l as x}from"./index-DGWrSMOK.js";import{C as v}from"./circle-check-big-mv2CRLCE.js";import{T as j,a as w,b as N}from"./tooltip-D9lDiW9U.js";import{T as y}from"./trophy-73YPSH67.js";import{C as h}from"./chevron-right-DxXkA9aZ.js";import{S as C}from"./star-DqP0S0c5.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-radix-B-ht8aK0.js";import"./utils-BQQgILNW.js";import"./clsx-B-dksMZM.js";const b=[{id:1,title:"Daily challenge",subtitle:"Do your plan before 09:00 AM",bgColor:"bg-[#6ED1CF]",orbColor:"bg-[#50B8B6]",avatars:["https://i.pravatar.cc/150?img=1","https://i.pravatar.cc/150?img=5","https://i.pravatar.cc/150?img=8"],extraCount:4,icon:e.jsx(f,{size:24,fill:"currentColor",className:"text-white"})},{id:2,title:"Weekend Warrior",subtitle:"Complete 3 modules this weekend",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",avatars:["https://i.pravatar.cc/150?img=12","https://i.pravatar.cc/150?img=32"],extraCount:12,icon:e.jsx(p,{size:24,fill:"currentColor",className:"text-white"})},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",avatars:["https://i.pravatar.cc/150?img=44","https://i.pravatar.cc/150?img=55","https://i.pravatar.cc/150?img=68"],extraCount:8,icon:e.jsx(v,{size:24,className:"text-white"})}],_=(o=[])=>{const n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=new Date,l=i.getDay(),a=[];for(let t=0;t<7;t++){const s=new Date(i);s.setDate(i.getDate()-l+t);const c=t===l,d=`${s.getFullYear()}-${String(s.getMonth()+1).padStart(2,"0")}-${String(s.getDate()).padStart(2,"0")}`,u=o.includes(d);a.push({dayName:n[t],dateNumber:s.getDate(),isToday:c,hasDot:u})}return a},k=({streakHistory:o=[]})=>{const[n,i]=m.useState(0),l=_(o);m.useEffect(()=>{const t=setInterval(()=>{i(s=>(s+1)%b.length)},5e3);return()=>clearInterval(t)},[]);const a=b[n];return e.jsxs("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-[170px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(g,{mode:"wait",children:e.jsxs(r.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${a.bgColor} 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"})]}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${a.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 bottom-4 w-[52px] h-[52px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-45 group-hover:scale-110 transition-transform duration-700 flex items-center justify-center",children:a.icon}),e.jsxs("div",{className:"relative z-10 w-3/4",children:[e.jsx("h3",{className:"font-display font-bold text-[22px] text-white mb-1",children:a.title}),e.jsx("p",{className:"text-[13px] font-medium text-white/80 leading-snug",children:a.subtitle})]}),e.jsxs("div",{className:"flex items-center -space-x-2.5 relative z-10 mt-auto",children:[a.avatars.map((t,s)=>e.jsx("img",{src:t,alt:"User",className:"w-[34px] h-[34px] rounded-full border-2 border-transparent object-cover relative z-[3] z-[2] z-[1]",style:{borderColor:a.bgColor.replace("bg-[","").replace("]","")}},s)),e.jsxs("div",{className:"w-[34px] h-[34px] rounded-full border-2 text-[12px] font-bold flex items-center justify-center text-white relative z-0",style:{backgroundColor:"rgba(0,0,0,0.2)",borderColor:a.bgColor.replace("bg-[","").replace("]","")},children:["+",a.extraCount]})]})]},a.id)})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-display text-[15px] font-bold text-[#141b2d] mb-4 px-1",children:"Your streak"}),e.jsx("div",{className:"flex justify-between items-center gap-1.5 px-0.5",children:l.map((t,s)=>e.jsxs("div",{className:`flex flex-col items-center pt-2 pb-3 w-[46px] h-[72px] rounded-[24px] border ${t.isToday?"bg-[#12192b] text-white border-transparent shadow-[0_8px_16px_rgba(18,25,43,0.3)] transform -translate-y-1":"bg-white text-slate-400 border-slate-200/80 hover:border-slate-300"} transition-all duration-200 cursor-pointer`,children:[e.jsx("div",{className:"h-1.5 flex items-center justify-center mb-1.5",children:t.hasDot?e.jsx("div",{className:`w-[5px] h-[5px] rounded-full ${t.isToday?"bg-white":"bg-slate-300"}`}):e.jsx("div",{className:`text-[10px] ${t.isToday?"text-white/50":"text-slate-200"} font-bold`,children:"+"})}),e.jsx("span",{className:`text-[11px] font-bold mb-1 ${t.isToday?"text-slate-300":"text-slate-400/80"}`,children:t.dayName}),e.jsx("span",{className:`text-[15px] font-bold leading-none ${t.isToday?"text-white":"text-[#334155]"}`,children:t.dateNumber})]},s))})]})]})},X=({onOpenRewards:o,onOpenLeaderboard:n,onNavigateToModules:i,userLevel:l,currentXP:a,xpToNextLevel:t,streak:s,streakHistory:c=[]})=>{const d=a/t*100;return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(r.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:o,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:"w-9 h-9 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(y,{size:16,className:"text-white"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-white tracking-wide",children:"Rewards & Achievements"})]}),e.jsx(h,{size:16,className:"text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-2 py-1 rounded-md bg-white/14 border border-white/25 text-white",children:[e.jsx(x,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",l]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(j,{children:[e.jsx(w,{asChild:!0,children:e.jsxs("button",{onClick:i,className:"flex items-center gap-1.5 text-xs font-body px-2 py-1 rounded-md bg-white/14 border border-white/25 text-white cursor-pointer hover:bg-white/20 transition-colors active:scale-95",children:[e.jsx(C,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold",children:[a," XP"]})]})}),e.jsx(N,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-2 py-1 rounded-md bg-white/14 border border-white/25 text-white",children:[e.jsx(p,{size:12,className:"text-[#FF8B8B]"}),e.jsxs("span",{className:"font-bold",children:[s,"d"]})]})]}),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 ",l+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(d),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(r.div,{initial:{width:0},animate:{width:`${d}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(r.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(k,{streakHistory:c})}),e.jsxs(r.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:n,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(x,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(h,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsxs("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:[e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsxs(r.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.5},className:"relative mb-2",children:[e.jsx("img",{src:"https://i.pravatar.cc/150?img=33",alt:"You",className:"w-10 h-10 rounded-full border-[3px] border-sky-400 z-10 relative object-cover shadow-sm bg-white"}),e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-sky-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"2"})]}),e.jsxs(r.div,{initial:{height:0},animate:{height:"54px"},transition:{delay:.4,duration:.5,ease:"easeOut"},className:"w-[70px] bg-gradient-to-b from-slate-200 to-slate-100 rounded-t-xl rounded-b-md border-t-2 border-slate-50 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:"text-slate-400 font-black text-2xl opacity-40 translate-y-1",children:"2"}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:"block text-[12px] font-bold text-[#0a1628]",children:"You"}),e.jsx("span",{className:"block text-[10px] text-sky-600 font-bold",children:"2.1k XP"})]})]}),e.jsxs("div",{className:"flex flex-col items-center relative z-20 -mx-2",children:[e.jsxs(r.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.7},className:"relative mb-2",children:[e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(x,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("img",{src:"https://i.pravatar.cc/150?img=68",alt:"Alex",className:"w-[52px] h-[52px] rounded-full border-[3px] border-amber-400 z-10 relative object-cover shadow-md bg-white"}),e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-amber-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"1"})]}),e.jsxs(r.div,{initial:{height:0},animate:{height:"74px"},transition:{delay:.6,duration:.5,ease:"easeOut"},className:"w-[78px] bg-gradient-to-b from-amber-100 to-amber-50 rounded-t-xl rounded-b-md border-t-2 border-amber-50 flex items-center justify-center relative shadow-[inset_0_-4px_8px_rgba(251,191,36,0.1),0_6px_8px_rgba(0,0,0,0.05)]",children:[e.jsx("span",{className:"text-amber-400 font-black text-3xl opacity-50 translate-y-1",children:"1"}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/80 rounded-t-xl"})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:"block text-[13px] font-black text-[#0a1628]",children:"Alex M."}),e.jsx("span",{className:"block text-[11px] text-amber-600 font-bold",children:"2.4k XP"})]})]}),e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsxs(r.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.6},className:"relative mb-2",children:[e.jsx("img",{src:"https://i.pravatar.cc/150?img=47",alt:"Sarah",className:"w-10 h-10 rounded-full border-[3px] border-orange-400 z-10 relative object-cover shadow-sm bg-white"}),e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-orange-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"3"})]}),e.jsxs(r.div,{initial:{height:0},animate:{height:"38px"},transition:{delay:.5,duration:.5,ease:"easeOut"},className:"w-[70px] bg-gradient-to-b from-orange-50 to-slate-50 rounded-t-xl rounded-b-md border-t-2 border-orange-100 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(249,115,22,0.05),0_4px_6px_rgba(0,0,0,0.02)]",children:[e.jsx("span",{className:"text-orange-400/60 font-black text-2xl opacity-60 translate-y-1",children:"3"}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:"block text-[12px] font-bold text-[#0a1628]",children:"Sarah K."}),e.jsx("span",{className:"block text-[10px] text-orange-600 font-bold",children:"1.9k XP"})]})]})]})]})]})};export{X as default};
 
1
+ import{r as h,j as e}from"./vendor-react-Dexh7fmo.js";import{e as g,m as r,Z as f,F as u,l as m}from"./index-CmBdDSkw.js";import{C as v}from"./circle-check-big-C_XnLpga.js";import{T as j,a as w,b as N}from"./tooltip-Bn7-0zmi.js";import{T as y}from"./trophy-DrL6Ph2J.js";import{C as p}from"./chevron-right-BSCyuP_x.js";import{S as C}from"./star-B7mp4xEi.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-radix-CxzAJozq.js";import"./utils-BQQgILNW.js";import"./clsx-B-dksMZM.js";const b=[{id:1,title:"Daily challenge",subtitle:"Do your plan before 09:00 AM",bgColor:"bg-[#6ED1CF]",orbColor:"bg-[#50B8B6]",avatars:["https://i.pravatar.cc/150?img=1","https://i.pravatar.cc/150?img=5","https://i.pravatar.cc/150?img=8"],extraCount:4,icon:e.jsx(f,{size:24,fill:"currentColor",className:"text-white"})},{id:2,title:"Weekend Warrior",subtitle:"Complete 3 modules this weekend",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",avatars:["https://i.pravatar.cc/150?img=12","https://i.pravatar.cc/150?img=32"],extraCount:12,icon:e.jsx(u,{size:24,fill:"currentColor",className:"text-white"})},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",avatars:["https://i.pravatar.cc/150?img=44","https://i.pravatar.cc/150?img=55","https://i.pravatar.cc/150?img=68"],extraCount:8,icon:e.jsx(v,{size:24,className:"text-white"})}],k=(o=[])=>{const n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=new Date,l=i.getDay(),a=[];for(let t=0;t<7;t++){const s=new Date(i);s.setDate(i.getDate()-l+t);const c=t===l,d=`${s.getFullYear()}-${String(s.getMonth()+1).padStart(2,"0")}-${String(s.getDate()).padStart(2,"0")}`,x=o.includes(d);a.push({dayName:n[t],dateNumber:s.getDate(),isToday:c,hasDot:x})}return a},_=({streakHistory:o=[]})=>{const[n,i]=h.useState(0),l=k(o);h.useEffect(()=>{const t=setInterval(()=>{i(s=>(s+1)%b.length)},5e3);return()=>clearInterval(t)},[]);const a=b[n];return e.jsxs("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-[170px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(g,{mode:"wait",children:e.jsxs(r.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${a.bgColor} 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"})]}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${a.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 bottom-4 w-[52px] h-[52px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-45 group-hover:scale-110 transition-transform duration-700 flex items-center justify-center",children:a.icon}),e.jsxs("div",{className:"relative z-10 w-3/4",children:[e.jsx("h3",{className:"font-display font-bold text-[22px] text-white mb-1",children:a.title}),e.jsx("p",{className:"text-[13px] font-medium text-white/80 leading-snug",children:a.subtitle})]}),e.jsxs("div",{className:"flex items-center -space-x-2.5 relative z-10 mt-auto",children:[a.avatars.map((t,s)=>e.jsx("img",{src:t,alt:"User",className:"w-[34px] h-[34px] rounded-full border-2 border-transparent object-cover relative z-[3] z-[2] z-[1]",style:{borderColor:a.bgColor.replace("bg-[","").replace("]","")}},s)),e.jsxs("div",{className:"w-[34px] h-[34px] rounded-full border-2 text-[12px] font-bold flex items-center justify-center text-white relative z-0",style:{backgroundColor:"rgba(0,0,0,0.2)",borderColor:a.bgColor.replace("bg-[","").replace("]","")},children:["+",a.extraCount]})]})]},a.id)})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-display text-[15px] font-bold text-[#141b2d] mb-4 px-1",children:"Your streak"}),e.jsx("div",{className:"flex justify-between items-center gap-1.5 px-0.5",children:l.map((t,s)=>e.jsxs("div",{className:`flex flex-col items-center pt-2 pb-3 w-[46px] h-[72px] rounded-[24px] border ${t.isToday?"bg-[#12192b] text-white border-transparent shadow-[0_8px_16px_rgba(18,25,43,0.3)] transform -translate-y-1":"bg-white text-slate-400 border-slate-200/80 hover:border-slate-300"} transition-all duration-200 cursor-pointer`,children:[e.jsx("div",{className:"h-1.5 flex items-center justify-center mb-1.5",children:t.hasDot?e.jsx("div",{className:`w-[5px] h-[5px] rounded-full ${t.isToday?"bg-white":"bg-slate-300"}`}):e.jsx("div",{className:`text-[10px] ${t.isToday?"text-white/50":"text-slate-200"} font-bold`,children:"+"})}),e.jsx("span",{className:`text-[11px] font-bold mb-1 ${t.isToday?"text-slate-300":"text-slate-400/80"}`,children:t.dayName}),e.jsx("span",{className:`text-[15px] font-bold leading-none ${t.isToday?"text-white":"text-[#334155]"}`,children:t.dateNumber})]},s))})]})]})},X=({onOpenRewards:o,onOpenLeaderboard:n,onNavigateToModules:i,userLevel:l,currentXP:a,xpToNextLevel:t,streak:s,streakHistory:c=[]})=>{const d=a/t*100;return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(r.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:o,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(y,{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(p,{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(m,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",l]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(j,{children:[e.jsx(w,{asChild:!0,children:e.jsxs("button",{onClick:x=>{x.stopPropagation(),i?.()},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(C,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[a," XP"]})]})}),e.jsx(N,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(u,{size:12,className:"text-[#FF8B8B]"}),e.jsxs("span",{className:"font-bold",children:[s,"d"]})]})]}),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 ",l+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(d),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(r.div,{initial:{width:0},animate:{width:`${d}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(r.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(_,{streakHistory:c})}),e.jsxs(r.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:n,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(m,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(p,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsxs("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:[e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsxs(r.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.5},className:"relative mb-2",children:[e.jsx("img",{src:"https://i.pravatar.cc/150?img=33",alt:"You",className:"w-10 h-10 rounded-full border-[3px] border-sky-400 z-10 relative object-cover shadow-sm bg-white"}),e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-sky-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"2"})]}),e.jsxs(r.div,{initial:{height:0},animate:{height:"54px"},transition:{delay:.4,duration:.5,ease:"easeOut"},className:"w-[70px] bg-gradient-to-b from-slate-200 to-slate-100 rounded-t-xl rounded-b-md border-t-2 border-slate-50 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:"text-slate-400 font-black text-2xl opacity-40 translate-y-1",children:"2"}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:"block text-[12px] font-bold text-[#0a1628]",children:"You"}),e.jsx("span",{className:"block text-[10px] text-sky-600 font-bold",children:"2.1k XP"})]})]}),e.jsxs("div",{className:"flex flex-col items-center relative z-20 -mx-2",children:[e.jsxs(r.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.7},className:"relative mb-2",children:[e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(m,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("img",{src:"https://i.pravatar.cc/150?img=68",alt:"Alex",className:"w-[52px] h-[52px] rounded-full border-[3px] border-amber-400 z-10 relative object-cover shadow-md bg-white"}),e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-amber-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"1"})]}),e.jsxs(r.div,{initial:{height:0},animate:{height:"74px"},transition:{delay:.6,duration:.5,ease:"easeOut"},className:"w-[78px] bg-gradient-to-b from-amber-100 to-amber-50 rounded-t-xl rounded-b-md border-t-2 border-amber-50 flex items-center justify-center relative shadow-[inset_0_-4px_8px_rgba(251,191,36,0.1),0_6px_8px_rgba(0,0,0,0.05)]",children:[e.jsx("span",{className:"text-amber-400 font-black text-3xl opacity-50 translate-y-1",children:"1"}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/80 rounded-t-xl"})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:"block text-[13px] font-black text-[#0a1628]",children:"Alex M."}),e.jsx("span",{className:"block text-[11px] text-amber-600 font-bold",children:"2.4k XP"})]})]}),e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsxs(r.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.6},className:"relative mb-2",children:[e.jsx("img",{src:"https://i.pravatar.cc/150?img=47",alt:"Sarah",className:"w-10 h-10 rounded-full border-[3px] border-orange-400 z-10 relative object-cover shadow-sm bg-white"}),e.jsx("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 bg-orange-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm",children:"3"})]}),e.jsxs(r.div,{initial:{height:0},animate:{height:"38px"},transition:{delay:.5,duration:.5,ease:"easeOut"},className:"w-[70px] bg-gradient-to-b from-orange-50 to-slate-50 rounded-t-xl rounded-b-md border-t-2 border-orange-100 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(249,115,22,0.05),0_4px_6px_rgba(0,0,0,0.02)]",children:[e.jsx("span",{className:"text-orange-400/60 font-black text-2xl opacity-60 translate-y-1",children:"3"}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:"block text-[12px] font-bold text-[#0a1628]",children:"Sarah K."}),e.jsx("span",{className:"block text-[10px] text-orange-600 font-bold",children:"1.9k XP"})]})]})]})]})]})};export{X as default};
assets/{ScientificCalculator-BP-XvW_h.js β†’ ScientificCalculator-B0rqpddr.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as c,j as e}from"./vendor-react-Dexh7fmo.js";import{apiService as de}from"./apiService-BuaHZ1Ho.js";import{c as Z,e as U,m as ue}from"./index-DGWrSMOK.js";import{C as fe,a as pe}from"./chevron-up-BJyzaJs7.js";import{X as be}from"./x-Bj25rnWX.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.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-Dexh7fmo.js";import{apiService as de}from"./apiService-ZZIWaV70.js";import{c as Z,e as U,m as ue}from"./index-CmBdDSkw.js";import{C as fe,a as pe}from"./chevron-up-CwQX0CFg.js";import{X as be}from"./x-BDSBB3q9.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{SearchBar-DYN0WTzx.js β†’ SearchBar-CzmZ03BX.js} RENAMED
@@ -1 +1 @@
1
- import{r as o,j as e}from"./vendor-react-Dexh7fmo.js";import{S as m}from"./search-O5gEqRZi.js";import{m as n,e as C}from"./index-DGWrSMOK.js";import{X as k}from"./x-Bj25rnWX.js";import{C as S}from"./clock-qHFbMxrB.js";import{B as a}from"./book-open-B5Xvd1JL.js";import{T as c}from"./trending-up-B2MPUPwk.js";import{U as d}from"./users-BRS21lR4.js";import{G}from"./graduation-cap-Cr-ek4Bs.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const K=({placeholder:b="Search anything...",userRole:p="student",onSelect:y})=>{const[i,l]=o.useState(""),[g,r]=o.useState(!1),[x,f]=o.useState([]),u=o.useRef(null),v=()=>p==="student"?[{id:"1",type:"module",title:"General Mathematics",subtitle:"Grade 11 β€’ Functions & Business Math",icon:a},{id:"2",type:"module",title:"Statistics & Probability",subtitle:"Grade 11 β€’ Distributions & Testing",icon:a},{id:"3",type:"module",title:"Pre-Calculus",subtitle:"Grade 12 β€’ Analytic Geometry & Trig",icon:a},{id:"4",type:"module",title:"Basic Calculus",subtitle:"Grade 12 β€’ Limits & Derivatives",icon:a},{id:"5",type:"page",title:"AI Chat",subtitle:"Get help from AI tutor",icon:c},{id:"6",type:"page",title:"My Progress",subtitle:"View your achievements",icon:c}]:p==="teacher"?[{id:"1",type:"student",title:"Alex Johnson",subtitle:"Grade 11 β€’ Level 12",icon:d},{id:"2",type:"student",title:"Sarah Williams",subtitle:"Grade 12 β€’ Level 11",icon:d},{id:"3",type:"module",title:"Gen Math Quiz 5",subtitle:"12 submissions",icon:a},{id:"4",type:"page",title:"Analytics",subtitle:"Class performance overview",icon:c},{id:"5",type:"page",title:"Create Assignment",subtitle:"New homework or quiz",icon:a}]:[{id:"1",type:"teacher",title:"Prof. Anderson",subtitle:"48 students β€’ Math Dept",icon:G},{id:"2",type:"student",title:"Alex Johnson",subtitle:"Top Performer β€’ Level 12",icon:d},{id:"3",type:"page",title:"System Settings",subtitle:"Platform configuration",icon:c},{id:"4",type:"page",title:"Reports",subtitle:"Export analytics",icon:a},{id:"5",type:"page",title:"User Management",subtitle:"Manage accounts",icon:d}],w=["Functions and Relations","Normal Distribution","AI Chat"];o.useEffect(()=>{if(i.trim()){const s=v().filter(h=>h.title.toLowerCase().includes(i.toLowerCase())||h.subtitle?.toLowerCase().includes(i.toLowerCase()));f(s)}else f([])},[i]);const j=t=>{l(""),r(!1),y?.(t)},N=()=>{l(""),u.current?.focus()};return o.useEffect(()=>{const t=s=>{s.ctrlKey&&s.key.toLowerCase()==="k"&&(s.preventDefault(),u.current?.focus(),r(!0))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),e.jsxs("div",{className:"relative w-full max-w-xl",children:[e.jsxs("div",{className:"relative",children:[e.jsx(m,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-500",size:18}),e.jsx("input",{ref:u,id:"global-search",name:"global-search","aria-label":"Search anything",type:"text",value:i,onChange:t=>l(t.target.value),onFocus:()=>r(!0),placeholder:b,className:"w-full pl-11 pr-24 py-2.5 bg-white border border-[#dde3eb] rounded-lg text-[#0a1628] placeholder-[#a8a5b3] font-body text-sm focus:bg-white focus:border-sky-400 focus:ring-2 focus:ring-sky-400/15 focus:outline-none transition-all"}),e.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[i&&e.jsx(n.button,{initial:{scale:0},animate:{scale:1},exit:{scale:0},whileHover:{scale:1.1},whileTap:{scale:.9},onClick:N,className:"p-1.5 text-slate-500 hover:text-[#5a6578] hover:bg-[#edf1f7] rounded-md transition-colors",children:e.jsx(k,{size:14})}),e.jsx("kbd",{className:"hidden sm:inline-flex px-2 py-0.5 text-[10px] font-body font-semibold text-slate-500 bg-[#edf1f7] border border-[#dde3eb] rounded-md",children:"Ctrl+K"})]})]}),e.jsx(C,{children:g&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),e.jsx(n.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"absolute top-full left-0 right-0 mt-2 bg-white rounded-xl shadow-lg border border-[#dde3eb] z-50 overflow-hidden max-h-96 overflow-y-auto",children:i.trim()?x.length>0?e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"px-3 py-2 text-[10px] font-body font-semibold text-slate-500 uppercase tracking-wider",children:"Results"}),x.map(t=>{const s=t.icon||m;return e.jsxs(n.button,{whileHover:{backgroundColor:"rgba(248, 247, 244, 1)"},onClick:()=>j(t),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors",children:[e.jsx("div",{className:"w-9 h-9 bg-sky-500/10 rounded-lg flex items-center justify-center text-sky-600 flex-shrink-0",children:e.jsx(s,{size:16})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"text-sm font-body font-semibold text-[#0a1628] truncate",children:t.title}),t.subtitle&&e.jsx("p",{className:"text-xs font-body text-[#5a6578] truncate",children:t.subtitle})]})]},t.id)})]}):e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(m,{size:40,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] font-body text-sm",children:"No results found"}),e.jsx("p",{className:"text-slate-500 font-body text-xs mt-1",children:"Try a different search term"})]}):e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"px-3 py-2 text-[10px] font-body font-semibold text-slate-500 uppercase tracking-wider",children:"Recent Searches"}),w.map((t,s)=>e.jsxs(n.button,{whileHover:{backgroundColor:"rgba(248, 247, 244, 1)"},onClick:()=>l(t),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors",children:[e.jsx(S,{size:16,className:"text-slate-500 flex-shrink-0"}),e.jsx("span",{className:"text-sm font-body text-[#0a1628]",children:t})]},s))]})})]})})]})};export{K as default};
 
1
+ import{r as o,j as e}from"./vendor-react-Dexh7fmo.js";import{S as m}from"./search-zqCwfHe1.js";import{m as n,e as C}from"./index-CmBdDSkw.js";import{X as k}from"./x-BDSBB3q9.js";import{C as S}from"./clock-jSWTKlqH.js";import{B as a}from"./book-open-BH_yilLK.js";import{T as c}from"./trending-up-6u76yy2e.js";import{U as d}from"./users-CdMqBLwG.js";import{G}from"./graduation-cap-BxtuU7H1.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const K=({placeholder:b="Search anything...",userRole:p="student",onSelect:y})=>{const[i,l]=o.useState(""),[g,r]=o.useState(!1),[x,f]=o.useState([]),u=o.useRef(null),v=()=>p==="student"?[{id:"1",type:"module",title:"General Mathematics",subtitle:"Grade 11 β€’ Functions & Business Math",icon:a},{id:"2",type:"module",title:"Statistics & Probability",subtitle:"Grade 11 β€’ Distributions & Testing",icon:a},{id:"3",type:"module",title:"Pre-Calculus",subtitle:"Grade 12 β€’ Analytic Geometry & Trig",icon:a},{id:"4",type:"module",title:"Basic Calculus",subtitle:"Grade 12 β€’ Limits & Derivatives",icon:a},{id:"5",type:"page",title:"AI Chat",subtitle:"Get help from AI tutor",icon:c},{id:"6",type:"page",title:"My Progress",subtitle:"View your achievements",icon:c}]:p==="teacher"?[{id:"1",type:"student",title:"Alex Johnson",subtitle:"Grade 11 β€’ Level 12",icon:d},{id:"2",type:"student",title:"Sarah Williams",subtitle:"Grade 12 β€’ Level 11",icon:d},{id:"3",type:"module",title:"Gen Math Quiz 5",subtitle:"12 submissions",icon:a},{id:"4",type:"page",title:"Analytics",subtitle:"Class performance overview",icon:c},{id:"5",type:"page",title:"Create Assignment",subtitle:"New homework or quiz",icon:a}]:[{id:"1",type:"teacher",title:"Prof. Anderson",subtitle:"48 students β€’ Math Dept",icon:G},{id:"2",type:"student",title:"Alex Johnson",subtitle:"Top Performer β€’ Level 12",icon:d},{id:"3",type:"page",title:"System Settings",subtitle:"Platform configuration",icon:c},{id:"4",type:"page",title:"Reports",subtitle:"Export analytics",icon:a},{id:"5",type:"page",title:"User Management",subtitle:"Manage accounts",icon:d}],w=["Functions and Relations","Normal Distribution","AI Chat"];o.useEffect(()=>{if(i.trim()){const s=v().filter(h=>h.title.toLowerCase().includes(i.toLowerCase())||h.subtitle?.toLowerCase().includes(i.toLowerCase()));f(s)}else f([])},[i]);const j=t=>{l(""),r(!1),y?.(t)},N=()=>{l(""),u.current?.focus()};return o.useEffect(()=>{const t=s=>{s.ctrlKey&&s.key.toLowerCase()==="k"&&(s.preventDefault(),u.current?.focus(),r(!0))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),e.jsxs("div",{className:"relative w-full max-w-xl",children:[e.jsxs("div",{className:"relative",children:[e.jsx(m,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-500",size:18}),e.jsx("input",{ref:u,id:"global-search",name:"global-search","aria-label":"Search anything",type:"text",value:i,onChange:t=>l(t.target.value),onFocus:()=>r(!0),placeholder:b,className:"w-full pl-11 pr-24 py-2.5 bg-white border border-[#dde3eb] rounded-lg text-[#0a1628] placeholder-[#a8a5b3] font-body text-sm focus:bg-white focus:border-sky-400 focus:ring-2 focus:ring-sky-400/15 focus:outline-none transition-all"}),e.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[i&&e.jsx(n.button,{initial:{scale:0},animate:{scale:1},exit:{scale:0},whileHover:{scale:1.1},whileTap:{scale:.9},onClick:N,className:"p-1.5 text-slate-500 hover:text-[#5a6578] hover:bg-[#edf1f7] rounded-md transition-colors",children:e.jsx(k,{size:14})}),e.jsx("kbd",{className:"hidden sm:inline-flex px-2 py-0.5 text-[10px] font-body font-semibold text-slate-500 bg-[#edf1f7] border border-[#dde3eb] rounded-md",children:"Ctrl+K"})]})]}),e.jsx(C,{children:g&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r(!1)}),e.jsx(n.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:"absolute top-full left-0 right-0 mt-2 bg-white rounded-xl shadow-lg border border-[#dde3eb] z-50 overflow-hidden max-h-96 overflow-y-auto",children:i.trim()?x.length>0?e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"px-3 py-2 text-[10px] font-body font-semibold text-slate-500 uppercase tracking-wider",children:"Results"}),x.map(t=>{const s=t.icon||m;return e.jsxs(n.button,{whileHover:{backgroundColor:"rgba(248, 247, 244, 1)"},onClick:()=>j(t),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors",children:[e.jsx("div",{className:"w-9 h-9 bg-sky-500/10 rounded-lg flex items-center justify-center text-sky-600 flex-shrink-0",children:e.jsx(s,{size:16})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"text-sm font-body font-semibold text-[#0a1628] truncate",children:t.title}),t.subtitle&&e.jsx("p",{className:"text-xs font-body text-[#5a6578] truncate",children:t.subtitle})]})]},t.id)})]}):e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(m,{size:40,className:"text-[#d1cec6] mx-auto mb-3"}),e.jsx("p",{className:"text-[#5a6578] font-body text-sm",children:"No results found"}),e.jsx("p",{className:"text-slate-500 font-body text-xs mt-1",children:"Try a different search term"})]}):e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"px-3 py-2 text-[10px] font-body font-semibold text-slate-500 uppercase tracking-wider",children:"Recent Searches"}),w.map((t,s)=>e.jsxs(n.button,{whileHover:{backgroundColor:"rgba(248, 247, 244, 1)"},onClick:()=>l(t),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-lg text-left transition-colors",children:[e.jsx(S,{size:16,className:"text-slate-500 flex-shrink-0"}),e.jsx("span",{className:"text-sm font-body text-[#0a1628]",children:t})]},s))]})})]})})]})};export{K as default};
assets/{SettingsModal-BFFZzSRx.js β†’ SettingsModal-Ct0cXLCK.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as i,j as e}from"./vendor-react-Dexh7fmo.js";import{c as ee,e as be,m as S,D as ue,t as c}from"./index-DGWrSMOK.js";import{B as x}from"./button-DWdPuxDU.js";import{I as l}from"./input-DBkKXOmF.js";import{S as m}from"./switch-DbjIWZtF.js";import W from"./ConfirmModal-B9CUrvQP.js";import{U as fe}from"./user-Br5UzORP.js";import{B as pe}from"./bell-DeNrtKrI.js";import{S as ye}from"./shield-Cin8984_.js";import{G as je}from"./globe-CA6LY_zw.js";import{D as Y}from"./download-DINpalm9.js";import{X as Z}from"./x-Bj25rnWX.js";import{L as ge}from"./lock-C6XEepuP.js";import{C as Ne}from"./clock-qHFbMxrB.js";import{T as ve}from"./trash-2-CBQVcuBL.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-radix-B-ht8aK0.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./log-out-DYYu4gFF.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-Dexh7fmo.js";import{c as ee,e as be,m as S,D as ue,t as c}from"./index-CmBdDSkw.js";import{B as x}from"./button-BP5cklmU.js";import{I as l}from"./input-DBkKXOmF.js";import{S as m}from"./switch-CISoEIXM.js";import W from"./ConfirmModal-BO6r5veY.js";import{U as fe}from"./user-C4mm1EOG.js";import{B as pe}from"./bell-B1VXtbbh.js";import{S as ye}from"./shield-B-mvw6Dl.js";import{G as je}from"./globe-ZtrF4mgA.js";import{D as Y}from"./download-DMZBRA1T.js";import{X as Z}from"./x-BDSBB3q9.js";import{L as ge}from"./lock-Dt6Po_Oi.js";import{C as Ne}from"./clock-jSWTKlqH.js";import{T as ve}from"./trash-2-BGLuKCox.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-radix-CxzAJozq.js";import"./clsx-B-dksMZM.js";import"./utils-BQQgILNW.js";import"./log-out-QZHYEhcR.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{Sidebar-BH3yU0R9.js β†’ Sidebar-oxQVx2NC.js} RENAMED
@@ -1 +1 @@
1
- import{r as m,j as e}from"./vendor-react-Dexh7fmo.js";import{C as O,S,a as $,L as f}from"./LogoutActionButton-D-8gok3U.js";import{c as D}from"./utils-BQQgILNW.js";import{T as k,a as L,b as M}from"./tooltip-D9lDiW9U.js";import{m as c}from"./index-DGWrSMOK.js";import{X as G}from"./x-Bj25rnWX.js";import{C as P}from"./chevron-right-DxXkA9aZ.js";import{U as C}from"./users-BRS21lR4.js";import{B as u}from"./book-open-B5Xvd1JL.js";import{C as T}from"./chart-column-CJzwyNMx.js";import{S as U}from"./shield-Cin8984_.js";import{M as F}from"./message-square-DIXhbelM.js";import{G as Q}from"./graduation-cap-Cr-ek4Bs.js";import{S as W}from"./swords-Bn50CmyM.js";import{T as X}from"./trophy-73YPSH67.js";import{S as _}from"./shirt-C4Gsu12G.js";import"./log-out-DYYu4gFF.js";import"./clsx-B-dksMZM.js";import"./vendor-radix-B-ht8aK0.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const ge=({activeTab:b,setActiveTab:A,userRole:x="student",onOpenSettings:g,onLogout:j,sidebarCollapsed:o=!1,setSidebarCollapsed:v,mode:E="desktop",onRequestClose:y,forceCollapsed:i=!1})=>{const[z,h]=m.useState(!1),[w,t]=m.useState(null),n=E==="mobile",r=!i&&z,p=typeof g=="function",a=!n&&(i||o&&!r),l=a,H=!n&&!i;m.useEffect(()=>{i&&(h(!1),t(null))},[i]),m.useEffect(()=>{l||t(null)},[l]);const I=x==="admin"?[{label:"Management",items:[{icon:f,label:"Overview"},{icon:C,label:"User Management"},{icon:u,label:"Content"}]},{label:"Insights",items:[{icon:T,label:"Analytics"},{icon:U,label:"Audit Log"},{icon:S,label:"Settings"}]}]:x==="teacher"?[{label:"Teaching",items:[{icon:f,label:"Dashboard"},{icon:C,label:"My Students"},{icon:u,label:"Classes"}]},{label:"Insights",items:[{icon:T,label:"Analytics"}]}]:[{label:"Learn",items:[{icon:f,label:"Dashboard"},{icon:u,label:"Modules"},{icon:F,label:"AI Chat"}]},{label:"Progress",items:[{icon:Q,label:"Grades",displayLabel:"Assessment"},{icon:W,label:"Quiz Battle",displayLabel:"Quiz Battle"},{icon:X,label:"Leaderboard",displayLabel:"Leadership Board"}]},{label:"Customization",items:[{icon:_,label:"Avatar Studio",displayLabel:"Avatar Studio"}]}];return e.jsxs(c.aside,{initial:!1,animate:n?{width:280}:{width:a?80:280},transition:{type:"spring",stiffness:360,damping:34},onMouseEnter:()=>H&&o&&h(!0),onMouseLeave:()=>{h(!1),t(null)},className:D("h-full bg-[#f7f9fc] border border-[#dde3eb] shadow-sm flex flex-col",n?"rounded-2xl p-4":"rounded-3xl p-5"),children:[e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:`mb-8 flex items-center ${a?"justify-center":"justify-between"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:"/mathpulse_logo.png",alt:"MathPulse AI",className:"w-12 h-12 object-contain drop-shadow-md flex-shrink-0"}),(!a||r)&&e.jsx("div",{children:e.jsx("h2",{className:"text-base font-bold font-display text-[#0a1628] whitespace-nowrap",children:"MathPulse AI"})})]}),n&&y&&e.jsx("button",{onClick:y,className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":"Close navigation",children:e.jsx(G,{size:20})}),!n&&!i&&v&&(!o||r)&&e.jsx(c.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>v(!o),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":o?"Expand sidebar":"Collapse sidebar",title:o?"Expand sidebar":"Collapse sidebar",children:o?e.jsx(P,{size:20}):e.jsx(O,{size:20})})]}),e.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto space-y-5 pr-1",children:I.map((d,B)=>e.jsxs("div",{children:[a?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):d.label&&e.jsx("p",{className:"px-4 mb-2 text-[10px] font-bold text-[#5a6578] uppercase tracking-widest",children:d.label}),e.jsx("div",{className:"space-y-1",children:d.items.map(s=>e.jsxs(k,{open:l&&w===s.label,children:[e.jsx(L,{asChild:!0,children:e.jsxs(c.button,{whileHover:{x:2},whileTap:{scale:.98},onMouseEnter:()=>{l&&t(s.label)},onMouseLeave:()=>{t(N=>N===s.label?null:N)},onFocus:()=>t(null),onClick:()=>A(s.label),className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl cursor-pointer transition-all duration-200 border whitespace-nowrap ${a?"justify-center":""} ${b===s.label?"bg-sky-50 border-sky-200 shadow-sm text-sky-700":"bg-transparent border-transparent text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628]"}`,children:[e.jsx(s.icon,{size:18,strokeWidth:b===s.label?2.5:2,className:"flex-shrink-0"}),(!a||r)&&e.jsx("span",{className:"font-body font-bold text-xs",children:s.displayLabel||s.label}),b===s.label&&(!a||r)&&e.jsx(c.div,{layoutId:"sidebar-active-indicator",className:"ml-auto w-2 h-2 rounded-full bg-sky-500",transition:{type:"spring",duration:.4}})]})}),l&&e.jsx(M,{side:"right",sideOffset:16,className:"font-bold text-xs",children:s.displayLabel||s.label})]},s.label))})]},B))})]}),e.jsxs("div",{className:"mt-4 space-y-2 border-t border-[#dde3eb] pt-4",children:[x!=="admin"?e.jsxs(k,{open:l&&w==="Settings",children:[e.jsx(L,{asChild:!0,children:e.jsxs(c.button,{whileHover:{x:2},whileTap:{scale:.98},onMouseEnter:()=>{l&&t("Settings")},onMouseLeave:()=>{t(d=>d==="Settings"?null:d)},onFocus:()=>t(null),className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl font-bold border transition-all duration-200 whitespace-nowrap ${a?"justify-center":""} ${b==="Settings"?"bg-sky-50 border-sky-200 text-sky-700 shadow-sm":p?"border-transparent text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628]":"border-transparent text-[#a0aec0] cursor-not-allowed opacity-60"}`,onClick:p?g:void 0,disabled:!p,"aria-disabled":!p,"aria-label":"Open settings",children:[e.jsx(S,{size:18,strokeWidth:2,className:"flex-shrink-0"}),(!a||r)&&e.jsx("span",{className:"font-body text-xs",children:"Settings"})]})}),l&&e.jsx(M,{side:"right",sideOffset:16,className:"font-bold text-xs",children:"Settings"})]}):null,j&&e.jsx("div",{className:"text-[#5a6578]",children:e.jsx($,{onClick:j,collapsed:a})})]})]})};export{ge as default};
 
1
+ import{r as m,j as e}from"./vendor-react-Dexh7fmo.js";import{C as O,S,a as $,L as f}from"./LogoutActionButton-TpO-by05.js";import{c as D}from"./utils-BQQgILNW.js";import{T as k,a as L,b as M}from"./tooltip-Bn7-0zmi.js";import{m as c}from"./index-CmBdDSkw.js";import{X as G}from"./x-BDSBB3q9.js";import{C as P}from"./chevron-right-BSCyuP_x.js";import{U as C}from"./users-CdMqBLwG.js";import{B as u}from"./book-open-BH_yilLK.js";import{C as T}from"./chart-column-DzJCKCOe.js";import{S as U}from"./shield-B-mvw6Dl.js";import{M as F}from"./message-square-BxgAV6zJ.js";import{G as Q}from"./graduation-cap-BxtuU7H1.js";import{S as W}from"./swords-CJyIL97F.js";import{T as X}from"./trophy-DrL6Ph2J.js";import{S as _}from"./shirt-CHOJLYIJ.js";import"./log-out-QZHYEhcR.js";import"./clsx-B-dksMZM.js";import"./vendor-radix-CxzAJozq.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const ge=({activeTab:b,setActiveTab:A,userRole:x="student",onOpenSettings:g,onLogout:j,sidebarCollapsed:o=!1,setSidebarCollapsed:v,mode:E="desktop",onRequestClose:y,forceCollapsed:i=!1})=>{const[z,h]=m.useState(!1),[w,t]=m.useState(null),n=E==="mobile",r=!i&&z,p=typeof g=="function",a=!n&&(i||o&&!r),l=a,H=!n&&!i;m.useEffect(()=>{i&&(h(!1),t(null))},[i]),m.useEffect(()=>{l||t(null)},[l]);const I=x==="admin"?[{label:"Management",items:[{icon:f,label:"Overview"},{icon:C,label:"User Management"},{icon:u,label:"Content"}]},{label:"Insights",items:[{icon:T,label:"Analytics"},{icon:U,label:"Audit Log"},{icon:S,label:"Settings"}]}]:x==="teacher"?[{label:"Teaching",items:[{icon:f,label:"Dashboard"},{icon:C,label:"My Students"},{icon:u,label:"Classes"}]},{label:"Insights",items:[{icon:T,label:"Analytics"}]}]:[{label:"Learn",items:[{icon:f,label:"Dashboard"},{icon:u,label:"Modules"},{icon:F,label:"AI Chat"}]},{label:"Progress",items:[{icon:Q,label:"Grades",displayLabel:"Assessment"},{icon:W,label:"Quiz Battle",displayLabel:"Quiz Battle"},{icon:X,label:"Leaderboard",displayLabel:"Leadership Board"}]},{label:"Customization",items:[{icon:_,label:"Avatar Studio",displayLabel:"Avatar Studio"}]}];return e.jsxs(c.aside,{initial:!1,animate:n?{width:280}:{width:a?80:280},transition:{type:"spring",stiffness:360,damping:34},onMouseEnter:()=>H&&o&&h(!0),onMouseLeave:()=>{h(!1),t(null)},className:D("h-full bg-[#f7f9fc] border border-[#dde3eb] shadow-sm flex flex-col",n?"rounded-2xl p-4":"rounded-3xl p-5"),children:[e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:`mb-8 flex items-center ${a?"justify-center":"justify-between"}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:"/mathpulse_logo.png",alt:"MathPulse AI",className:"w-12 h-12 object-contain drop-shadow-md flex-shrink-0"}),(!a||r)&&e.jsx("div",{children:e.jsx("h2",{className:"text-base font-bold font-display text-[#0a1628] whitespace-nowrap",children:"MathPulse AI"})})]}),n&&y&&e.jsx("button",{onClick:y,className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":"Close navigation",children:e.jsx(G,{size:20})}),!n&&!i&&v&&(!o||r)&&e.jsx(c.button,{whileHover:{scale:1.1},whileTap:{scale:.95},onClick:()=>v(!o),className:"p-2 hover:bg-[#dde3eb] rounded-lg transition-colors text-[#5a6578]","aria-label":o?"Expand sidebar":"Collapse sidebar",title:o?"Expand sidebar":"Collapse sidebar",children:o?e.jsx(P,{size:20}):e.jsx(O,{size:20})})]}),e.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto space-y-5 pr-1",children:I.map((d,B)=>e.jsxs("div",{children:[a?e.jsx("div",{className:"px-4 mb-2 flex items-center gap-2",children:e.jsx("div",{className:"flex-1 h-[1px] bg-[#dde3eb]"})}):d.label&&e.jsx("p",{className:"px-4 mb-2 text-[10px] font-bold text-[#5a6578] uppercase tracking-widest",children:d.label}),e.jsx("div",{className:"space-y-1",children:d.items.map(s=>e.jsxs(k,{open:l&&w===s.label,children:[e.jsx(L,{asChild:!0,children:e.jsxs(c.button,{whileHover:{x:2},whileTap:{scale:.98},onMouseEnter:()=>{l&&t(s.label)},onMouseLeave:()=>{t(N=>N===s.label?null:N)},onFocus:()=>t(null),onClick:()=>A(s.label),className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl cursor-pointer transition-all duration-200 border whitespace-nowrap ${a?"justify-center":""} ${b===s.label?"bg-sky-50 border-sky-200 shadow-sm text-sky-700":"bg-transparent border-transparent text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628]"}`,children:[e.jsx(s.icon,{size:18,strokeWidth:b===s.label?2.5:2,className:"flex-shrink-0"}),(!a||r)&&e.jsx("span",{className:"font-body font-bold text-xs",children:s.displayLabel||s.label}),b===s.label&&(!a||r)&&e.jsx(c.div,{layoutId:"sidebar-active-indicator",className:"ml-auto w-2 h-2 rounded-full bg-sky-500",transition:{type:"spring",duration:.4}})]})}),l&&e.jsx(M,{side:"right",sideOffset:16,className:"font-bold text-xs",children:s.displayLabel||s.label})]},s.label))})]},B))})]}),e.jsxs("div",{className:"mt-4 space-y-2 border-t border-[#dde3eb] pt-4",children:[x!=="admin"?e.jsxs(k,{open:l&&w==="Settings",children:[e.jsx(L,{asChild:!0,children:e.jsxs(c.button,{whileHover:{x:2},whileTap:{scale:.98},onMouseEnter:()=>{l&&t("Settings")},onMouseLeave:()=>{t(d=>d==="Settings"?null:d)},onFocus:()=>t(null),className:`w-full flex items-center gap-3 px-4 py-3 rounded-2xl font-bold border transition-all duration-200 whitespace-nowrap ${a?"justify-center":""} ${b==="Settings"?"bg-sky-50 border-sky-200 text-sky-700 shadow-sm":p?"border-transparent text-[#5a6578] hover:bg-[#dde3eb] hover:border-[#dde3eb] hover:text-[#0a1628]":"border-transparent text-[#a0aec0] cursor-not-allowed opacity-60"}`,onClick:p?g:void 0,disabled:!p,"aria-disabled":!p,"aria-label":"Open settings",children:[e.jsx(S,{size:18,strokeWidth:2,className:"flex-shrink-0"}),(!a||r)&&e.jsx("span",{className:"font-body text-xs",children:"Settings"})]})}),l&&e.jsx(M,{side:"right",sideOffset:16,className:"font-bold text-xs",children:"Settings"})]}):null,j&&e.jsx("div",{className:"text-[#5a6578]",children:e.jsx($,{onClick:j,collapsed:a})})]})]})};export{ge as default};
assets/{SupplementalBanner-COM6ABNZ.js β†’ SupplementalBanner-CaXzjH7M.js} RENAMED
@@ -1 +1 @@
1
- import{j as e,r as y}from"./vendor-react-Dexh7fmo.js";import{e as j,m as p,T as h}from"./index-DGWrSMOK.js";import{X as v}from"./x-Bj25rnWX.js";import{S as w}from"./sparkles-DxmNHQEo.js";import{C as f}from"./chevron-right-DxXkA9aZ.js";import{B as g}from"./book-open-B5Xvd1JL.js";import{T as m}from"./trending-up-B2MPUPwk.js";import{B as x}from"./brain-DHmY5cbv.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.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(g,{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]=y.useState(!1);if(l||i.length===0)return null;const r=()=>{a(!0),n?.()};return e.jsx(j,{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(f,{size:16})]})]})]})]})})})},C=({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))})]})})},z=({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(g,{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:["Open Practice Center",e.jsx(f,{size:12})]})]})]})})})},I=i=>{switch(i.variant){case"compact":return e.jsx(C,{...i});case"results":return e.jsx(z,{...i});case"full":default:return e.jsx(k,{...i})}};export{I as default};
 
1
+ import{j as e,r as y}from"./vendor-react-Dexh7fmo.js";import{e as j,m as p,T as h}from"./index-CmBdDSkw.js";import{X as v}from"./x-BDSBB3q9.js";import{S as w}from"./sparkles-D6B_TX7M.js";import{C as f}from"./chevron-right-BSCyuP_x.js";import{B as g}from"./book-open-BH_yilLK.js";import{T as m}from"./trending-up-6u76yy2e.js";import{B as x}from"./brain-DfMjTiNx.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.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(g,{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]=y.useState(!1);if(l||i.length===0)return null;const r=()=>{a(!0),n?.()};return e.jsx(j,{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(f,{size:16})]})]})]})]})})})},C=({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))})]})})},z=({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(g,{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:["Open Practice Center",e.jsx(f,{size:12})]})]})]})})})},I=i=>{switch(i.variant){case"compact":return e.jsx(C,{...i});case"results":return e.jsx(z,{...i});case"full":default:return e.jsx(k,{...i})}};export{I as default};
assets/{TeacherDashboard-CtdIzfjb.js β†’ TeacherDashboard-CXY2X8Up.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{r as d,j as e,c as be}from"./vendor-react-Dexh7fmo.js";import{B as ve}from"./button-DWdPuxDU.js";import{I as Ue}from"./input-DBkKXOmF.js";import Vr from"./ConfirmModal-B9CUrvQP.js";import{C as St,L as Yr,S as Hr,a as Wr}from"./LogoutActionButton-D-8gok3U.js";import{c as lt,d as ke,e as rt,m as ce,Z as Ka,u as Rt,t as Y,C as Kr,T as yt,g as fa,f as Jr,h as Xr,B as Zr,i as en,M as tn}from"./index-DGWrSMOK.js";import{e as We,q as qe,l as Ja,w as Ve,h as Ze,o as sn,f as Xa,s as Je,d as Fe,u as Xe,b as pt,a as ze,c as an}from"./vendor-firebase-firestore-CkuVbeP5.js";import{apiService as pe,ApiError as Ds}from"./apiService-BuaHZ1Ho.js";import{G as $s}from"./graduation-cap-Cr-ek4Bs.js";import{X as Dt}from"./x-Bj25rnWX.js";import{B as Za}from"./brain-DHmY5cbv.js";import{B as es}from"./book-open-B5Xvd1JL.js";import{s as pa,f as rn,L as nn,d as on,a as ln,p as cn,b as dn}from"./quizService-BkrCeM05.js";import{L as Le}from"./loader-circle-BUf2fYcT.js";import{E as hs}from"./eye-pSTVqBYO.js";import{S as zt}from"./send-nCgvy9cZ.js";import{T as er}from"./trash-2-CBQVcuBL.js";import{C as Ss}from"./circle-alert-D8UKyVHS.js";import{M as ga}from"./minus-BjTBUAx2.js";import{P as $t}from"./plus-DVCmopn-.js";import{C as Ut}from"./check-BONc3QkK.js";import{F as Ps,I as qt,R as mn,D as un,a as xn,b as hn,c as fn,d as pn,T as gn,e as bn,f as vn,V as yn}from"./dialog-C0Vo-dln.js";import{C as jt}from"./chart-column-CJzwyNMx.js";import{C as jn,S as q}from"./skeleton-DgVR4gS7.js";import{D as Fs}from"./download-DINpalm9.js";import{S as Nn}from"./sparkles-DxmNHQEo.js";import{S as tr}from"./save-B5SCmCsP.js";import{T as Os}from"./trending-up-B2MPUPwk.js";import{U as Yt}from"./users-BRS21lR4.js";import{S as ts}from"./search-O5gEqRZi.js";import{C as Ht,a as nt}from"./chevron-up-BJyzaJs7.js";import{S as ba,g as wn,G as kn,s as va}from"./subjects-DDYtJwQO.js";import{C as sr}from"./circle-check-big-mv2CRLCE.js";import{E as Sn}from"./eye-off-DCr0gD8u.js";import{U as ya}from"./user-Br5UzORP.js";import{C as _t}from"./chevron-right-DxXkA9aZ.js";import{A as Cn}from"./award-DpLN2BvV.js";import ar from"./ChatMarkdown-BI4vbcO7.js";import{B as Wt}from"./bell-DeNrtKrI.js";import{C as Tn}from"./check-check-BDU3hkDf.js";import{C as rr}from"./clock-qHFbMxrB.js";import{M as In}from"./message-square-DIXhbelM.js";import{T as Ln}from"./trophy-73YPSH67.js";import{T as Mn}from"./target-7Gevl8jn.js";import{C as An}from"./calendar-19p2TrVX.js";import{g as En,i as _e,G as zn,a as fs,m as Dn,b as ot,T as $n,s as ps,f as ft,c as ja,L as Na,d as Pn,e as Fn,u as Rs,h as _s,j as On,k as Rn,l as _n,w as wa,n as nr,o as ss,p as Bn,q as Gn,r as Qn,B as Cs,t as Un,R as ka,v as Sa,C as qn}from"./generateCategoricalChart-CiUYzAvW.js";import{c as gt}from"./clsx-B-dksMZM.js";import{P as or}from"./pen-line-CX1xh2Q2.js";import"./vendor-radix-B-ht8aK0.js";import"./utils-BQQgILNW.js";import"./log-out-DYYu4gFF.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-markdown-C5ikSDMA.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{r as d,j as e,c as be}from"./vendor-react-Dexh7fmo.js";import{B as ve}from"./button-BP5cklmU.js";import{I as Ue}from"./input-DBkKXOmF.js";import Vr from"./ConfirmModal-BO6r5veY.js";import{C as St,L as Yr,S as Hr,a as Wr}from"./LogoutActionButton-TpO-by05.js";import{c as lt,d as ke,e as rt,m as ce,Z as Ka,u as Rt,t as Y,C as Kr,T as yt,g as fa,f as Jr,h as Xr,B as Zr,i as en,M as tn}from"./index-CmBdDSkw.js";import{e as We,q as qe,l as Ja,w as Ve,h as Ze,o as sn,f as Xa,s as Je,d as Fe,u as Xe,b as pt,a as ze,c as an}from"./vendor-firebase-firestore-CkuVbeP5.js";import{apiService as pe,ApiError as Ds}from"./apiService-ZZIWaV70.js";import{G as $s}from"./graduation-cap-BxtuU7H1.js";import{X as Dt}from"./x-BDSBB3q9.js";import{B as Za}from"./brain-DfMjTiNx.js";import{B as es}from"./book-open-BH_yilLK.js";import{s as pa,f as rn,L as nn,d as on,a as ln,p as cn,b as dn}from"./quizService-YBJVdiN1.js";import{L as Le}from"./loader-circle-BfAbw6jC.js";import{E as hs}from"./eye-DyGZzCgK.js";import{S as zt}from"./send-OMGWblBc.js";import{T as er}from"./trash-2-BGLuKCox.js";import{C as Ss}from"./circle-alert-DWP6udG1.js";import{M as ga}from"./minus-8VjeOOlm.js";import{P as $t}from"./plus-Dip_RqNl.js";import{C as Ut}from"./check-D1XVAVXL.js";import{F as Ps,I as qt,R as mn,D as un,a as xn,b as hn,c as fn,d as pn,T as gn,e as bn,f as vn,V as yn}from"./dialog-IPw3v6ZK.js";import{C as jt}from"./chart-column-DzJCKCOe.js";import{C as jn,S as q}from"./skeleton-CTGly9ab.js";import{D as Fs}from"./download-DMZBRA1T.js";import{S as Nn}from"./sparkles-D6B_TX7M.js";import{S as tr}from"./save-XQRYdTi9.js";import{T as Os}from"./trending-up-6u76yy2e.js";import{U as Yt}from"./users-CdMqBLwG.js";import{S as ts}from"./search-zqCwfHe1.js";import{C as Ht,a as nt}from"./chevron-up-CwQX0CFg.js";import{S as ba,g as wn,G as kn,s as va}from"./subjects-wOHUanD9.js";import{C as sr}from"./circle-check-big-C_XnLpga.js";import{E as Sn}from"./eye-off-D800Xx6k.js";import{U as ya}from"./user-C4mm1EOG.js";import{C as _t}from"./chevron-right-BSCyuP_x.js";import{A as Cn}from"./award-COlS18fi.js";import ar from"./ChatMarkdown-XT9mMuBR.js";import{B as Wt}from"./bell-B1VXtbbh.js";import{C as Tn}from"./check-check-TbgWzZ22.js";import{C as rr}from"./clock-jSWTKlqH.js";import{M as In}from"./message-square-BxgAV6zJ.js";import{T as Ln}from"./trophy-DrL6Ph2J.js";import{T as Mn}from"./target-BCguvjbb.js";import{C as An}from"./calendar-CP-HCx1y.js";import{g as En,i as _e,G as zn,a as fs,m as Dn,b as ot,T as $n,s as ps,f as ft,c as ja,L as Na,d as Pn,e as Fn,u as Rs,h as _s,j as On,k as Rn,l as _n,w as wa,n as nr,o as ss,p as Bn,q as Gn,r as Qn,B as Cs,t as Un,R as ka,v as Sa,C as qn}from"./generateCategoricalChart-CiUYzAvW.js";import{c as gt}from"./clsx-B-dksMZM.js";import{P as or}from"./pen-line-CBic_SY8.js";import"./vendor-radix-CxzAJozq.js";import"./utils-BQQgILNW.js";import"./log-out-QZHYEhcR.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";import"./vendor-markdown-C5ikSDMA.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{XPNotification-DOZFX3ET.js β†’ XPNotification-DeYNvFkJ.js} RENAMED
@@ -1 +1 @@
1
- import{r as l,j as e}from"./vendor-react-Dexh7fmo.js";import{e as n,m as r}from"./index-DGWrSMOK.js";import{S as c}from"./star-DqP0S0c5.js";import{S as m}from"./sparkles-DxmNHQEo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const v=({xp:i,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(r.div,{initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},className:"fixed top-8 left-1/2 -translate-x-1/2 z-50",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(c,{size:20,className:"text-white",fill:"currentColor"})}),e.jsx(r.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},children:e.jsx(m,{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:["+",i," XP"]})]})]})})}));export{v as default};
 
1
+ import{r as l,j as e}from"./vendor-react-Dexh7fmo.js";import{e as n,m as r}from"./index-CmBdDSkw.js";import{S as c}from"./star-B7mp4xEi.js";import{S as m}from"./sparkles-D6B_TX7M.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const v=({xp:i,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(r.div,{initial:{opacity:0,y:-50,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.9},className:"fixed top-8 left-1/2 -translate-x-1/2 z-50",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(c,{size:20,className:"text-white",fill:"currentColor"})}),e.jsx(r.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},children:e.jsx(m,{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:["+",i," XP"]})]})]})})}));export{v as default};
assets/{apiService-BuaHZ1Ho.js β†’ apiService-ZZIWaV70.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{I as C}from"./index-DGWrSMOK.js";import"./vendor-react-Dexh7fmo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const z=3e4,ce=3,le=1e3;class E extends Error{status;statusText;endpoint;responseBody;retryable;requestId;constructor(t){super(`API Error ${t.status} (${t.statusText}) on ${t.endpoint}: ${t.responseBody}`),this.name="ApiError",this.status=t.status,this.statusText=t.statusText,this.endpoint=t.endpoint,this.responseBody=t.responseBody,this.retryable=t.retryable,this.requestId=t.requestId}}class N extends Error{endpoint;timeoutMs;constructor(t,r){super(`Request to ${t} timed out after ${r}ms`),this.name="ApiTimeoutError",this.endpoint=t,this.timeoutMs=r}}class W extends Error{endpoint;originalError;constructor(t,r){super(`Network error on ${t}: ${r.message}`),this.name="ApiNetworkError",this.endpoint=t,this.originalError=r}}class g extends Error{endpoint;details;constructor(t,r){super(`Validation error before calling ${t}: ${r}`),this.name="ApiValidationError",this.endpoint=t,this.details=r}}const me=new Set([408,429,500,502,503,504]);function fe(e){return me.has(e)}function K(e){const t=`[API ${e.level.toUpperCase()}] ${e.timestamp} ${e.method} ${e.endpoint}`;switch(e.level){case"error":console.error(t,e.message,e.details??"");break;case"warn":console.warn(t,e.message,e.details??"");break;default:console.info(t,e.message,e.details??"")}}function I(e,t,r,s){K({timestamp:new Date().toISOString(),level:"info",endpoint:e,method:t,message:r,details:s})}function Y(e,t,r,s){K({timestamp:new Date().toISOString(),level:"warn",endpoint:e,method:t,message:r,details:s})}function f(e,t,r,s){K({timestamp:new Date().toISOString(),level:"error",endpoint:e,method:t,message:r,details:s})}function pe(e,t,r=z){const s=new AbortController,a=setTimeout(()=>s.abort(),r);return{promise:fetch(e,{...t,signal:s.signal}).finally(()=>clearTimeout(a)),abort:()=>s.abort()}}let he=e=>new Promise(t=>setTimeout(t,e));function ee(e){return he(e)}function ge(e,t=le){const r=t*Math.pow(2,e),s=Math.random()*t;return Math.min(r+s,3e4)}async function te(e,t={},r={}){const{maxRetries:s=ce,timeoutMs:a=z,baseBackoffMs:p=le}=r,d=(t.method??"GET").toUpperCase();let o;for(let n=0;n<=s;n++){const y=Date.now();try{n>0&&I(e,d,`Retry attempt ${n}/${s}`);const{promise:l}=pe(e,t,a),c=await l,S=Date.now()-y;if(c.ok)return I(e,d,`${c.status} in ${S}ms`,{attempt:n}),await c.json();const x=await c.text().catch(()=>"Unable to read response body"),R=fe(c.status),k=new E({status:c.status,statusText:c.statusText,endpoint:e,responseBody:x,retryable:R,requestId:c.headers.get("x-request-id")??void 0});if(f(e,d,`${c.status} ${c.statusText} in ${S}ms`,{attempt:n,responseBody:x.slice(0,500),retryable:R}),!R)throw k;if(c.status===429){const u=c.headers.get("retry-after");if(u){const P=parseInt(u,10);if(!isNaN(P)&&P>0){Y(e,d,`Rate limited. Waiting ${P}s (Retry-After header)`),await ee(P*1e3),o=k;continue}}}o=k}catch(l){const c=Date.now()-y;if(l instanceof E&&!l.retryable)throw l;if(l instanceof DOMException&&l.name==="AbortError"){const S=new N(e,a);f(e,d,`Timeout after ${c}ms`,{attempt:n,timeoutMs:a}),o=S}else if(l instanceof TypeError&&l.message.includes("fetch")){const S=new W(e,l);f(e,d,`Network error after ${c}ms: ${l.message}`,{attempt:n}),o=S}else l instanceof E?o=l:(o=l instanceof Error?l:new Error(String(l)),f(e,d,`Unexpected error: ${o.message}`,{attempt:n}))}if(n<s){const l=ge(n,p);Y(e,d,`Backing off ${Math.round(l)}ms before attempt ${n+1}`,{attempt:n}),await ee(l)}}throw f(e,d,`All ${s+1} attempts failed`),o??new Error(`retryFetch: all ${s+1} attempts failed for ${e}`)}async function B(e,t,r="API call"){try{return{data:await e(),fromFallback:!1}}catch(s){return Y("","",`${r} failed β€” returning fallback`,{error:s instanceof Error?s.message:String(s)}),{data:t,fromFallback:!0}}}function m(e,t){const r=Object.entries(t).filter(([,s])=>s==null||s==="").map(([s])=>s);if(r.length>0)throw new g(e,`Missing required fields: ${r.join(", ")}`)}function h(e,t,r,s,a){if(typeof r!="number"||isNaN(r)||r<s||r>a)throw new g(e,`${t} must be a number between ${s} and ${a}, got ${r}`)}const F="https://deign86-mathpulse-api-v3test.hf.space",q=(e,t)=>t,de=(e,t)=>t,j=q(void 0,!0),re=q(void 0,!0),se=q(void 0,!0),ae=q(void 0,!0),ne=de(void 0,9e4),H=de(void 0,9e5);let Q=!0,ie=0;const ye=6e4,L={maxRetries:ce,timeoutMs:z,baseBackoffMs:1e3},A={...L,timeoutMs:6e4},we={...A,maxRetries:1,timeoutMs:45e3,baseBackoffMs:750},V={maxRetries:2,timeoutMs:12e4,baseBackoffMs:2e3},Se={maxRetries:0,timeoutMs:8e3,baseBackoffMs:500};let U=null;async function Be(){return U||(U=(async()=>{try{I("/health","GET","Warming up HuggingFace Space...");const e=new AbortController,t=setTimeout(()=>e.abort(),15e3),r=await fetch(`${F}/health`,{method:"GET",signal:e.signal});return clearTimeout(t),r.ok?(I("/health","GET","Backend warm and ready"),!0):(console.warn("[apiService] Backend health check returned",r.status),!1)}catch(e){return console.warn("[apiService] Backend warmup failed (cold start expected):",e),!1}})(),U)}async function i(e,t,r=L){const s=`${F}${e}`,a=t?.method??"GET";I(e,a,"Starting request");const p=async o=>{const n=new Headers(t?.headers??{});!(t?.body instanceof FormData)&&!n.has("Content-Type")&&n.set("Content-Type","application/json");const y=C.currentUser;if(y)try{const l=await y.getIdToken(o);l&&n.set("Authorization",`Bearer ${l}`)}catch(l){f(e,a,"Failed to acquire Firebase ID token",l)}return{...t,headers:n}};let d=await p(!1);try{const o=await te(s,d,r);return I(e,a,"Request succeeded"),o}catch(o){if(o instanceof E&&o.status===401&&C.currentUser)try{I(e,a,"401 received, refreshing Firebase token and retrying once"),d=await p(!0);const n=await te(s,d,r);return I(e,a,"Request succeeded after token refresh"),n}catch(n){throw n instanceof E?f(e,a,`HTTP ${n.status}: ${n.responseBody.slice(0,300)}`):n instanceof N?f(e,a,`Timeout after ${n.timeoutMs}ms`):n instanceof W?f(e,a,`Network error: ${n.originalError.message}`):f(e,a,`Unexpected: ${n instanceof Error?n.message:String(n)}`),n}throw o instanceof E?f(e,a,`HTTP ${o.status}: ${o.responseBody.slice(0,300)}`):o instanceof N?f(e,a,`Timeout after ${o.timeoutMs}ms`):o instanceof W?f(e,a,`Network error: ${o.originalError.message}`):f(e,a,`Unexpected: ${o instanceof Error?o.message:String(o)}`),o}}async function Te(e,t,r=z){const s=`${F}${e}`,a=t?.method??"GET";I(e,a,"Starting blob request");const p=async d=>{const o=new Headers(t?.headers??{}),n=C.currentUser;if(n)try{const c=await n.getIdToken(d);c&&o.set("Authorization",`Bearer ${c}`)}catch(c){f(e,a,"Failed to acquire Firebase ID token",c)}const y=new AbortController,l=setTimeout(()=>y.abort(),r);try{const c=await fetch(s,{...t,headers:o,signal:y.signal});if(!c.ok){const S=await c.text();throw new E({status:c.status,statusText:c.statusText||"Request Failed",endpoint:e,responseBody:S,retryable:c.status>=500||c.status===429})}return await c.blob()}finally{clearTimeout(l)}};try{return await p(!1)}catch(d){if(d instanceof E&&d.status===401&&C.currentUser)return I(e,a,"401 received for blob request, refreshing Firebase token and retrying once"),p(!0);throw d}}const be={response:"Sorry, the AI tutor is temporarily unavailable. Please try again in a moment."},Ie={riskLevel:"Medium",confidence:0,analysis:{labels:[],scores:[]},risk_level:"medium",risk_score:0,top_factors:["Fallback risk response due to temporary service unavailability"]},Ee={learningPath:"Unable to generate a learning path right now. Please try again later."},ke={insight:"Daily insight is temporarily unavailable. Please refresh later."},Ae={expression:"",result:"Error: calculation service unavailable",steps:[],simplified:null,latex:null};function Oe(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.riskLevel=="string"&&typeof t.confidence=="number"}function oe(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.questions)&&typeof t.totalPoints=="number"}const ve=e=>new Promise(t=>setTimeout(t,e));function Re(e){if(!e)return"Generation task failed without a detailed error.";if(typeof e=="string")return e;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return t.message;try{return JSON.stringify(t)}catch{return"Generation task failed due to an unknown error."}}return String(e)}const b={getImportGroundedRolloutFlags(){return{quizEnabled:j,lessonEnabled:re,feedbackEnabled:se}},async reportImportGroundedFeedback(e){return se?i("/api/feedback/import-grounded",{method:"POST",body:JSON.stringify(e)}):{success:!0,stored:!1,warnings:["Import-grounded feedback events are disabled by frontend rollout flag."]}},async health(){return i("/health",void 0,{...L,timeoutMs:1e4})},async chat(e,t,r,s){m("/api/chat",{message:e});const a={message:e,history:t??[],...s?.expectedEndMarker?{expectedEndMarker:s.expectedEndMarker}:{},...s?.completionMode?{completionMode:s.completionMode}:{},...typeof s?.continuationMaxRounds=="number"?{continuationMaxRounds:Math.max(0,Math.floor(s.continuationMaxRounds))}:{}};if(r){const d=new AbortController;let o=null,n=null,y=null;const l=u=>{o||(o=u,d.abort())},c=()=>{n&&(clearTimeout(n),n=null),y&&(clearTimeout(y),y=null)},S=()=>{n&&clearTimeout(n),n=setTimeout(()=>l("idle"),ne)};y=setTimeout(()=>l("total"),H);const x=new Headers({"Content-Type":"application/json"}),R=C.currentUser;if(R)try{const u=await R.getIdToken(!1);u&&x.set("Authorization",`Bearer ${u}`)}catch(u){f("/api/chat/stream","POST","Failed to acquire Firebase ID token",u)}let k=null;try{S();const u=await fetch(`${F}/api/chat/stream`,{method:"POST",headers:x,body:JSON.stringify(a),signal:d.signal});if(!u.ok||!u.body){const $=await u.text().catch(()=>"Unable to read response body");throw new Error(`Streaming request failed (${u.status}): ${$.slice(0,300)}`)}k=u.body.getReader();const P=new TextDecoder;let O="",J="",X=!1;const G=$=>{const v=$.indexOf(`
2
 
3
  `),T=$.indexOf(`\r
4
  \r
 
1
+ import{I as C}from"./index-CmBdDSkw.js";import"./vendor-react-Dexh7fmo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-firebase-firestore-CkuVbeP5.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const z=3e4,ce=3,le=1e3;class E extends Error{status;statusText;endpoint;responseBody;retryable;requestId;constructor(t){super(`API Error ${t.status} (${t.statusText}) on ${t.endpoint}: ${t.responseBody}`),this.name="ApiError",this.status=t.status,this.statusText=t.statusText,this.endpoint=t.endpoint,this.responseBody=t.responseBody,this.retryable=t.retryable,this.requestId=t.requestId}}class N extends Error{endpoint;timeoutMs;constructor(t,r){super(`Request to ${t} timed out after ${r}ms`),this.name="ApiTimeoutError",this.endpoint=t,this.timeoutMs=r}}class W extends Error{endpoint;originalError;constructor(t,r){super(`Network error on ${t}: ${r.message}`),this.name="ApiNetworkError",this.endpoint=t,this.originalError=r}}class g extends Error{endpoint;details;constructor(t,r){super(`Validation error before calling ${t}: ${r}`),this.name="ApiValidationError",this.endpoint=t,this.details=r}}const me=new Set([408,429,500,502,503,504]);function fe(e){return me.has(e)}function K(e){const t=`[API ${e.level.toUpperCase()}] ${e.timestamp} ${e.method} ${e.endpoint}`;switch(e.level){case"error":console.error(t,e.message,e.details??"");break;case"warn":console.warn(t,e.message,e.details??"");break;default:console.info(t,e.message,e.details??"")}}function I(e,t,r,s){K({timestamp:new Date().toISOString(),level:"info",endpoint:e,method:t,message:r,details:s})}function Y(e,t,r,s){K({timestamp:new Date().toISOString(),level:"warn",endpoint:e,method:t,message:r,details:s})}function f(e,t,r,s){K({timestamp:new Date().toISOString(),level:"error",endpoint:e,method:t,message:r,details:s})}function pe(e,t,r=z){const s=new AbortController,a=setTimeout(()=>s.abort(),r);return{promise:fetch(e,{...t,signal:s.signal}).finally(()=>clearTimeout(a)),abort:()=>s.abort()}}let he=e=>new Promise(t=>setTimeout(t,e));function ee(e){return he(e)}function ge(e,t=le){const r=t*Math.pow(2,e),s=Math.random()*t;return Math.min(r+s,3e4)}async function te(e,t={},r={}){const{maxRetries:s=ce,timeoutMs:a=z,baseBackoffMs:p=le}=r,d=(t.method??"GET").toUpperCase();let o;for(let n=0;n<=s;n++){const y=Date.now();try{n>0&&I(e,d,`Retry attempt ${n}/${s}`);const{promise:l}=pe(e,t,a),c=await l,S=Date.now()-y;if(c.ok)return I(e,d,`${c.status} in ${S}ms`,{attempt:n}),await c.json();const x=await c.text().catch(()=>"Unable to read response body"),R=fe(c.status),k=new E({status:c.status,statusText:c.statusText,endpoint:e,responseBody:x,retryable:R,requestId:c.headers.get("x-request-id")??void 0});if(f(e,d,`${c.status} ${c.statusText} in ${S}ms`,{attempt:n,responseBody:x.slice(0,500),retryable:R}),!R)throw k;if(c.status===429){const u=c.headers.get("retry-after");if(u){const P=parseInt(u,10);if(!isNaN(P)&&P>0){Y(e,d,`Rate limited. Waiting ${P}s (Retry-After header)`),await ee(P*1e3),o=k;continue}}}o=k}catch(l){const c=Date.now()-y;if(l instanceof E&&!l.retryable)throw l;if(l instanceof DOMException&&l.name==="AbortError"){const S=new N(e,a);f(e,d,`Timeout after ${c}ms`,{attempt:n,timeoutMs:a}),o=S}else if(l instanceof TypeError&&l.message.includes("fetch")){const S=new W(e,l);f(e,d,`Network error after ${c}ms: ${l.message}`,{attempt:n}),o=S}else l instanceof E?o=l:(o=l instanceof Error?l:new Error(String(l)),f(e,d,`Unexpected error: ${o.message}`,{attempt:n}))}if(n<s){const l=ge(n,p);Y(e,d,`Backing off ${Math.round(l)}ms before attempt ${n+1}`,{attempt:n}),await ee(l)}}throw f(e,d,`All ${s+1} attempts failed`),o??new Error(`retryFetch: all ${s+1} attempts failed for ${e}`)}async function B(e,t,r="API call"){try{return{data:await e(),fromFallback:!1}}catch(s){return Y("","",`${r} failed β€” returning fallback`,{error:s instanceof Error?s.message:String(s)}),{data:t,fromFallback:!0}}}function m(e,t){const r=Object.entries(t).filter(([,s])=>s==null||s==="").map(([s])=>s);if(r.length>0)throw new g(e,`Missing required fields: ${r.join(", ")}`)}function h(e,t,r,s,a){if(typeof r!="number"||isNaN(r)||r<s||r>a)throw new g(e,`${t} must be a number between ${s} and ${a}, got ${r}`)}const F="https://deign86-mathpulse-api-v3test.hf.space",q=(e,t)=>t,de=(e,t)=>t,j=q(void 0,!0),re=q(void 0,!0),se=q(void 0,!0),ae=q(void 0,!0),ne=de(void 0,9e4),H=de(void 0,9e5);let Q=!0,ie=0;const ye=6e4,L={maxRetries:ce,timeoutMs:z,baseBackoffMs:1e3},A={...L,timeoutMs:6e4},we={...A,maxRetries:1,timeoutMs:45e3,baseBackoffMs:750},V={maxRetries:2,timeoutMs:12e4,baseBackoffMs:2e3},Se={maxRetries:0,timeoutMs:8e3,baseBackoffMs:500};let U=null;async function Be(){return U||(U=(async()=>{try{I("/health","GET","Warming up HuggingFace Space...");const e=new AbortController,t=setTimeout(()=>e.abort(),15e3),r=await fetch(`${F}/health`,{method:"GET",signal:e.signal});return clearTimeout(t),r.ok?(I("/health","GET","Backend warm and ready"),!0):(console.warn("[apiService] Backend health check returned",r.status),!1)}catch(e){return console.warn("[apiService] Backend warmup failed (cold start expected):",e),!1}})(),U)}async function i(e,t,r=L){const s=`${F}${e}`,a=t?.method??"GET";I(e,a,"Starting request");const p=async o=>{const n=new Headers(t?.headers??{});!(t?.body instanceof FormData)&&!n.has("Content-Type")&&n.set("Content-Type","application/json");const y=C.currentUser;if(y)try{const l=await y.getIdToken(o);l&&n.set("Authorization",`Bearer ${l}`)}catch(l){f(e,a,"Failed to acquire Firebase ID token",l)}return{...t,headers:n}};let d=await p(!1);try{const o=await te(s,d,r);return I(e,a,"Request succeeded"),o}catch(o){if(o instanceof E&&o.status===401&&C.currentUser)try{I(e,a,"401 received, refreshing Firebase token and retrying once"),d=await p(!0);const n=await te(s,d,r);return I(e,a,"Request succeeded after token refresh"),n}catch(n){throw n instanceof E?f(e,a,`HTTP ${n.status}: ${n.responseBody.slice(0,300)}`):n instanceof N?f(e,a,`Timeout after ${n.timeoutMs}ms`):n instanceof W?f(e,a,`Network error: ${n.originalError.message}`):f(e,a,`Unexpected: ${n instanceof Error?n.message:String(n)}`),n}throw o instanceof E?f(e,a,`HTTP ${o.status}: ${o.responseBody.slice(0,300)}`):o instanceof N?f(e,a,`Timeout after ${o.timeoutMs}ms`):o instanceof W?f(e,a,`Network error: ${o.originalError.message}`):f(e,a,`Unexpected: ${o instanceof Error?o.message:String(o)}`),o}}async function Te(e,t,r=z){const s=`${F}${e}`,a=t?.method??"GET";I(e,a,"Starting blob request");const p=async d=>{const o=new Headers(t?.headers??{}),n=C.currentUser;if(n)try{const c=await n.getIdToken(d);c&&o.set("Authorization",`Bearer ${c}`)}catch(c){f(e,a,"Failed to acquire Firebase ID token",c)}const y=new AbortController,l=setTimeout(()=>y.abort(),r);try{const c=await fetch(s,{...t,headers:o,signal:y.signal});if(!c.ok){const S=await c.text();throw new E({status:c.status,statusText:c.statusText||"Request Failed",endpoint:e,responseBody:S,retryable:c.status>=500||c.status===429})}return await c.blob()}finally{clearTimeout(l)}};try{return await p(!1)}catch(d){if(d instanceof E&&d.status===401&&C.currentUser)return I(e,a,"401 received for blob request, refreshing Firebase token and retrying once"),p(!0);throw d}}const be={response:"Sorry, the AI tutor is temporarily unavailable. Please try again in a moment."},Ie={riskLevel:"Medium",confidence:0,analysis:{labels:[],scores:[]},risk_level:"medium",risk_score:0,top_factors:["Fallback risk response due to temporary service unavailability"]},Ee={learningPath:"Unable to generate a learning path right now. Please try again later."},ke={insight:"Daily insight is temporarily unavailable. Please refresh later."},Ae={expression:"",result:"Error: calculation service unavailable",steps:[],simplified:null,latex:null};function Oe(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.riskLevel=="string"&&typeof t.confidence=="number"}function oe(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.questions)&&typeof t.totalPoints=="number"}const ve=e=>new Promise(t=>setTimeout(t,e));function Re(e){if(!e)return"Generation task failed without a detailed error.";if(typeof e=="string")return e;if(typeof e=="object"&&e!==null){const t=e;if(typeof t.message=="string")return t.message;try{return JSON.stringify(t)}catch{return"Generation task failed due to an unknown error."}}return String(e)}const b={getImportGroundedRolloutFlags(){return{quizEnabled:j,lessonEnabled:re,feedbackEnabled:se}},async reportImportGroundedFeedback(e){return se?i("/api/feedback/import-grounded",{method:"POST",body:JSON.stringify(e)}):{success:!0,stored:!1,warnings:["Import-grounded feedback events are disabled by frontend rollout flag."]}},async health(){return i("/health",void 0,{...L,timeoutMs:1e4})},async chat(e,t,r,s){m("/api/chat",{message:e});const a={message:e,history:t??[],...s?.expectedEndMarker?{expectedEndMarker:s.expectedEndMarker}:{},...s?.completionMode?{completionMode:s.completionMode}:{},...typeof s?.continuationMaxRounds=="number"?{continuationMaxRounds:Math.max(0,Math.floor(s.continuationMaxRounds))}:{}};if(r){const d=new AbortController;let o=null,n=null,y=null;const l=u=>{o||(o=u,d.abort())},c=()=>{n&&(clearTimeout(n),n=null),y&&(clearTimeout(y),y=null)},S=()=>{n&&clearTimeout(n),n=setTimeout(()=>l("idle"),ne)};y=setTimeout(()=>l("total"),H);const x=new Headers({"Content-Type":"application/json"}),R=C.currentUser;if(R)try{const u=await R.getIdToken(!1);u&&x.set("Authorization",`Bearer ${u}`)}catch(u){f("/api/chat/stream","POST","Failed to acquire Firebase ID token",u)}let k=null;try{S();const u=await fetch(`${F}/api/chat/stream`,{method:"POST",headers:x,body:JSON.stringify(a),signal:d.signal});if(!u.ok||!u.body){const $=await u.text().catch(()=>"Unable to read response body");throw new Error(`Streaming request failed (${u.status}): ${$.slice(0,300)}`)}k=u.body.getReader();const P=new TextDecoder;let O="",J="",X=!1;const G=$=>{const v=$.indexOf(`
2
 
3
  `),T=$.indexOf(`\r
4
  \r
assets/{automationService-1THdsq3v.js β†’ automationService-IMphlGK7.js} RENAMED
@@ -1 +1 @@
1
- import{k as p,e as r,q as w,w as h,h as z,m as Q,a as i,s as I,d as b,u as A}from"./vendor-firebase-firestore-CkuVbeP5.js";import{d as s,N as a,O as $}from"./index-DGWrSMOK.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-react-Dexh7fmo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";async function k(e){if(!e)return 0;const n=r(s,"deepDiagnosticAssignments"),c=w(n,h("lrn","==",e));return(await z(c)).docs.filter(o=>{const t=o.data().status;return t==="pending"||t==="queued"||t==="in_progress"||t==="expired"}).length}async function T(e,n,c="Grade 11",u,o="iar_only",t="initial_assessment"){if(t==="followup_diagnostic"){const D=r(s,"deepDiagnosticAssignments"),C=w(D,h("lrn","==",e)),d=await z(C);if(!d.empty){const m=Q(s);let g=!1;for(const l of d.docs){const f=l.data().status;(f==="pending"||f==="queued")&&(m.update(l.ref,{status:"in_progress",startedAt:i()}),g=!0)}g&&await m.commit()}}return await I(b(s,"diagnosticResults",e),{lrn:e,results:n,gradeLevel:c,workflowMode:o,assessmentType:t,questionBreakdown:u||null,completedAt:i(),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 B(e){return await p(r(s,"quizResults"),{lrn: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:i()}),{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 M(e){return await $(e.lrn),await a(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await a(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 N(e){return await p(r(s,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:i(),processed:!1}),await a(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 U(e){const n=b(s,"curriculumContent",e.contentId);return e.action==="delete"?await A(n,{deleted:!0,deletedBy:e.adminId,deletedAt:i(),contentType:e.contentType,subjectId:e.subjectId||null}):await I(n,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:i()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}export{k as getPendingDeepDiagnosticCount,U as triggerContentUpdated,N as triggerDataImported,T as triggerDiagnosticCompleted,B as triggerQuizSubmitted,M as triggerStudentEnrolled};
 
1
+ import{k as p,e as r,q as w,w as h,h as z,m as Q,a as i,s as I,d as b,u as A}from"./vendor-firebase-firestore-CkuVbeP5.js";import{d as s,O as a,P as $}from"./index-CmBdDSkw.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-react-Dexh7fmo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";async function k(e){if(!e)return 0;const n=r(s,"deepDiagnosticAssignments"),c=w(n,h("lrn","==",e));return(await z(c)).docs.filter(o=>{const t=o.data().status;return t==="pending"||t==="queued"||t==="in_progress"||t==="expired"}).length}async function T(e,n,c="Grade 11",u,o="iar_only",t="initial_assessment"){if(t==="followup_diagnostic"){const D=r(s,"deepDiagnosticAssignments"),C=w(D,h("lrn","==",e)),d=await z(C);if(!d.empty){const m=Q(s);let g=!1;for(const l of d.docs){const f=l.data().status;(f==="pending"||f==="queued")&&(m.update(l.ref,{status:"in_progress",startedAt:i()}),g=!0)}g&&await m.commit()}}return await I(b(s,"diagnosticResults",e),{lrn:e,results:n,gradeLevel:c,workflowMode:o,assessmentType:t,questionBreakdown:u||null,completedAt:i(),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 B(e){return await p(r(s,"quizResults"),{lrn: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:i()}),{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 M(e){return await $(e.lrn),await a(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await a(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 U(e){return await p(r(s,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:i(),processed:!1}),await a(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 x(e){const n=b(s,"curriculumContent",e.contentId);return e.action==="delete"?await A(n,{deleted:!0,deletedBy:e.adminId,deletedAt:i(),contentType:e.contentType,subjectId:e.subjectId||null}):await I(n,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:i()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}export{k as getPendingDeepDiagnosticCount,x as triggerContentUpdated,U as triggerDataImported,T as triggerDiagnosticCompleted,B as triggerQuizSubmitted,M as triggerStudentEnrolled};
assets/{avatarData-DykDiQ_Y.js β†’ avatarData-BW_TX0b4.js} RENAMED
@@ -1 +1 @@
1
- const r=[{id:"top_blue",name:"Blue Uniform",category:"top",src:"/avatar/uniform_blue.png",thumbnail:"/avatar/uniform_blue_thumbnail.png",price:0},{id:"top_pink",name:"Pink Uniform",category:"top",src:"/avatar/uniform_pink.png",thumbnail:"/avatar/uniform_pink_thumbnail.png",price:200},{id:"bot_black",name:"Black Pants",category:"bottom",src:"/avatar/pants_black.png",thumbnail:"/avatar/pants_black_thumbnail.png",price:0},{id:"shoe_black",name:"Black Shoes",category:"shoes",src:"/avatar/shoes_black.png",thumbnail:"/avatar/shoes_black_thumbnail.png",price:0},{id:"acc_leaf_clip",name:"Leaf Clip",category:"accessory",src:"/avatar/leaf_clip.png",thumbnail:"/avatar/leaf_clip_thumbnail.png",price:0},{id:"acc_blue_cap",name:"Blue Cap",category:"accessory",src:"/avatar/blue_cap.png",thumbnail:"/avatar/blue_cap_thumbnail.png",price:250},{id:"acc_red_cap",name:"Red Cap",category:"accessory",src:"/avatar/red_cap.png",thumbnail:"/avatar/red_cap_thumbnail.png",price:250},{id:"acc_traffic_cone",name:"Traffic Cone",category:"accessory",src:"/avatar/traffic_cone.png",thumbnail:"/avatar/traffic_cone_thumbnail.png",price:500},{id:"acc_crown",name:"Crown",category:"accessory",src:"/avatar/crown.png",thumbnail:"/avatar/crown_thumbnail.png",price:1e3}],n=a=>{if(a)return r.find(c=>c.id===a)?.src};export{n as g};
 
1
+ const r=[{id:"top_blue",name:"Blue Uniform",category:"top",src:"/avatar/uniform_blue.png",thumbnail:"/avatar/uniform_blue_thumbnail.png",price:0},{id:"top_pink",name:"Pink Uniform",category:"top",src:"/avatar/uniform_pink.png",thumbnail:"/avatar/uniform_pink_thumbnail.png",price:200},{id:"bot_black",name:"Black Pants",category:"bottom",src:"/avatar/pants_black.png",thumbnail:"/avatar/pants_black_thumbnail.png",price:0},{id:"shoe_black",name:"Black Shoes",category:"shoes",src:"/avatar/shoes_black.png",thumbnail:"/avatar/shoes_black_thumbnail.png",price:0},{id:"acc_leaf_clip",name:"Leaf Clip",category:"accessory",src:"/avatar/leaf_clip.png",thumbnail:"/avatar/leaf_clip_thumbnail.png",price:0},{id:"acc_blue_cap",name:"Blue Cap",category:"accessory",src:"/avatar/blue_cap.png",thumbnail:"/avatar/blue_cap_thumbnail.png",price:250},{id:"acc_red_cap",name:"Red Cap",category:"accessory",src:"/avatar/red_cap.png",thumbnail:"/avatar/red_cap_thumbnail.png",price:250},{id:"acc_traffic_cone",name:"Traffic Cone",category:"accessory",src:"/avatar/traffic_cone.png",thumbnail:"/avatar/traffic_cone_thumbnail.png",price:500},{id:"acc_crown",name:"Crown",category:"accessory",src:"/avatar/crown.png",thumbnail:"/avatar/crown_thumbnail.png",price:1e3}],n=a=>{if(a)return r.find(c=>c.id===a)?.src};export{r as M,n as g};
assets/{award-DpLN2BvV.js β†’ award-COlS18fi.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{bell-DeNrtKrI.js β†’ bell-B1VXtbbh.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as e}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{book-open-B5Xvd1JL.js β†’ book-open-BH_yilLK.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as o}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{brain-DHmY5cbv.js β†’ brain-DfMjTiNx.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as a}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{button-DWdPuxDU.js β†’ button-BP5cklmU.js} RENAMED
@@ -1 +1 @@
1
- import{j as y}from"./vendor-react-Dexh7fmo.js";import{w as k}from"./vendor-radix-B-ht8aK0.js";import{c as V}from"./clsx-B-dksMZM.js";import{c as p}from"./utils-BQQgILNW.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 O({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{O as B};
 
1
+ import{j as y}from"./vendor-react-Dexh7fmo.js";import{w as k}from"./vendor-radix-CxzAJozq.js";import{c as V}from"./clsx-B-dksMZM.js";import{c as p}from"./utils-BQQgILNW.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 O({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{O as B};
assets/{calendar-19p2TrVX.js β†’ calendar-CP-HCx1y.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as e}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{chart-column-CJzwyNMx.js β†’ chart-column-DzJCKCOe.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as t}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{chatService-tsfogjaC.js β†’ chatService-D8LuvWux.js} RENAMED
@@ -1 +1 @@
1
- import{d as c,e as d,b as g,a as i,s as w,u as p,q as l,w as u,o as y,h as A}from"./vendor-firebase-firestore-CkuVbeP5.js";import{d as o}from"./index-DGWrSMOK.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-react-Dexh7fmo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const C=async(s,t="New Conversation")=>{try{const e=c(d(o,"chatSessions")),r={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...r,createdAt:i(),updatedAt:i()}),r}catch(e){throw console.error("Error creating chat session:",e),e}},M=async s=>{try{const t=l(d(o,"chatSessions"),u("userId","==",s),u("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(r=>{const a=r.data();return{...a,createdAt:a.createdAt?.toDate()||new Date,updatedAt:a.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},T=async s=>{try{const t=await g(c(o,"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}},b=async(s,t,e,r)=>{try{const a=c(d(o,"chatMessages")),n={id:a.id,userId:"",role:t,content:e,timestamp:new Date,...r?{context:r}:{}},h=await g(c(o,"chatSessions",s));h.exists()&&(n.userId=h.data().userId);const m={id:n.id,userId:n.userId,role:n.role,content:n.content,sessionId:s,timestamp:i()};return n.context&&(m.context=n.context),await w(a,m),await p(c(o,"chatSessions",s),{updatedAt:i()}),n}catch(a){throw console.error("Error adding message:",a),a}},q=async s=>{try{const t=l(d(o,"chatMessages"),u("sessionId","==",s),y("timestamp","asc"));return(await A(t)).docs.map(r=>{const a=r.data();return{...a,timestamp:a.timestamp?.toDate()||new Date}})}catch(t){return console.error("Error getting session messages:",t),[]}},Q=async(s,t)=>{try{await p(c(o,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},R=async s=>{try{await p(c(o,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{b as addMessageToSession,C as createChatSession,R as deleteSession,T as getChatSession,q as getSessionMessages,M as getUserChatSessions,Q as updateSessionTitle};
 
1
+ import{d as c,e as d,b as g,a as i,s as w,u as p,q as l,w as u,o as y,h as A}from"./vendor-firebase-firestore-CkuVbeP5.js";import{d as o}from"./index-CmBdDSkw.js";import"./vendor-firebase-core-DQ-pMjxd.js";import"./vendor-react-Dexh7fmo.js";import"./vendor-firebase-auth-COrkgW0P.js";import"./vendor-firebase-storage-BOeKE_0n.js";import"./vendor-firebase-analytics-CCo6E2f7.js";const C=async(s,t="New Conversation")=>{try{const e=c(d(o,"chatSessions")),r={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...r,createdAt:i(),updatedAt:i()}),r}catch(e){throw console.error("Error creating chat session:",e),e}},M=async s=>{try{const t=l(d(o,"chatSessions"),u("userId","==",s),u("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(r=>{const a=r.data();return{...a,createdAt:a.createdAt?.toDate()||new Date,updatedAt:a.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},T=async s=>{try{const t=await g(c(o,"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}},b=async(s,t,e,r)=>{try{const a=c(d(o,"chatMessages")),n={id:a.id,userId:"",role:t,content:e,timestamp:new Date,...r?{context:r}:{}},h=await g(c(o,"chatSessions",s));h.exists()&&(n.userId=h.data().userId);const m={id:n.id,userId:n.userId,role:n.role,content:n.content,sessionId:s,timestamp:i()};return n.context&&(m.context=n.context),await w(a,m),await p(c(o,"chatSessions",s),{updatedAt:i()}),n}catch(a){throw console.error("Error adding message:",a),a}},q=async s=>{try{const t=l(d(o,"chatMessages"),u("sessionId","==",s),y("timestamp","asc"));return(await A(t)).docs.map(r=>{const a=r.data();return{...a,timestamp:a.timestamp?.toDate()||new Date}})}catch(t){return console.error("Error getting session messages:",t),[]}},Q=async(s,t)=>{try{await p(c(o,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},R=async s=>{try{await p(c(o,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{b as addMessageToSession,C as createChatSession,R as deleteSession,T as getChatSession,q as getSessionMessages,M as getUserChatSessions,Q as updateSessionTitle};
assets/{check-BONc3QkK.js β†’ check-D1XVAVXL.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{check-check-BDU3hkDf.js β†’ check-check-TbgWzZ22.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{chevron-right-DxXkA9aZ.js β†’ chevron-right-BSCyuP_x.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as o}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{chevron-up-BJyzaJs7.js β†’ chevron-up-CwQX0CFg.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as o}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{circle-alert-D8UKyVHS.js β†’ circle-alert-DWP6udG1.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c as e}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
assets/{circle-check-big-mv2CRLCE.js β†’ circle-check-big-C_XnLpga.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{c}from"./index-DGWrSMOK.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.
 
1
+ import{c}from"./index-CmBdDSkw.js";/**
2
  * @license lucide-react v0.487.0 - ISC
3
  *
4
  * This source code is licensed under the ISC license.