Spaces:
Running
Running
github-actions[bot] commited on
Commit Β·
3d1230e
1
Parent(s): e7970c1
π Auto-deploy frontend from GitHub (74961f4)
Browse filesThis view is limited to 50 files because it contains too many changes. Β See raw diff
- assets/{AIChatPage-AJHAnKG2.js β AIChatPage-DesRqPBP.js} +2 -2
- assets/{AdminDashboard-6u-n_Aj4.js β AdminDashboard-BbvhhwJY.js} +1 -1
- assets/{AssessmentPage-CmqDSE0L.js β AssessmentPage-D6fgX4f6.js} +3 -3
- assets/AvatarShop-DZiViM0D.js +0 -31
- assets/AvatarShop-DqyERXR_.js +21 -0
- assets/{ChatMarkdown-BrSWjY6i.js β ChatMarkdown-Cwsa2RCx.js} +1 -1
- assets/{CompetencyRadarChart-qES5nrtq.js β CompetencyRadarChart-BbKzMlR1.js} +1 -1
- assets/{CompositeAvatar-Col05lJc.js β CompositeAvatar-DoKZfi7O.js} +1 -1
- assets/{ConfirmModal-B3J78vrR.js β ConfirmModal-CH3zQe0u.js} +1 -1
- assets/{DashboardAvatar-CbAKGmA6.js β DashboardAvatar-D5djDQQ1.js} +1 -1
- assets/{DiagnosticBreakdown-BF7w8Bn-.js β DiagnosticBreakdown-DkqMV9oI.js} +1 -1
- assets/{FloatingAITutor-BnnsbuI9.js β FloatingAITutor-wfjL9MBE.js} +2 -2
- assets/{GradesPage-Dtj8WgVn.js β GradesPage-CTmxSKZ7.js} +2 -2
- assets/{HeroBanner-B32-rtu2.js β HeroBanner-BMkaVujy.js} +3 -3
- assets/{InitialAssessmentModal-DcJcuab5.js β InitialAssessmentModal-CnFHhYba.js} +1 -1
- assets/{LeaderboardPage-FEtdr_oR.js β LeaderboardPage-Cl1rvXzo.js} +1 -1
- assets/{LearningPath-Dtvj49AG.js β LearningPath-8IT3WoMT.js} +1 -1
- assets/{LoginPage-DpTH-gW8.js β LoginPage-LAyBJ2QS.js} +1 -1
- assets/{LogoutActionButton-ke8I5kxg.js β LogoutActionButton-BlHbD8Uf.js} +1 -1
- assets/{ModuleFolderCard-CqhxwGI0.js β ModuleFolderCard-BaBw0Pd9.js} +1 -1
- assets/ModulesPage-CT0lsQBD.js +0 -0
- assets/ModulesPage-CTVBRDaK.js +0 -0
- assets/{NotificationDropdown-BwLtHvqY.js β NotificationDropdown-DNm6nFOm.js} +1 -1
- assets/{ProfileModal-CsRM_gfJ.js β ProfileModal-c1MJMwBW.js} +1 -1
- assets/{ProfilePictureUploader-B-ipxzWy.js β ProfilePictureUploader-Cdp-MoCI.js} +3 -3
- assets/{QuizBattlePage-Dalws6PZ.js β QuizBattlePage-R77VTOls.js} +0 -0
- assets/{RewardsModal-wGM2jgcg.js β RewardsModal-C2mMOy8T.js} +1 -1
- assets/{RightSidebar-DiW3T5Yf.js β RightSidebar-D6kbBdAu.js} +1 -1
- assets/{ScientificCalculator-BIH8UnvI.js β ScientificCalculator-BCm13p89.js} +1 -1
- assets/{SettingsModal-DnlLyFdo.js β SettingsModal-DNhoMuH7.js} +3 -3
- assets/{Sidebar-bryEim00.js β Sidebar-BzRsh0CN.js} +1 -1
- assets/{SupplementalBanner-BtyN_3ih.js β SupplementalBanner-BiW4WQHX.js} +1 -1
- assets/{SupplementalPillCarousel-0O59RLiu.js β SupplementalPillCarousel-BpO68D9M.js} +1 -1
- assets/{TeacherDashboard-BlgU-Xg_.js β TeacherDashboard-Dqx3gqwf.js} +0 -0
- assets/{XPNotification-Ba3kZbWo.js β XPNotification-GHNILw26.js} +1 -1
- assets/{automationService-KQFQd_ic.js β automationService-g67Xos9d.js} +1 -1
- assets/avatarData-BuQSOXo3.js +0 -1
- assets/avatarData-ChByUhv2.js +1 -0
- assets/{bell-D9j1Gy0m.js β bell-DyLbgepV.js} +1 -1
- assets/{button-DsnZWCoA.js β button-BMVm9YQO.js} +1 -1
- assets/{chart-column-BcVJ31XT.js β chart-column-Dyv8TfXk.js} +1 -1
- assets/{chatService-BcZzFY2v.js β chatService-DgvwP4xj.js} +1 -1
- assets/{check-B-qbiSF7.js β check-qsSFTYCr.js} +1 -1
- assets/{chevron-left-DMbkPbec.js β chevron-left-Be5knpOV.js} +1 -1
- assets/{chevron-right-DADygX42.js β chevron-right-BxoysOas.js} +1 -1
- assets/{chevron-up-CoNRuMZ7.js β chevron-up-DtS9MvUZ.js} +1 -1
- assets/{circle-alert-DDdeEgNa.js β circle-alert-CHGy8HcB.js} +1 -1
- assets/{circle-check-BzgmgbHa.js β circle-check-DzQphSnP.js} +1 -1
- assets/{circle-check-big-CDg2qLfH.js β circle-check-big-JdaMs3bP.js} +1 -1
- assets/{circle-help-DNA0h1v1.js β circle-help-CLCoBWDy.js} +1 -1
assets/{AIChatPage-AJHAnKG2.js β AIChatPage-DesRqPBP.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
| 2 |
-
import{aG as B,u as z,_ as F,h as C,m as I,O as H}from"./index-BufUS6SI.js";import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as O}from"./button-DsnZWCoA.js";import{I as A}from"./input-BPglbGHJ.js";import W from"./ChatMarkdown-BrSWjY6i.js";import{P as G}from"./plus-B4qs4LzO.js";import{S as Y}from"./search-DFK_sFlt.js";import{T as Q}from"./trash-2-CBXOjqKg.js";import{C as q}from"./chevron-left-DMbkPbec.js";import{S as K}from"./send-DsMS4hUP.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";function U(a){return a?a instanceof Date?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof a=="object"&&"toDate"in a?a.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(a):""}const ue=()=>{const{sessions:a,activeSessionId:o,isLoading:l,loadingSessionId:L,setActiveSessionId:n,createNewSession:c,sendMessage:T,deleteSession:_,getActiveSession:M,sessionsLoaded:g}=B(),{userProfile:m}=z(),[x,P]=r.useState(""),[i,y]=r.useState(""),[j,w]=r.useState(!1),h=r.useRef(null),u=r.useRef(!0),p=r.useRef(!1),d=M(),f=d?.messages||[],D=f.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),v=l&&o===L&&!D,N=(t="auto")=>{const s=h.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},E=()=>{const t=h.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},R=()=>{u.current=E()};r.useEffect(()=>{F(async()=>{const{warmupBackend:t}=await import("./index-BufUS6SI.js").then(s=>s.b8);return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),r.useEffect(()=>{if(g&&a.length===0){const t={id:"welcome-"+Date.now(),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"})},s=c(t);n(s)}},[g]),r.useEffect(()=>{if(!u.current)return;const t=window.requestAnimationFrame(()=>N("auto"));return()=>window.cancelAnimationFrame(t)},[f,v]),r.useEffect(()=>{u.current=!0,N("auto")},[o]);const k=async()=>{if(!(!i.trim()||l||j||p.current)){p.current=!0,w(!0);try{let t=o;t||(t=c(),n(t));const s=i.trim();y(""),await T(t,s)}finally{p.current=!1,w(!1)}}},S=()=>{const t={id:"welcome-"+Date.now(),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"})},s=c(t);n(s)},$=(t,s)=>{s.stopPropagation(),_(t)},b=a.filter(t=>t.title.toLowerCase().includes(x.toLowerCase())||t.preview.toLowerCase().includes(x.toLowerCase()));return e.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex md:gap-4 px-0 md:px-4 sm:px-6 xl:px-10 py-0 md:py-6",children:[e.jsxs("div",{className:`${o?"hidden md:flex":"flex"} w-full md:w-80 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md: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 justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 md:w-12 md:h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-xl md:rounded-2xl flex items-center justify-center shrink-0",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-8 h-8 md:w-10 md:h-10 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm md: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:S,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-3 py-2 rounded-xl text-xs font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-1.5 shrink-0",children:[e.jsx(G,{size:14}),"New Chat"]})]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(Y,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(A,{type:"text",placeholder:"Search conversations...",value:x,onChange:t=>P(t.target.value),className:"w-full pl-9 pr-3 py-2 text-xs rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:e.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[b.length," Conversations"]})}),e.jsx(C,{children:b.map(t=>e.jsxs(I.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>n(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${o===t.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${o===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>$(t.id,s),className:"absolute top-2 right-2 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-red-100 text-slate-500 hover:text-red-600 transition-all",children:e.jsx(Q,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:t.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:t.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${o===t.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[t.messageCount," msgs"]})]})]},t.id))}),b.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:`${o?"flex":"hidden md:flex"} flex-1 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md:border border-[#dde3eb] overflow-hidden`,children:o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-3 md:p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0 bg-white md:bg-transparent shadow-sm md:shadow-none z-10 relative",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("button",{onClick:()=>n(null),className:"md:hidden p-1.5 -ml-1 text-slate-500 hover:text-slate-800 rounded-lg hover:bg-slate-100",children:e.jsx(q,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold font-display text-[#0a1628] text-sm md:text-base",children:d?.title}),e.jsx("p",{className:"text-[10px] md:text-xs text-[#5a6578]",children:d?.date})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:d?.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:h,onScroll:R,className:"flex-1 overflow-y-auto overscroll-contain p-4 md:p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(C,{children:f.map(t=>e.jsxs(I.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex items-end gap-2 ${t.sender==="user"?"justify-end":"justify-start"}`,children:[t.sender!=="user"&&e.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-r from-sky-600 to-sky-500 flex items-center justify-center flex-shrink-0 mb-1",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI",className:"w-5 h-5 object-contain"})}),e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${t.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.text}):e.jsx(W,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:U(t.timestamp)})]}),t.sender==="user"&&e.jsx(H,{src:m?.photo,name:m?.name,gender:m?.gender,className:"w-7 h-7 flex-shrink-0 mb-1",fallbackClassName:"text-[10px]"})]},t.id))}),v&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-md border border-[#dde3eb] rounded-2xl px-5 py-3 max-w-[70%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})})]}),e.jsx("div",{className:"p-3 md:p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2 md:gap-3",children:[e.jsx(A,{type:"text",value:i,onChange:t=>y(t.target.value),onKeyPress:t=>t.key==="Enter"&&k(),placeholder:"Ask me anything about math...",className:"flex-1 px-5 py-3 rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100 text-sm"}),e.jsx(O,{onClick:k,disabled:!i.trim()||l||j,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(K,{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:S,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{ue as default};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bp7MiGcW.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-Dja0MwoB.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{aG as B,u as z,_ as F,h as C,m as I,O as H}from"./index-Bp7MiGcW.js";import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as O}from"./button-BMVm9YQO.js";import{I as A}from"./input-Co0dljwe.js";import W from"./ChatMarkdown-Cwsa2RCx.js";import{P as G}from"./plus-D4SEqrVj.js";import{S as Y}from"./search-DbD51Zen.js";import{T as Q}from"./trash-2-BhUbBhdb.js";import{C as q}from"./chevron-left-Be5knpOV.js";import{S as K}from"./send-BA-OOIJf.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";function U(a){return a?a instanceof Date?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof a=="object"&&"toDate"in a?a.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(a):""}const ue=()=>{const{sessions:a,activeSessionId:o,isLoading:l,loadingSessionId:L,setActiveSessionId:n,createNewSession:c,sendMessage:T,deleteSession:_,getActiveSession:M,sessionsLoaded:g}=B(),{userProfile:m}=z(),[x,P]=r.useState(""),[i,y]=r.useState(""),[j,w]=r.useState(!1),h=r.useRef(null),u=r.useRef(!0),p=r.useRef(!1),d=M(),f=d?.messages||[],D=f.some(t=>t.sender==="ai"&&t.id.startsWith("stream-")),v=l&&o===L&&!D,N=(t="auto")=>{const s=h.current;s&&s.scrollTo({top:s.scrollHeight,behavior:t})},E=()=>{const t=h.current;return t?t.scrollHeight-t.scrollTop-t.clientHeight<=120:!0},R=()=>{u.current=E()};r.useEffect(()=>{F(async()=>{const{warmupBackend:t}=await import("./index-Bp7MiGcW.js").then(s=>s.b8);return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("AI chat warmup skipped:",t)})},[]),r.useEffect(()=>{if(g&&a.length===0){const t={id:"welcome-"+Date.now(),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"})},s=c(t);n(s)}},[g]),r.useEffect(()=>{if(!u.current)return;const t=window.requestAnimationFrame(()=>N("auto"));return()=>window.cancelAnimationFrame(t)},[f,v]),r.useEffect(()=>{u.current=!0,N("auto")},[o]);const k=async()=>{if(!(!i.trim()||l||j||p.current)){p.current=!0,w(!0);try{let t=o;t||(t=c(),n(t));const s=i.trim();y(""),await T(t,s)}finally{p.current=!1,w(!1)}}},S=()=>{const t={id:"welcome-"+Date.now(),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"})},s=c(t);n(s)},$=(t,s)=>{s.stopPropagation(),_(t)},b=a.filter(t=>t.title.toLowerCase().includes(x.toLowerCase())||t.preview.toLowerCase().includes(x.toLowerCase()));return e.jsxs("div",{className:"h-full min-h-0 overflow-hidden flex md:gap-4 px-0 md:px-4 sm:px-6 xl:px-10 py-0 md:py-6",children:[e.jsxs("div",{className:`${o?"hidden md:flex":"flex"} w-full md:w-80 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md: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 justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 md:w-12 md:h-12 bg-gradient-to-r from-sky-600 to-sky-500 rounded-xl md:rounded-2xl flex items-center justify-center shrink-0",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-8 h-8 md:w-10 md:h-10 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm md: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:S,className:"bg-gradient-to-r from-sky-600 to-sky-500 hover:from-sky-700 hover:to-sky-600 text-white px-3 py-2 rounded-xl text-xs font-bold transition-all shadow-md hover:shadow-lg flex items-center justify-center gap-1.5 shrink-0",children:[e.jsx(G,{size:14}),"New Chat"]})]}),e.jsxs("div",{className:"relative mt-3",children:[e.jsx(Y,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",size:14}),e.jsx(A,{type:"text",placeholder:"Search conversations...",value:x,onChange:t=>P(t.target.value),className:"w-full pl-9 pr-3 py-2 text-xs rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100"})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between mb-2 px-2",children:e.jsxs("span",{className:"text-xs font-bold text-[#5a6578]",children:[b.length," Conversations"]})}),e.jsx(C,{children:b.map(t=>e.jsxs(I.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},onClick:()=>n(t.id),className:`group p-3 rounded-2xl cursor-pointer transition-all duration-200 border relative ${o===t.id?"bg-sky-50 border-sky-200 shadow-sm":"bg-[#edf1f7] border-transparent hover:bg-[#dde3eb] hover:border-[#dde3eb]"}`,children:[e.jsxs("div",{className:"flex items-start justify-between mb-1",children:[e.jsx("h3",{className:`text-xs font-bold mb-0.5 pr-6 line-clamp-1 ${o===t.id?"text-sky-700":"text-[#0a1628]"}`,children:t.title}),e.jsx("button",{onClick:s=>$(t.id,s),className:"absolute top-2 right-2 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 hover:bg-red-100 text-slate-500 hover:text-red-600 transition-all",children:e.jsx(Q,{size:12})})]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] mb-2 line-clamp-2",children:t.preview}),e.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[e.jsx("span",{className:"text-slate-500",children:t.date}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full ${o===t.id?"bg-sky-100 text-sky-600":"bg-[#dde3eb] text-[#5a6578]"}`,children:[t.messageCount," msgs"]})]})]},t.id))}),b.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:`${o?"flex":"hidden md:flex"} flex-1 min-h-0 flex-col bg-[#f7f9fc] rounded-none md:rounded-3xl border-0 md:border border-[#dde3eb] overflow-hidden`,children:o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-3 md:p-4 border-b border-[#dde3eb] flex items-center justify-between flex-shrink-0 bg-white md:bg-transparent shadow-sm md:shadow-none z-10 relative",children:[e.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("button",{onClick:()=>n(null),className:"md:hidden p-1.5 -ml-1 text-slate-500 hover:text-slate-800 rounded-lg hover:bg-slate-100",children:e.jsx(q,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold font-display text-[#0a1628] text-sm md:text-base",children:d?.title}),e.jsx("p",{className:"text-[10px] md:text-xs text-[#5a6578]",children:d?.date})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:d?.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:h,onScroll:R,className:"flex-1 overflow-y-auto overscroll-contain p-4 md:p-6 space-y-4 bg-[#edf1f7] min-h-0",children:[e.jsx(C,{children:f.map(t=>e.jsxs(I.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:`flex items-end gap-2 ${t.sender==="user"?"justify-end":"justify-start"}`,children:[t.sender!=="user"&&e.jsx("div",{className:"w-7 h-7 rounded-full bg-gradient-to-r from-sky-600 to-sky-500 flex items-center justify-center flex-shrink-0 mb-1",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI",className:"w-5 h-5 object-contain"})}),e.jsxs("div",{className:`max-w-[70%] rounded-2xl px-5 py-3 ${t.sender==="user"?"bg-gradient-to-r from-sky-600 to-sky-500 text-white":"bg-white text-[#0a1628] shadow-md border border-[#dde3eb]"}`,children:[t.sender==="user"?e.jsx("p",{className:"text-sm whitespace-pre-wrap leading-relaxed",children:t.text}):e.jsx(W,{children:t.text}),e.jsx("p",{className:`text-[10px] mt-1.5 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:U(t.timestamp)})]}),t.sender==="user"&&e.jsx(H,{src:m?.photo,name:m?.name,gender:m?.gender,className:"w-7 h-7 flex-shrink-0 mb-1",fallbackClassName:"text-[10px]"})]},t.id))}),v&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"bg-white text-[#0a1628] shadow-md border border-[#dde3eb] rounded-2xl px-5 py-3 max-w-[70%]",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:150ms]"}),e.jsx("div",{className:"w-2 h-2 bg-sky-400 rounded-full animate-bounce [animation-delay:300ms]"})]})})})]}),e.jsx("div",{className:"p-3 md:p-4 border-t border-[#dde3eb] bg-white flex-shrink-0",children:e.jsxs("div",{className:"flex gap-2 md:gap-3",children:[e.jsx(A,{type:"text",value:i,onChange:t=>y(t.target.value),onKeyPress:t=>t.key==="Enter"&&k(),placeholder:"Ask me anything about math...",className:"flex-1 px-5 py-3 rounded-xl border-[#dde3eb] focus:border-sky-600 focus:ring-2 focus:ring-sky-100 text-sm"}),e.jsx(O,{onClick:k,disabled:!i.trim()||l||j,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(K,{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:S,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{ue as default};
|
assets/{AdminDashboard-6u-n_Aj4.js β AdminDashboard-BbvhhwJY.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{j as e,r,d as Ss}from"./vendor-react-B4AQeu28.js";import{C as it,S as nt,a as qs}from"./Sidebar-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{j as e,r,d as Ss}from"./vendor-react-B4AQeu28.js";import{C as it,S as nt,a as qs}from"./Sidebar-BzRsh0CN.js";import ct from"./ConfirmModal-CH3zQe0u.js";import{e as we,o as Te,g as M,n as Se,j as S,h as _t,m as re,q as V,R as Me,k as Ot,v as Cs,Q as Bt,S as Gt,p as ot,u as cs,L as dt,V as As,y as xt,w as De,U as Pe,G as is,i as qt,W as Hs,X as Ws,Y as Vs,r as Ht,A as Qs,Z as Fe,$ as Wt,B as Vt,T as mt,b as He,H as Qt,a0 as Xt,a1 as Kt,E as Yt,M as Zt,O as Jt}from"./index-Bp7MiGcW.js";import{B as E}from"./button-BMVm9YQO.js";import{S as J,a as ee,b as Ue,c as se,d as C}from"./select-CNQuOudF.js";import{I as xe}from"./input-Co0dljwe.js";import{S as rs}from"./subjects-DNoBzeBL.js";import{getDocs as F,query as ve,collection as L,orderBy as We,deleteDoc as ea,doc as Es,limit as ns,where as Ve,addDoc as sa,serverTimestamp as ta,updateDoc as ws}from"./vendor-firebase-firestore-CNv3xXal.js";import{U as es}from"./upload-CP6O7WIX.js";import{D as fe}from"./LogoutActionButton-BlHbD8Uf.js";import{F as Ce,A as _e,N as aa}from"./NotificationDropdown-DNm6nFOm.js";import{T as je}from"./trash-2-BhUbBhdb.js";import{S as Xs}from"./sparkles-fLB3ltj1.js";import{S as Ks,D as ht,a as pt,b as ut,c as gt,e as la}from"./dialog-C3ON9pD8.js";import{D as Ps}from"./download-DFL4ZCXr.js";import{S as zs}from"./shield-check-qhTHRSP5.js";import{S as bt}from"./search-DbD51Zen.js";import{C as Rs}from"./clock-Cc6sJz1J.js";import{E as ft,a as ra}from"./eye-B_U0s6fm.js";import{C as jt}from"./chevron-left-Be5knpOV.js";import{C as vt}from"./chevron-right-BxoysOas.js";import{C as Re}from"./circle-alert-CHGy8HcB.js";import{I as wt}from"./info-Bcg_cBHY.js";import{C as ia,a as na}from"./vendor-radix-C5nwdvGr.js";import{C as ca}from"./check-qsSFTYCr.js";import{M as oa}from"./mail-jAg7cqFw.js";import{P as Ys}from"./plus-D4SEqrVj.js";import{S as Nt}from"./save-D7oNX_Ki.js";import{C as da}from"./chart-column-Dyv8TfXk.js";import{u as xa}from"./useQuery-DN_XJYxl.js";import{X as Ms}from"./x-k8d6VLEw.js";import{D as ma}from"./dollar-sign-Dm4HJ6Ci.js";import{S as ha}from"./switch-C4JL2ii9.js";import{u as pa,t as ua,a as ga}from"./useSubjectAvailability-Dm-85m8R.js";import{C as ba}from"./chevron-up-DtS9MvUZ.js";import{C as fa}from"./circle-help-CLCoBWDy.js";import{B as ja}from"./bell-DyLbgepV.js";import{R as Zs,B as va,C as wa,X as Na,Y as ya,T as ka,a as Js,P as Sa,d as Ca,b as et}from"./vendor-charts-CAmziV1y.js";import{C as Ns}from"./circle-check-DzQphSnP.js";import"./tooltip-nLNeX3nd.js";import"./shirt-C1GQiNvP.js";import"./log-out-DrAbcVI9.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";import"./formatDistanceToNow-D-5-www2.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{AssessmentPage-CmqDSE0L.js β AssessmentPage-D6fgX4f6.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pipelineService-
|
| 2 |
-
import{e as V,_ as M,m as i,Z,h as G,T as H,F as W,r as X}from"./index-
|
| 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 ie=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],le=V("minimize-2",ie),Se=({testId:T,questions:f,userName:$,onComplete:B,onCancel:L})=>{const[h,_]=r.useState("testing"),[a,S]=r.useState(0),[o,b]=r.useState(null),[u,E]=r.useState(()=>{try{const t=sessionStorage.getItem("mathpulse_diagnostic_responses");return t?JSON.parse(t):[]}catch{return[]}}),[g,k]=r.useState([]),[x,z]=r.useState(0),[C,D]=r.useState(null),[A,w]=r.useState(!1),c=r.useRef(null),F=r.useRef(Date.now()),p=r.useRef(!1),d=f.length,l=f[a],P=Math.round((a+(o?1:0))/d*100),v=t=>t==="easy"?60:t==="hard"?120:90,[q]=r.useState(Array.from({length:10},(t,s)=>({id:s,size:Math.random()*80+30,x:Math.random()*100,y:Math.random()*100,duration:Math.random()*20+15,delay:Math.random()*-20,color:["bg-purple-500/10","bg-blue-500/10","bg-cyan-500/10","bg-emerald-500/10"][Math.floor(Math.random()*4)]})));r.useEffect(()=>{const t=v(l?.difficulty||"medium");return F.current=Date.now(),p.current=!1,z(t),c.current&&clearInterval(c.current),c.current=setInterval(()=>{const s=Math.floor((Date.now()-F.current)/1e3),n=Math.max(0,t-s);z(n),n<=0&&!p.current&&(p.current=!0,clearInterval(c.current))},250),()=>{c.current&&clearInterval(c.current)}},[a]),r.useEffect(()=>{if(x===0&&p.current&&h==="testing"){const t=v(l?.difficulty||"medium"),s=[...u,{question_id:l.question_id,student_answer:o||"",time_spent_seconds:t}],n=[...g,!1];k(n),E(s),b(null),a<d-1?S(m=>m+1):I(s)}},[x]);const O=r.useCallback(()=>{const t=document.getElementById("assessment-container");t&&(document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen().then(()=>{w(!1)}).catch(s=>{console.error("Exit fullscreen error:",s)}):t.requestFullscreen().then(()=>{w(!0)}).catch(s=>{console.error("Fullscreen error:",s)}))},[]);r.useEffect(()=>{const t=()=>{w(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)},[]);const Q=t=>{b(t)},U=()=>{if(!o)return;c.current&&clearInterval(c.current);const t=v(l?.difficulty||"medium")-x,s=[...g,!0],n=[...u,{question_id:l.question_id,student_answer:o,time_spent_seconds:t}];k(s),E(n),b(null),a<d-1?S(m=>m+1):I(n)},I=async t=>{_("submitting"),D(null);try{sessionStorage.setItem("mathpulse_diagnostic_responses",JSON.stringify(t))}catch{}try{const s=await ee(T,t);sessionStorage.removeItem("mathpulse_diagnostic"),sessionStorage.removeItem("mathpulse_diagnostic_responses"),_("results");try{const{emitPipelineEvent:n,getStudentContext:m}=await M(async()=>{const{emitPipelineEvent:j,getStudentContext:N}=await import("./pipelineService-BxyJyUSp.js");return{emitPipelineEvent:j,getStudentContext:N}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),{auth:R}=await M(async()=>{const{auth:j}=await import("./index-BufUS6SI.js").then(N=>N.b7);return{auth:j}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12])),y=m();y&&R.currentUser&&n({student_id:R.currentUser.uid,event_type:"diagnostic",event_data:{overall_score:s.overall_score_percent,mastery_summary:s.mastery_summary},occurred_at:new Date().toISOString(),class_id:y.classId,teacher_id:y.teacherId})}catch{}setTimeout(()=>{B({overallRisk:s.overall_risk,overallScorePercent:s.overall_score_percent,intervention:s.recommended_intervention,xpEarned:s.xp_earned,badgeUnlocked:s.badge_unlocked})},3e3)}catch(s){const n=s instanceof Error?s.message:"Submission failed. Your answers are saved locally.";D(n)}},Y=t=>{const s=Math.floor(t/60),n=t%60;return`${s}:${n.toString().padStart(2,"0")}`},J=["A","B","C","D"];return e.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-md flex items-center justify-center p-4 sm:p-6 overflow-hidden",children:e.jsxs("div",{id:"assessment-container",className:"bg-white/95 backdrop-blur-xl border border-white/20 rounded-3xl shadow-[0_0_50px_rgba(0,0,0,0.3)] w-full max-w-4xl h-[95vh] sm:h-[90vh] md:h-[85vh] flex flex-col relative z-10 overflow-hidden transition-all duration-300",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none z-0 overflow-hidden",children:q.map(t=>e.jsx(i.div,{className:`absolute rounded-full blur-3xl ${t.color.replace("/10","/30")}`,style:{width:t.size*1.5,height:t.size*1.5,left:`${t.x}%`,top:`${t.y}%`},animate:{x:[0,Math.random()*100-50,0],y:[0,Math.random()*100-50,0],scale:[1,1.3,1]},transition:{duration:t.duration,repeat:1/0,ease:"linear",delay:t.delay}},t.id))}),e.jsxs(i.div,{className:"shrink-0 text-white border-b border-white/10 shadow-md relative z-10",style:{backgroundColor:"#9956DE"},children:[e.jsxs("div",{className:"flex items-center justify-between p-4 sm:p-5 md:p-6",children:[e.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[e.jsx("h2",{className:"text-lg sm:text-xl md:text-2xl font-bold truncate",children:"Diagnostic Assessment"}),e.jsxs("p",{className:"text-white/80 text-xs sm:text-sm font-medium truncate",children:[l.domain," β’ ",l.difficulty]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:O,className:"w-9 h-9 sm:w-10 sm:h-10 bg-white/20 hover:bg-white/30 rounded-xl flex items-center justify-center transition-colors",title:A?"Exit Fullscreen":"Enter Fullscreen",children:A?e.jsx(le,{size:18}):e.jsx(te,{size:18})}),e.jsx("button",{onClick:L,className:"w-9 h-9 sm:w-10 sm:h-10 bg-white/20 hover:bg-white/30 rounded-xl flex items-center justify-center transition-colors",children:e.jsx(se,{size:20})})]})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 md:px-6 pb-3 sm:pb-4 md:pb-5",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{className:"bg-white/20 px-3 py-1 rounded-full flex items-center gap-1",children:[e.jsx(Z,{size:16}),e.jsxs("span",{className:"font-bold text-sm",children:[u.length," / ",d]})]})}),e.jsxs("div",{className:`flex items-center gap-1 px-3 py-1 rounded-full ${x<=10?"bg-red-500/80 animate-pulse":"bg-white/20"}`,children:[e.jsx(ne,{size:16}),e.jsx("span",{className:"font-bold text-sm",children:Y(x)})]})]}),e.jsxs("div",{className:"px-4 sm:px-5 md:px-6 pb-3 sm:pb-4 md:pb-5",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:["Question ",a+1," of ",d]}),e.jsxs("span",{className:"text-sm font-bold",children:[P,"%"]})]}),e.jsx("div",{className:"flex items-center gap-1",children:f.map((t,s)=>{let n="bg-white/30";return s<a?n=g[s]?"bg-[#75D06A]":"bg-[#FF8B8B]":s===a&&(n="bg-white scale-y-150 shadow-[0_0_8px_white]"),e.jsx(i.div,{className:`flex-1 h-2 rounded-full transition-all duration-300 ${n}`},s)})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-5 md:p-6 lg:p-8 relative flex flex-col bg-white/70 backdrop-blur-md",children:h==="testing"&&e.jsx(G,{mode:"wait",children:e.jsxs(i.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"flex flex-col flex-1 relative z-10",children:[e.jsxs("div",{className:"mb-4 sm:mb-6 shrink-0",children:[e.jsx("h3",{className:"font-extrabold text-[#0a1628] leading-snug break-words text-sm sm:text-base md:text-lg lg:text-xl",children:l.question_text}),e.jsx("p",{className:"text-xs sm:text-sm font-semibold opacity-70 uppercase tracking-wide text-[#9956DE] mt-2",children:"Select the correct answer"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3 md:gap-4",children:J.map(t=>{const s=l.options[t];if(!s)return null;const n=o===t;let m="bg-[#edf1f7] hover:bg-[#dde3eb] border-[#dde3eb]";return n&&(m="bg-purple-50 border-[#9956DE]"),e.jsx(i.button,{whileHover:{scale:1.01},whileTap:{scale:.99},onClick:()=>Q(t),className:`w-full text-left p-2.5 sm:p-3 md:p-4 rounded-xl border-2 transition-all ${m} cursor-pointer shadow-sm hover:shadow-md flex items-center min-h-[3rem] sm:min-h-[4rem] md:min-h-[5rem]`,children:e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 w-full min-w-0",children:[e.jsx("div",{className:`w-8 h-8 sm:w-10 sm:h-10 rounded-xl shrink-0 flex items-center justify-center font-bold text-sm sm:text-base ${n?"bg-[#9956DE] text-white shadow-inner":"bg-white text-[#0a1628] shadow-sm"}`,children:t}),e.jsx("span",{className:"font-semibold text-[#0a1628] text-xs sm:text-sm md:text-base break-words",children:s}),n&&e.jsx(re,{size:18,className:"ml-auto text-[#9956DE] flex-shrink-0"})]})},t)})})]},a)})}),e.jsx("div",{className:"p-4 sm:p-5 md:p-6 bg-[#edf1f7] border-t border-[#dde3eb]",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm text-[#5a6578]",children:o?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{size:16}),"Ready for the next one!"]}):e.jsx("span",{children:x<=10?`Auto-skipping in ${x}s...`:"Select an answer to continue"})}),e.jsxs(K,{onClick:U,disabled:!o,className:`font-bold px-6 py-2.5 sm:py-3 rounded-xl flex items-center gap-2 transition-all shadow-md hover:shadow-lg text-sm ${o?"bg-[#9956DE] hover:bg-[#8850CE] text-white shadow-[#9956DE]/20":"bg-[#dde3eb] text-slate-500 cursor-not-allowed"}`,children:[a<d-1?"Next Question":"Submit Assessment",e.jsx(ae,{size:18})]})]})}),h==="submitting"&&e.jsx(i.div,{initial:{opacity:0},animate:{opacity:1},className:"absolute inset-0 bg-white/95 backdrop-blur-xl flex items-center justify-center z-50 rounded-3xl",children:e.jsxs(i.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"text-center p-8",children:[e.jsx("div",{className:"mx-auto mb-4 h-16 w-16 rounded-full border-4 border-[#9956DE] border-t-transparent animate-spin"}),e.jsx("h2",{className:"text-2xl font-bold text-[#0a1628] mb-2",children:"Analyzing your results..."}),e.jsx("p",{className:"text-sm text-[#5a6578] max-w-xs mx-auto",children:"We're evaluating your responses and building your personalized learning path."}),C&&e.jsx("div",{className:"mt-4 p-3 bg-red-50 border border-red-200 rounded-lg max-w-sm mx-auto",children:e.jsx("p",{className:"text-sm text-red-700",children:C})})]})}),h==="results"&&e.jsx(i.div,{initial:{opacity:0},animate:{opacity:1},className:"absolute inset-0 bg-white/95 backdrop-blur-xl flex items-center justify-center z-50 rounded-3xl overflow-y-auto",children:e.jsxs(i.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",damping:25,stiffness:200},className:"text-center p-6 sm:p-8 max-w-md mx-auto",children:[e.jsx(i.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring"},className:`w-24 h-24 mx-auto rounded-full flex items-center justify-center mb-4 ${u.length>=d*.7?"bg-gradient-to-br from-[#75D06A] to-[#6ED1CF]":"bg-gradient-to-br from-[#FFB356] to-[#FF8B8B]"}`,children:u.length>=d*.7?e.jsx(W,{size:48,className:"text-white"}):e.jsx(X,{size:48,className:"text-white"})}),e.jsx("h2",{className:"text-3xl font-bold font-display text-[#0a1628] mb-2",children:"Assessment Complete!"}),e.jsxs("p",{className:"text-[#5a6578] mb-6",children:["Great job, ",$,"! Your personalized learning path is ready."]}),e.jsxs("div",{className:"bg-gradient-to-br from-[#1FA7E1]/10 to-[#6ED1CF]/10 rounded-2xl p-5 mb-5",children:[e.jsxs("div",{className:"text-sm text-[#5a6578] mb-2",children:["You answered ",u.length," questions"]}),e.jsx("div",{className:"text-xs text-[#5a6578]",children:"Results will be available shortly..."})]}),e.jsx("p",{className:"text-xs text-slate-400 mb-4",children:"Redirecting to dashboard..."})]})})]})})};export{Se as default};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pipelineService-D7yl0SJO.js","assets/index-Bp7MiGcW.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-Dja0MwoB.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{e as V,_ as M,m as i,Z,h as G,T as H,F as W,r as X}from"./index-Bp7MiGcW.js";import{r,j as e}from"./vendor-react-B4AQeu28.js";import{B as K}from"./button-BMVm9YQO.js";import{s as ee}from"./diagnosticService-E5zPXoFs.js";import{M as te}from"./maximize-2-CWmKKmit.js";import{X as se}from"./x-k8d6VLEw.js";import{C as ne}from"./clock-Cc6sJz1J.js";import{C as re}from"./circle-check-big-JdaMs3bP.js";import{C as ae}from"./chevron-right-BxoysOas.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
| 6 |
* See the LICENSE file in the root directory of this source tree.
|
| 7 |
+
*/const ie=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],le=V("minimize-2",ie),Se=({testId:T,questions:f,userName:$,onComplete:B,onCancel:L})=>{const[h,_]=r.useState("testing"),[a,S]=r.useState(0),[o,b]=r.useState(null),[u,E]=r.useState(()=>{try{const t=sessionStorage.getItem("mathpulse_diagnostic_responses");return t?JSON.parse(t):[]}catch{return[]}}),[g,k]=r.useState([]),[x,z]=r.useState(0),[C,D]=r.useState(null),[A,w]=r.useState(!1),c=r.useRef(null),F=r.useRef(Date.now()),p=r.useRef(!1),d=f.length,l=f[a],P=Math.round((a+(o?1:0))/d*100),v=t=>t==="easy"?60:t==="hard"?120:90,[q]=r.useState(Array.from({length:10},(t,s)=>({id:s,size:Math.random()*80+30,x:Math.random()*100,y:Math.random()*100,duration:Math.random()*20+15,delay:Math.random()*-20,color:["bg-purple-500/10","bg-blue-500/10","bg-cyan-500/10","bg-emerald-500/10"][Math.floor(Math.random()*4)]})));r.useEffect(()=>{const t=v(l?.difficulty||"medium");return F.current=Date.now(),p.current=!1,z(t),c.current&&clearInterval(c.current),c.current=setInterval(()=>{const s=Math.floor((Date.now()-F.current)/1e3),n=Math.max(0,t-s);z(n),n<=0&&!p.current&&(p.current=!0,clearInterval(c.current))},250),()=>{c.current&&clearInterval(c.current)}},[a]),r.useEffect(()=>{if(x===0&&p.current&&h==="testing"){const t=v(l?.difficulty||"medium"),s=[...u,{question_id:l.question_id,student_answer:o||"",time_spent_seconds:t}],n=[...g,!1];k(n),E(s),b(null),a<d-1?S(m=>m+1):I(s)}},[x]);const O=r.useCallback(()=>{const t=document.getElementById("assessment-container");t&&(document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen().then(()=>{w(!1)}).catch(s=>{console.error("Exit fullscreen error:",s)}):t.requestFullscreen().then(()=>{w(!0)}).catch(s=>{console.error("Fullscreen error:",s)}))},[]);r.useEffect(()=>{const t=()=>{w(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)},[]);const Q=t=>{b(t)},U=()=>{if(!o)return;c.current&&clearInterval(c.current);const t=v(l?.difficulty||"medium")-x,s=[...g,!0],n=[...u,{question_id:l.question_id,student_answer:o,time_spent_seconds:t}];k(s),E(n),b(null),a<d-1?S(m=>m+1):I(n)},I=async t=>{_("submitting"),D(null);try{sessionStorage.setItem("mathpulse_diagnostic_responses",JSON.stringify(t))}catch{}try{const s=await ee(T,t);sessionStorage.removeItem("mathpulse_diagnostic"),sessionStorage.removeItem("mathpulse_diagnostic_responses"),_("results");try{const{emitPipelineEvent:n,getStudentContext:m}=await M(async()=>{const{emitPipelineEvent:j,getStudentContext:N}=await import("./pipelineService-D7yl0SJO.js");return{emitPipelineEvent:j,getStudentContext:N}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),{auth:R}=await M(async()=>{const{auth:j}=await import("./index-Bp7MiGcW.js").then(N=>N.b7);return{auth:j}},__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11,12])),y=m();y&&R.currentUser&&n({student_id:R.currentUser.uid,event_type:"diagnostic",event_data:{overall_score:s.overall_score_percent,mastery_summary:s.mastery_summary},occurred_at:new Date().toISOString(),class_id:y.classId,teacher_id:y.teacherId})}catch{}setTimeout(()=>{B({overallRisk:s.overall_risk,overallScorePercent:s.overall_score_percent,intervention:s.recommended_intervention,xpEarned:s.xp_earned,badgeUnlocked:s.badge_unlocked})},3e3)}catch(s){const n=s instanceof Error?s.message:"Submission failed. Your answers are saved locally.";D(n)}},Y=t=>{const s=Math.floor(t/60),n=t%60;return`${s}:${n.toString().padStart(2,"0")}`},J=["A","B","C","D"];return e.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-md flex items-center justify-center p-4 sm:p-6 overflow-hidden",children:e.jsxs("div",{id:"assessment-container",className:"bg-white/95 backdrop-blur-xl border border-white/20 rounded-3xl shadow-[0_0_50px_rgba(0,0,0,0.3)] w-full max-w-4xl h-[95vh] sm:h-[90vh] md:h-[85vh] flex flex-col relative z-10 overflow-hidden transition-all duration-300",children:[e.jsx("div",{className:"absolute inset-0 pointer-events-none z-0 overflow-hidden",children:q.map(t=>e.jsx(i.div,{className:`absolute rounded-full blur-3xl ${t.color.replace("/10","/30")}`,style:{width:t.size*1.5,height:t.size*1.5,left:`${t.x}%`,top:`${t.y}%`},animate:{x:[0,Math.random()*100-50,0],y:[0,Math.random()*100-50,0],scale:[1,1.3,1]},transition:{duration:t.duration,repeat:1/0,ease:"linear",delay:t.delay}},t.id))}),e.jsxs(i.div,{className:"shrink-0 text-white border-b border-white/10 shadow-md relative z-10",style:{backgroundColor:"#9956DE"},children:[e.jsxs("div",{className:"flex items-center justify-between p-4 sm:p-5 md:p-6",children:[e.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[e.jsx("h2",{className:"text-lg sm:text-xl md:text-2xl font-bold truncate",children:"Diagnostic Assessment"}),e.jsxs("p",{className:"text-white/80 text-xs sm:text-sm font-medium truncate",children:[l.domain," β’ ",l.difficulty]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:O,className:"w-9 h-9 sm:w-10 sm:h-10 bg-white/20 hover:bg-white/30 rounded-xl flex items-center justify-center transition-colors",title:A?"Exit Fullscreen":"Enter Fullscreen",children:A?e.jsx(le,{size:18}):e.jsx(te,{size:18})}),e.jsx("button",{onClick:L,className:"w-9 h-9 sm:w-10 sm:h-10 bg-white/20 hover:bg-white/30 rounded-xl flex items-center justify-center transition-colors",children:e.jsx(se,{size:20})})]})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 md:px-6 pb-3 sm:pb-4 md:pb-5",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{className:"bg-white/20 px-3 py-1 rounded-full flex items-center gap-1",children:[e.jsx(Z,{size:16}),e.jsxs("span",{className:"font-bold text-sm",children:[u.length," / ",d]})]})}),e.jsxs("div",{className:`flex items-center gap-1 px-3 py-1 rounded-full ${x<=10?"bg-red-500/80 animate-pulse":"bg-white/20"}`,children:[e.jsx(ne,{size:16}),e.jsx("span",{className:"font-bold text-sm",children:Y(x)})]})]}),e.jsxs("div",{className:"px-4 sm:px-5 md:px-6 pb-3 sm:pb-4 md:pb-5",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:["Question ",a+1," of ",d]}),e.jsxs("span",{className:"text-sm font-bold",children:[P,"%"]})]}),e.jsx("div",{className:"flex items-center gap-1",children:f.map((t,s)=>{let n="bg-white/30";return s<a?n=g[s]?"bg-[#75D06A]":"bg-[#FF8B8B]":s===a&&(n="bg-white scale-y-150 shadow-[0_0_8px_white]"),e.jsx(i.div,{className:`flex-1 h-2 rounded-full transition-all duration-300 ${n}`},s)})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-5 md:p-6 lg:p-8 relative flex flex-col bg-white/70 backdrop-blur-md",children:h==="testing"&&e.jsx(G,{mode:"wait",children:e.jsxs(i.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"flex flex-col flex-1 relative z-10",children:[e.jsxs("div",{className:"mb-4 sm:mb-6 shrink-0",children:[e.jsx("h3",{className:"font-extrabold text-[#0a1628] leading-snug break-words text-sm sm:text-base md:text-lg lg:text-xl",children:l.question_text}),e.jsx("p",{className:"text-xs sm:text-sm font-semibold opacity-70 uppercase tracking-wide text-[#9956DE] mt-2",children:"Select the correct answer"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-3 md:gap-4",children:J.map(t=>{const s=l.options[t];if(!s)return null;const n=o===t;let m="bg-[#edf1f7] hover:bg-[#dde3eb] border-[#dde3eb]";return n&&(m="bg-purple-50 border-[#9956DE]"),e.jsx(i.button,{whileHover:{scale:1.01},whileTap:{scale:.99},onClick:()=>Q(t),className:`w-full text-left p-2.5 sm:p-3 md:p-4 rounded-xl border-2 transition-all ${m} cursor-pointer shadow-sm hover:shadow-md flex items-center min-h-[3rem] sm:min-h-[4rem] md:min-h-[5rem]`,children:e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 w-full min-w-0",children:[e.jsx("div",{className:`w-8 h-8 sm:w-10 sm:h-10 rounded-xl shrink-0 flex items-center justify-center font-bold text-sm sm:text-base ${n?"bg-[#9956DE] text-white shadow-inner":"bg-white text-[#0a1628] shadow-sm"}`,children:t}),e.jsx("span",{className:"font-semibold text-[#0a1628] text-xs sm:text-sm md:text-base break-words",children:s}),n&&e.jsx(re,{size:18,className:"ml-auto text-[#9956DE] flex-shrink-0"})]})},t)})})]},a)})}),e.jsx("div",{className:"p-4 sm:p-5 md:p-6 bg-[#edf1f7] border-t border-[#dde3eb]",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm text-[#5a6578]",children:o?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(H,{size:16}),"Ready for the next one!"]}):e.jsx("span",{children:x<=10?`Auto-skipping in ${x}s...`:"Select an answer to continue"})}),e.jsxs(K,{onClick:U,disabled:!o,className:`font-bold px-6 py-2.5 sm:py-3 rounded-xl flex items-center gap-2 transition-all shadow-md hover:shadow-lg text-sm ${o?"bg-[#9956DE] hover:bg-[#8850CE] text-white shadow-[#9956DE]/20":"bg-[#dde3eb] text-slate-500 cursor-not-allowed"}`,children:[a<d-1?"Next Question":"Submit Assessment",e.jsx(ae,{size:18})]})]})}),h==="submitting"&&e.jsx(i.div,{initial:{opacity:0},animate:{opacity:1},className:"absolute inset-0 bg-white/95 backdrop-blur-xl flex items-center justify-center z-50 rounded-3xl",children:e.jsxs(i.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"text-center p-8",children:[e.jsx("div",{className:"mx-auto mb-4 h-16 w-16 rounded-full border-4 border-[#9956DE] border-t-transparent animate-spin"}),e.jsx("h2",{className:"text-2xl font-bold text-[#0a1628] mb-2",children:"Analyzing your results..."}),e.jsx("p",{className:"text-sm text-[#5a6578] max-w-xs mx-auto",children:"We're evaluating your responses and building your personalized learning path."}),C&&e.jsx("div",{className:"mt-4 p-3 bg-red-50 border border-red-200 rounded-lg max-w-sm mx-auto",children:e.jsx("p",{className:"text-sm text-red-700",children:C})})]})}),h==="results"&&e.jsx(i.div,{initial:{opacity:0},animate:{opacity:1},className:"absolute inset-0 bg-white/95 backdrop-blur-xl flex items-center justify-center z-50 rounded-3xl overflow-y-auto",children:e.jsxs(i.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",damping:25,stiffness:200},className:"text-center p-6 sm:p-8 max-w-md mx-auto",children:[e.jsx(i.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring"},className:`w-24 h-24 mx-auto rounded-full flex items-center justify-center mb-4 ${u.length>=d*.7?"bg-gradient-to-br from-[#75D06A] to-[#6ED1CF]":"bg-gradient-to-br from-[#FFB356] to-[#FF8B8B]"}`,children:u.length>=d*.7?e.jsx(W,{size:48,className:"text-white"}):e.jsx(X,{size:48,className:"text-white"})}),e.jsx("h2",{className:"text-3xl font-bold font-display text-[#0a1628] mb-2",children:"Assessment Complete!"}),e.jsxs("p",{className:"text-[#5a6578] mb-6",children:["Great job, ",$,"! Your personalized learning path is ready."]}),e.jsxs("div",{className:"bg-gradient-to-br from-[#1FA7E1]/10 to-[#6ED1CF]/10 rounded-2xl p-5 mb-5",children:[e.jsxs("div",{className:"text-sm text-[#5a6578] mb-2",children:["You answered ",u.length," questions"]}),e.jsx("div",{className:"text-xs text-[#5a6578]",children:"Results will be available shortly..."})]}),e.jsx("p",{className:"text-xs text-slate-400 mb-4",children:"Redirecting to dashboard..."})]})})]})})};export{Se as default};
|
assets/AvatarShop-DZiViM0D.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
| 1 |
-
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{e as se,L as ae,g as re,f as oe}from"./vendor-radix-C5nwdvGr.js";import{e as S,u as le,L as w,a6 as R,m as y,h as ie,j as c,aP as ne,aQ as ce}from"./index-BufUS6SI.js";import{u as de}from"./useFeatureAccess-D82RK3T0.js";import{T as me,a as ue,b as xe}from"./tooltip-qcWo8nUO.js";import{C as pe}from"./CompositeAvatar-Col05lJc.js";import{M as j}from"./avatarData-BuQSOXo3.js";import{S as O}from"./save-CwINi309.js";import{S as V}from"./sparkles-DYlMf97S.js";import{S as fe}from"./shirt-18q8_SAr.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
-
* @license lucide-react v0.487.0 - ISC
|
| 3 |
-
*
|
| 4 |
-
* This source code is licensed under the ISC license.
|
| 5 |
-
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
-
*/const he=[["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"}]],be=S("footprints",he);/**
|
| 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 ve=[["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"}]],ge=S("scissors",ve);/**
|
| 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 we=[["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"}]],N=S("shopping-bag",we),ye=`
|
| 17 |
-
@keyframes avatar-float {
|
| 18 |
-
0%, 100% { transform: translateY(-8px); }
|
| 19 |
-
50% { transform: translateY(8px); }
|
| 20 |
-
}
|
| 21 |
-
@keyframes spin-slow {
|
| 22 |
-
from { transform: rotate(0deg); }
|
| 23 |
-
to { transform: rotate(360deg); }
|
| 24 |
-
}
|
| 25 |
-
.animate-avatar-float {
|
| 26 |
-
animation: avatar-float 4s ease-in-out infinite;
|
| 27 |
-
}
|
| 28 |
-
.animate-spin-slow {
|
| 29 |
-
animation: spin-slow 1s linear infinite;
|
| 30 |
-
}
|
| 31 |
-
`,X=["Wow!","Cute!","I love it!","Perfect!","So cool!","Awesome!"],q=["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!"],Y="top_blue",F="mathpulse:avatar-inventory:v2",je=600*1e3,Ne=2e4,Ye=({onSaveProfile:k,onNavigateToModules:U})=>{const{userProfile:l,refreshProfile:$,currentUser:D}=le(),{cosmeticShop:B,loading:H}=de(D?.uid||null),G=!1,[m,A]=i.useState({top:l?.avatarLayers?.top??Y,bottom:l?.avatarLayers?.bottom||"",shoes:l?.avatarLayers?.shoes||"",accessory:l?.avatarLayers?.accessory||""}),[x,p]=i.useState(!1),[f,E]=i.useState([]),[K,T]=i.useState(0),[P,_]=i.useState(null),[d,h]=i.useState(null),[I,z]=i.useState(j),[Z,J]=i.useState("top"),C=i.useRef(l);C.current=l;const b=i.useRef(!1),v=i.useRef(null);i.useEffect(()=>{if(typeof window>"u")return;const t=Date.now();try{const o=sessionStorage.getItem(F);if(o){const s=JSON.parse(o);if(Array.isArray(s.items)&&typeof s.expiresAt=="number"&&s.expiresAt>t){z(s.items);return}}}catch{}z(j);try{sessionStorage.setItem(F,JSON.stringify({expiresAt:t+je,items:j}))}catch{}},[]),i.useEffect(()=>{if(l&&l.role==="student"){const t=l;E(t.ownedAvatarItems||[]),T(t.currentXP||0)}},[l]),i.useEffect(()=>{A({top:l?.avatarLayers?.top??Y,bottom:l?.avatarLayers?.bottom||"",shoes:l?.avatarLayers?.shoes||"",accessory:l?.avatarLayers?.accessory||""})},[]),i.useEffect(()=>{if(!d){const t=setInterval(()=>{Math.random()>.6&&h(q[Math.floor(Math.random()*q.length)])},4e3);return()=>clearInterval(t)}},[d]),i.useEffect(()=>{if(d){const t=setTimeout(()=>{h(null)},3500);return()=>clearTimeout(t)}},[d]);const Q=(t,o)=>{const s=I.find(n=>n.id===o);if(s&&(s.price&&s.price>0||s.isReward)&&!f.includes(o)){c.error("This item is locked. Earn or purchase it first!");return}const a={...m,[t]:m[t]===o?"":o};A(a),h(X[Math.floor(Math.random()*X.length)]),g(a,{showSuccessToast:!1,showSavingState:!1})},W=async(t,o,s)=>{if(t.stopPropagation(),!l?.uid){c.error("You must be logged in to purchase items");return}if(f.includes(o)){c.info("You already own this item");return}_(o);try{const a=await ne(l.uid,o,s);a.success?(c.success(a.message||"Item purchased!"),E(n=>[...n,o]),a.currentXP!==void 0&&T(a.currentXP),await $()):c.error(a.message||"Failed to purchase item")}catch(a){console.error("Purchase error:",a),c.error("Error purchasing item")}finally{_(null)}},L=t=>({top:typeof t.top=="string"?t.top:"",bottom:typeof t.bottom=="string"?t.bottom:"",shoes:typeof t.shoes=="string"?t.shoes:"",accessory:typeof t.accessory=="string"?t.accessory:""}),ee=(t,o,s)=>{let a;const n=new Promise((r,u)=>{a=setTimeout(()=>{u(new Error(`${s} timed out after ${Math.round(o/1e3)}s`))},o)});return Promise.race([t,n]).finally(()=>{a!==void 0&&clearTimeout(a)})},g=async(t,o={})=>{const s=C.current;if(!s?.uid)return;const{showSuccessToast:a=!0,showSavingState:n=!0}=o;if(b.current){v.current={layers:L(t),options:{showSuccessToast:a,showSavingState:n}},n&&p(!0);return}b.current=!0,n&&p(!0);try{const r=L(t);await ee(ce(s.uid,{avatarLayers:r}),Ne,"Avatar save"),k&&k(r),a&&c.success("Avatar saved successfully")}catch(r){if(console.error(r),a){const u=r instanceof Error&&r.message.includes("timed out");c.error(u?"Avatar save timed out. Please try again.":"Failed to save avatar")}}finally{const r=v.current;if(v.current=null,b.current=!1,r){g(r.layers,r.options);return}(n||x)&&p(!1)}},te=async()=>{await g(m,{showSuccessToast:!0,showSavingState:!0})},M=[{id:"top",label:"Tops",icon:e.jsx(fe,{size:16})},{id:"bottom",label:"Bottoms",icon:e.jsx(ge,{size:16,className:"rotate-90"})},{id:"shoes",label:"Shoes",icon:e.jsx(be,{size:16})},{id:"accessory",label:"Accessories",icon:e.jsx(R,{size:16})}];return H?e.jsxs("div",{className:"flex flex-col justify-center items-center h-[500px] gap-3",children:[e.jsx("div",{className:"animate-spin",children:e.jsx(O,{size:24,className:"opacity-50"})}),e.jsx("p",{className:"text-sm text-slate-400 font-medium",children:"Loading..."})]}):B?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:ye}),e.jsx("div",{className:"h-full w-full flex items-start xl:items-center justify-center p-4 sm:p-6 lg:p-8 overflow-y-auto xl:overflow-hidden",children:e.jsxs("div",{className:"relative w-full max-w-[1000px] min-h-[500px] xl:h-[80vh] xl: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-8 xl:gap-12 overflow-visible xl: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 xl:h-full min-h-0 relative z-10 w-full xl:w-[50%] mx-auto xl:mx-0 flex-1",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(V,{className:"text-blue-500 fill-blue-500",size:28})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[G,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(N,{className:"text-white shrink-0",size:16}),e.jsxs(me,{children:[e.jsx(ue,{asChild:!0,children:e.jsxs("button",{onClick:U,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:K})]})}),e.jsx(xe,{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(se,{value:Z,onValueChange:t=>J(t),className:"flex flex-col flex-1 min-h-0",children:[e.jsx(ae,{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:M.map(t=>e.jsxs(re,{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:M.map(t=>{const o=I.filter(s=>s.category===t.id);return e.jsx(oe,{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(R,{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 a=m[t.id]===s.id,n=f.includes(s.id),r=!!((s.price&&s.price>0||s.isReward)&&!n);return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{onClick:()=>!r&&Q(t.id,s.id),disabled:r,className:`relative w-full aspect-square rounded-2xl border-2 transition-all flex flex-col items-center justify-center group ${a&&!r?"bg-white border-blue-500 shadow-md scale-[1.02] z-10":r?"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:[a&&!r&&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(V,{size:9,className:"fill-white"})]}),r&&e.jsx("div",{className:"absolute inset-0 bg-black/20 z-20 flex items-center justify-center rounded-[1rem]",children:e.jsx(w,{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 e-filter ${!r&&"group-hover:scale-110"}`,style:{"--filter":r?"grayscale(70%)":"none"}})]}),e.jsx("p",{className:"text-xs font-bold text-slate-700 text-center line-clamp-2",children:s.name}),r&&(s.isReward?e.jsxs("div",{className:"w-full py-1 bg-slate-200 text-slate-500 text-[9px] font-bold flex items-center justify-center gap-1 rounded shadow-sm border border-slate-300",children:[e.jsx(w,{size:11})," Exclusive Reward"]}):e.jsx(y.button,{initial:{opacity:0},animate:{opacity:1},onClick:u=>W(u,s.id,s.price||0),disabled:P===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:P===s.id?e.jsx(y.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1},children:e.jsx(N,{size:11})}):e.jsxs(e.Fragment,{children:[e.jsx(N,{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] max-w-[420px] xl:max-w-none shrink-0 xl:self-center mx-auto xl:mx-0",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 avatar-gloss"}),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("div",{className:"relative w-full h-[80%] z-10 flex justify-center items-center animate-avatar-float",children:[e.jsx(pe,{layers:m,className:"w-full h-full absolute inset-0 z-20"}),e.jsx(ie,{children:d&&e.jsxs(y.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:[d,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:te,disabled:x,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:[x?e.jsx("div",{className:"animate-spin-slow",children:e.jsx(O,{size:24,className:"opacity-50"})}):null,x?"Saving...":"Save Profile Avatar"]})]})]})})]}):e.jsxs("div",{className:"flex flex-col justify-center items-center h-[500px] gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-slate-100 flex items-center justify-center",children:e.jsx(w,{className:"w-7 h-7 text-slate-400"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-700 mb-1",children:"Avatar Shop Locked"}),e.jsx("p",{className:"text-xs text-slate-400",children:"This feature is temporarily unavailable while you focus on your learning."})]})]})};export{Ye as default};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/AvatarShop-DqyERXR_.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{e as Ee,L as Pe,g as Ae,f as ze}from"./vendor-radix-C5nwdvGr.js";import{e as Y,u as Te,j as h,L as oe,h as le,m as S,y as Ie,a6 as ie,a7 as E,aP as Me,aQ as _e}from"./index-Bp7MiGcW.js";import{u as Ce}from"./useFeatureAccess-O2Vj4dYD.js";import{T as Re,a as qe,b as Xe}from"./tooltip-nLNeX3nd.js";import{C as Fe}from"./CompositeAvatar-DoKZfi7O.js";import{M as Oe,E as Ue}from"./avatarData-ChByUhv2.js";import{S as P}from"./save-D7oNX_Ki.js";import{X as Ve}from"./x-k8d6VLEw.js";import{S as Ye}from"./shirt-C1GQiNvP.js";import{S as $e}from"./sparkles-fLB3ltj1.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
+
* @license lucide-react v0.487.0 - ISC
|
| 3 |
+
*
|
| 4 |
+
* This source code is licensed under the ISC license.
|
| 5 |
+
* See the LICENSE file in the root directory of this source tree.
|
| 6 |
+
*/const Be=[["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"}]],De=Y("footprints",Be);/**
|
| 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 Ge=[["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"}]],Ze=Y("scissors",Ge);/**
|
| 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 He=[["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"}]],U=Y("shopping-bag",He),Ke=`
|
| 17 |
+
@keyframes avatar-float { 0%, 100% { transform: translateY(-8px); } 50% { transform: translateY(8px); } }
|
| 18 |
+
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
|
| 19 |
+
.animate-avatar-float { animation: avatar-float 4s ease-in-out infinite; }
|
| 20 |
+
.animate-spin-slow { animation: spin-slow 1s linear infinite; }
|
| 21 |
+
`,ne=["Wow!","Cute!","I love it!","Perfect!","So cool!","Awesome!"],ce=["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!"],V="top_blue",Qe=2e4,pt=({onSaveProfile:$,onNavigateToModules:de,unsavedChangesRef:A,onConfirmLeave:k,pendingNavigation:B,onCancelNavigation:D})=>{const{userProfile:i,refreshProfile:ue,currentUser:xe}=Te(),{cosmeticShop:me,loading:fe}=Ce(xe?.uid||null),he=!1,[n,p]=l.useState({top:i?.avatarLayers?.top??V,bottom:i?.avatarLayers?.bottom||"",shoes:i?.avatarLayers?.shoes||"",accessory:i?.avatarLayers?.accessory||""}),[x,G]=l.useState({top:i?.avatarLayers?.top??V,bottom:i?.avatarLayers?.bottom||"",shoes:i?.avatarLayers?.shoes||"",accessory:i?.avatarLayers?.accessory||""}),[z,T]=l.useState(!1),[w,Z]=l.useState([]),[pe,H]=l.useState(0),[K,Q]=l.useState(null),[g,b]=l.useState(null),v=Oe,[W,be]=l.useState("top"),[ve,L]=l.useState(!1),[m,I]=l.useState(!1),M=l.useRef(!1),[_,C]=l.useState(0),y=l.useRef(null),J=l.useRef({top:"",bottom:"",shoes:"",accessory:""}),ee=l.useRef(i);ee.current=i;const R=l.useRef(!1),q=l.useRef(null),j=l.useMemo(()=>n.top!==x.top||n.bottom!==x.bottom||n.shoes!==x.shoes||n.accessory!==x.accessory,[n,x]),te=l.useMemo(()=>[n.top,n.bottom,n.shoes,n.accessory].filter(Boolean).some(o=>{const t=v.find(r=>r.id===o);return(t?.isExclusive||t?.isReward)&&!w.includes(o)}),[n,v,w]);l.useEffect(()=>{A&&(A.current=j)},[j,A]),l.useEffect(()=>{B&&j&&L(!0)},[B,j]),l.useEffect(()=>{if(i&&i.role==="student"){const s=i;Z(s.ownedAvatarItems||[]),H(s.currentXP||0)}},[i]),l.useEffect(()=>{const s={top:i?.avatarLayers?.top??V,bottom:i?.avatarLayers?.bottom||"",shoes:i?.avatarLayers?.shoes||"",accessory:i?.avatarLayers?.accessory||""};p(s),G(s)},[i?.uid]),l.useEffect(()=>{if(!g){const s=setInterval(()=>{Math.random()>.6&&b(ce[Math.floor(Math.random()*ce.length)])},5e3);return()=>clearInterval(s)}},[g]),l.useEffect(()=>{if(g){const s=setTimeout(()=>b(null),3500);return()=>clearTimeout(s)}},[g]);const se=(s,o)=>{const t=v.find(a=>a.id===o);if(!t)return;y.current&&(clearTimeout(y.current),y.current=null);const r={...n};if(J.current=r,I(!0),M.current=!0,t.setLayers){const a={...r};t.setLayers.top&&(a.top=t.setLayers.top),t.setLayers.bottom&&(a.bottom=t.setLayers.bottom),t.setLayers.shoes&&(a.shoes=t.setLayers.shoes),t.setLayers.accessory&&(a.accessory=t.setLayers.accessory),p(a)}else p({...r,[s]:o});b("Preview only!"),C(3);const d=setInterval(()=>{C(a=>a<=1?(clearInterval(d),0):a-1)},1e3);y.current=setTimeout(()=>{clearInterval(d),p(r),C(0),I(!1),M.current=!1,b(null),y.current=null},3e3)},ye=l.useCallback((s,o)=>{const t=v.find(u=>u.id===o);if(!t)return;const r=w.includes(o),d=!!((t.price&&t.price>0||t.isReward)&&!r);if(m&&y.current&&(clearTimeout(y.current),I(!1),M.current=!1,p(J.current)),t.setLayers){const u={...n};t.setLayers.top&&(u.top=t.setLayers.top),t.setLayers.bottom&&(u.bottom=t.setLayers.bottom),t.setLayers.shoes&&(u.shoes=t.setLayers.shoes),t.setLayers.accessory&&(u.accessory=t.setLayers.accessory),p(u),b(t.isExclusive&&!r?"Preview only!":"Full set equipped!");return}if(d&&!t.isExclusive){h.error("This item is locked. Earn or purchase it first!");return}let a={...n};const f=v.filter(u=>u.setLayers),c=new Set(f.flatMap(u=>Object.values(u.setLayers||{})));(c.has(a.top||"")||c.has(a.bottom||"")||c.has(a.shoes||"")||c.has(a.accessory||""))&&(c.has(a.top||"")&&(a.top=x.top),c.has(a.bottom||"")&&(a.bottom=x.bottom),c.has(a.shoes||"")&&(a.shoes=x.shoes),c.has(a.accessory||"")&&(a.accessory=x.accessory));const N={...a,[s]:a[s]===o?"":o};p(N),t.isExclusive&&!r?b("Preview only!"):b(ne[Math.floor(Math.random()*ne.length)])},[n,v,w,m]),we=async(s,o,t)=>{if(s.stopPropagation(),!i?.uid){h.error("You must be logged in");return}if(w.includes(o)){h.info("You already own this item");return}Q(o);try{const r=await Me(i.uid,o,t);r.success?(h.success(r.message||"Item purchased!"),Z(d=>[...d,o]),r.currentXP!==void 0&&H(r.currentXP),await ue()):h.error(r.message||"Failed to purchase")}catch(r){console.error(r),h.error("Error purchasing item")}finally{Q(null)}},ae=s=>({top:typeof s.top=="string"?s.top:"",bottom:typeof s.bottom=="string"?s.bottom:"",shoes:typeof s.shoes=="string"?s.shoes:"",accessory:typeof s.accessory=="string"?s.accessory:""}),ge=(s,o,t)=>{let r;const d=new Promise((a,f)=>{r=setTimeout(()=>f(new Error(`${t} timed out`)),o)});return Promise.race([s,d]).finally(()=>{r&&clearTimeout(r)})},X=async(s,o={})=>{const t=ee.current;if(!t?.uid)return;const{showSuccessToast:r=!0,showSavingState:d=!0}=o;if(R.current){q.current={layers:ae(s),options:o},d&&T(!0);return}R.current=!0,d&&T(!0);try{const a=ae(s);await ge(_e(t.uid,{avatarLayers:a}),Qe,"Avatar save"),$&&$(a),G(a),r&&h.success("Avatar saved!")}catch(a){console.error(a),r&&h.error(a instanceof Error&&a.message.includes("timed out")?"Save timed out.":"Failed to save")}finally{const a=q.current;if(q.current=null,R.current=!1,a){X(a.layers,a.options);return}(d||z)&&T(!1)}},je=async()=>{if(!m){if(te){h.error("You need to purchase this item first to save it.");return}await X(n,{showSuccessToast:!0,showSavingState:!0})}},Ne=async()=>{L(!1),te||await X(n,{showSuccessToast:!0,showSavingState:!0}),k&&k()},Se=()=>{L(!1),p(x),k&&k()},F=[{id:"top",label:"Tops",icon:e.jsx(Ye,{size:16})},{id:"bottom",label:"Bottoms",icon:e.jsx(Ze,{size:16,className:"rotate-90"})},{id:"shoes",label:"Shoes",icon:e.jsx(De,{size:16})},{id:"accessory",label:"Accessories",icon:e.jsx(ie,{size:16})},{id:"exclusive",label:"Exclusive",icon:e.jsx(E,{size:16,className:W==="exclusive"?"text-white fill-white":"text-amber-500 fill-amber-500"})}];if(fe)return e.jsxs("div",{className:"flex flex-col justify-center items-center h-[500px] gap-3",children:[e.jsx("div",{className:"animate-spin",children:e.jsx(P,{size:24,className:"opacity-50"})}),e.jsx("p",{className:"text-sm text-slate-400 font-medium",children:"Loading..."})]});if(!me)return e.jsxs("div",{className:"flex flex-col justify-center items-center h-[500px] gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-slate-100 flex items-center justify-center",children:e.jsx(oe,{className:"w-7 h-7 text-slate-400"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-700 mb-1",children:"Avatar Shop Locked"}),e.jsx("p",{className:"text-xs text-slate-400",children:"This feature is temporarily unavailable."})]})]});const ke=s=>s==="exclusive"?Ue:v.filter(o=>o.category===s&&!o.isExclusive),Le=s=>{const o=ke(s);if(o.length===0){const t=s==="exclusive"?"Exclusive items":F.find(r=>r.id===s)?.label||"Items";return e.jsxs("div",{className:"w-full min-h-[200px] flex flex-col items-center justify-center border-2 border-dashed border-slate-200 rounded-2xl bg-slate-50/50 p-6 text-center",children:[e.jsx(ie,{size:40,className:"text-slate-300 mb-3 opacity-50"}),e.jsxs("h3",{className:"font-bold text-lg text-slate-500 mb-1",children:[t," coming soon"]}),e.jsx("p",{className:"text-slate-400 text-sm max-w-xs",children:"We're crafting some awesome gear for your avatar!"})]})}return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 p-1",children:o.map(t=>{const r=t.category,d=t.setLayers?Object.entries(t.setLayers).every(([O,re])=>!re||n[O]===re):n[r]===t.id,a=w.includes(t.id),f=!!t.isExclusive,c=!!((t.price&&t.price>0||t.isReward)&&!a),N=f&&!a,u=d&&N;return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("button",{onClick:()=>{c||ye(r,t.id)},disabled:c,className:`relative w-full aspect-square rounded-xl border-2 transition-all flex items-center justify-center group ${u?"bg-gradient-to-br from-amber-50 to-orange-50 border-amber-400 shadow-md scale-[1.02] z-10":d&&!c?"bg-white border-blue-500 shadow-md scale-[1.02] z-10":c&&!f?"bg-slate-50 border-slate-200 opacity-50 cursor-not-allowed":N?"bg-slate-50 border-slate-200 opacity-60 cursor-default":"bg-white border-slate-100 hover:border-sky-300 hover:shadow-md hover:scale-[1.02]"}`,children:[u&&e.jsxs("div",{className:"absolute top-1 left-1/2 -translate-x-1/2 px-1.5 py-0.5 bg-gradient-to-r from-amber-500 to-orange-400 text-white text-[8px] font-black rounded-full flex items-center gap-0.5 z-10 whitespace-nowrap",children:["Preview ",e.jsx(E,{size:8,className:"fill-white"})]}),d&&!c&&!u&&e.jsxs("div",{className:"absolute top-1 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-[8px] font-black rounded-full flex items-center gap-0.5 z-10 whitespace-nowrap",children:["Equipped ",e.jsx($e,{size:8,className:"fill-white"})]}),c&&!f&&e.jsx("div",{className:"absolute inset-0 bg-black/20 z-20 flex items-center justify-center rounded-[10px]",children:e.jsx(oe,{className:"text-white",size:20})}),e.jsx("img",{src:t.thumbnail,alt:t.name,className:`w-[80%] h-[80%] object-contain transition-transform ${c&&!f?"":"group-hover:scale-110"}`})]}),e.jsx("p",{className:"text-xs font-bold text-slate-700 text-center line-clamp-2",children:t.name}),c&&!f&&!t.isReward&&e.jsx(S.button,{initial:{opacity:0},animate:{opacity:1},onClick:O=>we(O,t.id,t.price||0),disabled:K===t.id,className:"w-full py-0.5 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===t.id?e.jsx(S.div,{animate:{rotate:360},transition:{repeat:1/0,duration:1},children:e.jsx(U,{size:10})}):e.jsxs(e.Fragment,{children:[e.jsx(U,{size:10})," ",t.price," XP"]})}),N&&!t.setLayers&&e.jsxs("button",{onClick:()=>se(r,t.id),disabled:m,className:`w-full py-1 text-[11px] font-bold flex items-center justify-center gap-1 rounded-lg border transition-colors ${m?"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed":"bg-amber-50 hover:bg-amber-100 text-amber-600 border-amber-200 cursor-pointer"}`,children:[e.jsx(E,{size:11})," Preview"]}),N&&t.setLayers&&e.jsxs("button",{onClick:()=>se(r,t.id),disabled:m,className:`w-full py-1 text-[11px] font-bold flex items-center justify-center gap-1 rounded-lg border transition-colors ${m?"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed":"bg-amber-50 hover:bg-amber-100 text-amber-600 border-amber-200 cursor-pointer"}`,children:[e.jsx(E,{size:11})," Preview Set"]})]},t.id)})})};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:Ke}),e.jsx("div",{className:"h-full w-full flex items-start xl:items-center justify-center p-4 sm:p-5 lg:p-6 overflow-y-auto xl:overflow-hidden",children:e.jsxs("div",{className:"relative w-full max-w-6xl min-h-[480px] xl:h-[78vh] xl:max-h-[720px] rounded-[2rem] p-5 lg:p-6 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-5 xl:gap-8 overflow-visible",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 xl:h-full min-h-0 relative z-10 w-full xl:flex-1 max-w-[600px]",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between shrink-0",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-display font-bold text-[#0a1628] tracking-tight truncate",children:i?.name||"Student"}),e.jsx("p",{className:"text-sm text-slate-400 font-medium",children:"Customize your avatar's look here!"})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[he,e.jsxs(Re,{children:[e.jsx(qe,{asChild:!0,children:e.jsxs("button",{onClick:de,className:"bg-gradient-to-br from-amber-400 to-orange-500 rounded-lg px-2.5 py-1 shadow-sm flex items-center gap-1.5 cursor-pointer hover:opacity-90 active:scale-95 transition-all",children:[e.jsx(U,{className:"text-white shrink-0",size:13}),e.jsxs("span",{className:"text-white text-sm font-black",children:[pe," XP"]})]})}),e.jsx(Xe,{side:"bottom",className:"bg-slate-900 text-white border border-slate-700",children:"Earn more XP from lessons!"})]})]})]}),e.jsxs(Ee,{value:W,onValueChange:s=>be(s),className:"flex flex-col flex-1 min-h-0",children:[e.jsx(Pe,{className:"flex flex-nowrap shrink-0 justify-start space-x-1 mb-3 bg-white shadow-sm p-1 rounded-full border border-slate-100 w-fit overflow-x-auto max-w-full scrollbar-hide",children:F.map(s=>e.jsxs(Ae,{value:s.id,className:`flex items-center gap-1 px-3 py-1.5 rounded-full font-bold text-[13px] hover:bg-slate-50 transition-all outline-none whitespace-nowrap ${s.id==="exclusive"?"data-[state=active]:bg-gradient-to-r data-[state=active]:from-amber-500 data-[state=active]:to-orange-500 data-[state=active]:text-white [&_svg]:data-[state=active]:text-white text-amber-600":"data-[state=active]:bg-gradient-to-r data-[state=active]:from-blue-600 data-[state=active]:to-sky-500 data-[state=active]:text-white text-slate-500"}`,children:[s.icon,s.label]},s.id))}),e.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 pb-4 scrollbar-hide px-3 -mx-3",children:F.map(s=>e.jsx(ze,{value:s.id,className:"outline-none h-full",children:Le(s.id)},s.id))})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 relative z-10 w-full xl:w-[340px] min-w-[280px] shrink-0 xl:self-center mx-auto xl:mx-0",children:[e.jsxs("div",{className:"bg-[#0f1422] rounded-[2rem] relative shadow-[0_20px_50px_rgba(15,20,34,0.2)] h-[340px] xl:h-[400px] w-full flex items-center justify-center border-4 border-slate-800",children:[e.jsx("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 w-[200px] h-[20px] bg-sky-500/20 blur-xl rounded-full"}),e.jsxs("div",{className:"relative w-full h-[80%] z-10 flex justify-center items-center animate-avatar-float",children:[e.jsx(Fe,{layers:n,className:"w-full h-full absolute inset-0 z-20"}),e.jsx(le,{children:g&&e.jsxs(S.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-12 left-1/2 -translate-x-1/2 z-30 bg-white text-slate-800 px-3 py-1.5 rounded-full shadow-lg border-2 border-sky-300 whitespace-nowrap font-bold text-xs max-w-[200px] text-center",children:[g,e.jsx("div",{className:"absolute -bottom-1.5 left-1/2 -translate-x-1/2 w-0 h-0 border-l-[5px] border-r-[5px] border-t-[5px] border-l-transparent border-r-transparent border-t-white"})]})}),m&&_>0&&e.jsx(S.div,{initial:{scale:1.5,opacity:0},animate:{scale:1,opacity:1},className:"absolute bottom-6 left-1/2 -translate-x-1/2 z-30 bg-amber-500 text-white w-10 h-10 rounded-full flex items-center justify-center font-black text-xl shadow-lg border-2 border-amber-300",children:_},_)]})]}),e.jsx("div",{className:"h-[48px]",children:e.jsx("button",{onClick:je,disabled:z||!j||m,className:"w-full h-full bg-blue-600 hover:bg-blue-500 disabled:bg-slate-200 disabled:text-slate-400 text-white rounded-xl font-bold text-sm flex items-center justify-center gap-2 transition-colors shadow-md disabled:shadow-none active:scale-[0.98]",children:z?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin-slow",children:e.jsx(P,{size:16})})," Saving..."]}):j?e.jsxs(e.Fragment,{children:[e.jsx(P,{size:16})," Save Profile Avatar"]}):e.jsxs(e.Fragment,{children:[e.jsx(P,{size:16})," Save Profile Avatar"]})})})]})]})}),e.jsx(le,{children:ve&&e.jsx(S.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:e.jsxs(S.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-white rounded-2xl p-6 w-full max-w-[340px] shadow-2xl border border-slate-200 flex flex-col items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-amber-100 flex items-center justify-center",children:e.jsx(Ie,{className:"text-amber-600",size:24})}),e.jsx("button",{onClick:()=>{L(!1),D&&D()},className:"absolute top-3 right-3 text-slate-400 hover:text-slate-600",children:e.jsx(Ve,{size:18})}),e.jsx("h3",{className:"text-lg font-bold text-slate-900 text-center",children:"You've unsaved changes on Avatar Studio"}),e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx("button",{onClick:Ne,className:"w-full py-3 bg-white border-2 border-slate-200 text-slate-900 font-bold rounded-xl hover:bg-slate-50 transition-colors",children:"Save and continue"}),e.jsx("button",{onClick:Se,className:"w-full py-3 bg-slate-100 text-slate-500 font-bold rounded-xl hover:bg-slate-200 transition-colors",children:"Exit anyway"})]})]})})})]})};export{pt as default};
|
assets/{ChatMarkdown-BrSWjY6i.js β ChatMarkdown-Cwsa2RCx.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-react-B4AQeu28.js","assets/vendor-markdown-CfVKi3_s.css"])))=>i.map(i=>d[i]);
|
| 2 |
-
import{b6 as d,_ as c}from"./index-
|
|
|
|
| 1 |
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-react-B4AQeu28.js","assets/vendor-markdown-CfVKi3_s.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{b6 as d,_ as c}from"./index-Bp7MiGcW.js";import{r as m,j as r}from"./vendor-react-B4AQeu28.js";import{M as h,r as x,a as y}from"./vendor-markdown-yqZQ_iQm.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";let a=null;const p=()=>(a||(a=c(()=>import("./vendor-markdown-yqZQ_iQm.js").then(l=>l.k),__vite__mapDeps([0,1,2]))),a),M=({children:l})=>{if(m.useEffect(()=>{p()},[]),!l||typeof l!="string")return null;const t=d(l);return r.jsx("div",{className:"chat-markdown",children:r.jsx(h,{remarkPlugins:[y],rehypePlugins:[x],components:{a:({href:e,children:s})=>r.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:s}),code:e=>{const{inline:s,className:o,children:n,...i}=e;return r.jsx("code",{className:`${s?"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 text-sm":"block bg-gray-100 dark:bg-gray-900 rounded p-3 overflow-x-auto my-2"} ${o||""}`,...i,children:n})},blockquote:({children:e})=>r.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-600 dark:text-gray-400 my-2",children:e}),h1:({children:e})=>r.jsx("h1",{className:"text-2xl font-bold my-2",children:e}),h2:({children:e})=>r.jsx("h2",{className:"text-xl font-bold my-2",children:e}),h3:({children:e})=>r.jsx("h3",{className:"text-lg font-bold my-2",children:e}),h4:({children:e})=>r.jsx("h4",{className:"text-base font-bold my-2",children:e}),h5:({children:e})=>r.jsx("h5",{className:"text-sm font-bold my-2",children:e}),h6:({children:e})=>r.jsx("h6",{className:"text-xs font-bold my-2",children:e}),ul:({children:e})=>r.jsx("ul",{className:"list-disc list-inside my-2",children:e}),ol:({children:e})=>r.jsx("ol",{className:"list-decimal list-inside my-2",children:e}),li:({children:e})=>r.jsx("li",{className:"ml-2",children:e}),hr:()=>r.jsx("hr",{className:"my-4 border-t border-gray-300 dark:border-gray-600"}),p:({children:e})=>r.jsx("p",{className:"my-1",children:e})},children:t})})};export{M as default};
|
assets/{CompetencyRadarChart-qES5nrtq.js β CompetencyRadarChart-BbKzMlR1.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as g,j as t}from"./vendor-react-B4AQeu28.js";import{g as A,ad as I,u as B,m as L,B as O,R as W,b as H}from"./index-BufUS6SI.js";import{collection as R,getDocs as q,query as K,orderBy as U,limit as $,Timestamp as G,getDoc as J,doc as V}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as X,s as Y}from"./subjects-D9a9cUC-.js";import{S as Z}from"./sparkles-DYlMf97S.js";import{R as ee,f as te,g as se,h as ne,i as ae,j as oe,T as re}from"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-BcVJ31XT.js";const P=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];async function ie(a){try{const r=R(A,"users",a,"quizResults"),d=K(r,U("timestamp","desc"),$(500)),l=await q(d);return l.empty?F(a):l.docs.map(s=>{const e=s.data();return{quizId:s.id,moduleId:e.moduleId||"",subjectId:e.subjectId||"",score:typeof e.score=="number"?e.score:0,totalQuestions:e.totalQuestions||0,correctAnswers:e.correctAnswers||0,questionType:e.questionType||"multiple_choice",timestamp:e.timestamp instanceof G||e.timestamp?.toDate?e.timestamp.toDate():new Date,timeSpent:e.timeSpent||0}})}catch(r){return console.error("[competencyService] fetchQuizResults failed, falling back:",r),F(a)}}async function F(a){const r=await J(V(A,"progress",a));return r.exists()?(r.data().quizAttempts||[]).map((s,e)=>({quizId:String(s.quizId||`attempt-${e}`),moduleId:String(s.moduleId||s.quizId||""),subjectId:String(s.subjectId||""),score:typeof s.score=="number"?s.score:0,totalQuestions:s.totalQuestions||0,correctAnswers:typeof s.correctAnswers=="number"?s.correctAnswers:0,questionType:s.questionType||"multiple_choice",timestamp:s.completedAt?new Date(s.completedAt):new Date,timeSpent:s.timeSpent||0})):[]}async function ce(a){try{const r=R(A,"users",a,"moduleProgress"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,subjectId:e.subjectId||"",sessionsCompleted:e.sessionsCompleted||0,lastActive:e.lastActive?e.lastActive instanceof G?e.lastActive.toDate():new Date(e.lastActive):new Date,moduleTitle:e.moduleTitle||s.id,lessonsCompleted:e.lessonsCompleted||[],quizzesCompleted:e.quizzesCompleted||[]}}),l}catch(r){return console.error("[competencyService] fetchModuleProgress failed:",r),{}}}function _(a,r,d,l){const s=r.filter(p=>p.moduleId===a),e=s.length>0?s.reduce((p,b)=>p+b.score,0)/s.length:0,h=["identification","multiple_choice"],u=s.filter(p=>h.includes(p.questionType)),i=u.length>0?u.reduce((p,b)=>p+b.score,0)/u.length:e*.9,o=["word_problem","equation_based","enumeration"],n=s.filter(p=>o.includes(p.questionType)),c=n.length>0?n.reduce((p,b)=>p+b.score,0)/n.length:e*.85,m=d,f=m?.lessonsCompleted?.length||0,N=m?.quizzesCompleted?.length||0,D=m?.sessionsCompleted||0,y=l.find(p=>p.id===a),x=y?.lessons?.length||1,C=y?.quizzes?.length||1,z=Math.min(100,f/x*100),k=Math.min(100,N/C*100),v=Math.min(100,(z+k+D*5)/2.5);if(s.length<2){const p=v>50?60+v*.3:v*.8;return{overallMastery:e,conceptGrasp:i,application:c,engagement:v,consistency:Math.min(100,p)}}const w=s.map(p=>p.score),M=w.reduce((p,b)=>p+b,0)/w.length,E=w.reduce((p,b)=>p+Math.pow(b-M,2),0)/w.length,j=Math.sqrt(E)/Math.max(M,1),S=Math.max(0,Math.min(100,(1-j)*100));return{overallMastery:Math.round(e),conceptGrasp:Math.round(i),application:Math.round(c),engagement:Math.round(v),consistency:Math.round(S)}}async function le(a){try{const r=R(A,"users",a,"competencyMatrix"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,moduleName:e.moduleName||s.id,overallMastery:e.overallMastery??0,conceptGrasp:e.conceptGrasp??0,application:e.application??0,engagement:e.engagement??0,consistency:e.consistency??0,computedAt:e.computedAt?.toDate?.()||new Date}}),l}catch(r){return console.error("[competencyService] fetchCachedCompetencyMatrix failed:",r),{}}}const Q=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}];function de(a){const[r,d]=g.useState([]),[l,s]=g.useState([]),[e,h]=g.useState("N/A"),[u,i]=g.useState(!0),[o,n]=g.useState(null),[c,m]=g.useState(!1),f=g.useRef(0),N=g.useCallback(async(y,x)=>{if(x!==f.current)return;const z=X(null)[0]??"gen-math",k=Y.find(j=>j.id===z)?.modules||[],v=k.map((j,S)=>({id:j.id,name:j.title.length>15?j.title.substring(0,15).trim()+"...":j.title,color:P[S%P.length]})),w=await le(a);if(x!==f.current)return;if(Object.keys(w).length>0){ue(w,v,d,h),m(!1),i(!1);return}const M=await ie(a),E=await ce(a);if(x!==f.current)return;const T=M.length>0;m(!T),pe(M,E,v,k,d,h),i(!1)},[a]),D=g.useCallback(async()=>{if(!a){i(!1);return}const y=++f.current;i(!0),n(null);try{const x=await new Promise(C=>{const z=I(a,k=>{z(),C(k)})});if(y!==f.current)return;await N(x,y)}catch(x){console.error("[useCompetencyMatrix] Failed to load:",x),y===f.current&&(n("Failed to load competency data. Please try again."),i(!1))}},[a,N]);return g.useEffect(()=>{if(!a)return;const y=I(a,x=>{const C=++f.current;N(x,C)});return()=>y()},[a,N]),{data:r,modulesList:l,topModule:e,loading:u,error:o,isEmpty:c,refresh:D}}function ue(a,r,d,l){let s=-1,e="N/A";const h=Q.map(u=>{const i={metric:u.label,fullMark:100};return r.forEach(o=>{const n=a[o.id];n&&(u.key==="progress"?i[o.id]=n.overallMastery:u.key==="concept"?i[o.id]=n.conceptGrasp:u.key==="application"?i[o.id]=n.application:u.key==="engagement"?i[o.id]=n.engagement:u.key==="consistency"&&(i[o.id]=n.consistency))}),i});r.forEach(u=>{const i=a[u.id];if(i){const o=(i.overallMastery+i.conceptGrasp+i.application+i.engagement+i.consistency)/5;o>s&&(s=o,e=u.name)}}),l(e),d(h)}function pe(a,r,d,l,s,e){let h=-1,u="N/A";const i=Q.map(o=>{const n={metric:o.label,fullMark:100};return l.forEach(c=>{const m=r[c.id],f=_(c.id,a,m??{moduleId:c.id,sessionsCompleted:0,moduleTitle:c.title,lessonsCompleted:[],quizzesCompleted:[]},l);o.key==="progress"?n[c.id]=f.overallMastery:o.key==="concept"?n[c.id]=f.conceptGrasp:o.key==="application"?n[c.id]=f.application:o.key==="engagement"?n[c.id]=f.engagement:o.key==="consistency"&&(n[c.id]=f.consistency)}),n});l.forEach(o=>{const n=r[o.id],c=_(o.id,a,n??{moduleId:o.id,sessionsCompleted:0,moduleTitle:o.title,lessonsCompleted:[],quizzesCompleted:[]},l),m=(c.overallMastery+c.conceptGrasp+c.application+c.engagement+c.consistency)/5;m>h&&(h=m,u=d.find(f=>f.id===o.id)?.name||"N/A")}),e(u),s(i)}const ze=()=>{const{userProfile:a}=B(),{data:r,modulesList:d,topModule:l,loading:s,error:e,isEmpty:h,refresh:u}=de(a?.uid??""),[i,o]=g.useState(!1);return t.jsxs(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"relative overflow-hidden bg-white rounded-[16px] border border-slate-200 shadow-sm p-6 lg:p-8 group",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t.jsx("div",{className:"absolute -right-12 -bottom-12 w-32 h-32 bg-[#9956DE]/5 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-6 relative z-10 gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-[12px] bg-gradient-to-br from-[#a855f7] to-[#9333ea] flex items-center justify-center shadow-[0_4px_12px_rgba(168,85,247,0.2)]",children:t.jsx(O,{size:20,className:"text-white"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-[15px] font-bold text-slate-900",children:"Competency Matrix"}),t.jsx("p",{className:"text-[12px] text-slate-500",children:"Realtime performance across modules"})]})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[!s&&!h&&!e&&t.jsxs("div",{className:"flex items-center gap-2 bg-[#f5f3ff] border border-[#e0e7ff] px-3 py-1.5 rounded-full",children:[t.jsx(Z,{size:12,className:"text-amber-500"}),t.jsx("span",{className:"text-[11px] font-bold text-[#9956DE] uppercase tracking-wider",children:l})]}),!s&&t.jsx("button",{onClick:u,className:"w-8 h-8 rounded-full bg-white border border-slate-200 flex items-center justify-center hover:bg-[#f5f3ff] hover:border-[#9956DE]/30 transition-colors shadow-sm",title:"Refresh",children:t.jsx(W,{size:13,className:"text-slate-400"})})]})]}),t.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 border-4 border-[#9956DE]/20 border-t-[#9956DE] rounded-full animate-spin"}),t.jsx("p",{className:"text-[13px] text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):h||e?t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-4",children:[t.jsx("div",{className:"w-14 h-14 rounded-[16px] bg-gradient-to-br from-slate-100 to-slate-50 flex items-center justify-center border border-slate-200",children:t.jsx(H,{size:24,className:"text-slate-400"})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-[13px] font-semibold text-slate-600 mb-1",children:e?"Unable to load competency data":"No activity yet"}),t.jsx("p",{className:"text-[12px] text-slate-400 max-w-[260px]",children:e||"Complete quizzes and lessons to see your competency matrix here."})]}),e&&t.jsx("button",{onClick:u,className:"px-4 py-2 text-[12px] font-semibold bg-[#9956DE] text-white rounded-full hover:bg-[#8b45d1] transition-colors shadow-md",children:"Try Again"})]}):t.jsx(ee,{width:"100%",height:"100%",children:t.jsxs(te,{cx:"50%",cy:"50%",outerRadius:i?"75%":"70%",data:r,children:[t.jsx(se,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),t.jsx(ne,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600}}),t.jsx(ae,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),d.map(n=>t.jsx(oe,{name:n.name,dataKey:n.id,stroke:n.color,strokeWidth:2,fill:n.color,fillOpacity:.3,dot:{r:3,fill:"#fff",stroke:n.color,strokeWidth:2},activeDot:{r:5,fill:n.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},n.id)),t.jsx(re,{cursor:!1,content:({active:n,payload:c})=>n&&c&&c.length?t.jsxs("div",{className:"bg-white/95 backdrop-blur-[12px] shadow-[0_8px_24px_rgba(0,0,0,0.12)] border border-slate-100 rounded-[12px] p-4",children:[t.jsx("p",{className:"font-bold text-slate-800 text-[13px] mb-2",children:c[0].payload.metric}),t.jsx("div",{className:"flex flex-col gap-1.5",children:c.map(m=>t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:m.stroke}}),t.jsx("span",{className:"text-[11px] font-semibold text-slate-600 truncate max-w-[120px]",children:String(m.name)})]}),t.jsxs("span",{className:"text-[13px] font-bold",style:{color:m.stroke},children:[Math.round(m.value),"%"]})]},m.name))})]}):null})]})})}),!s&&!h&&!e&&d.length>0&&t.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 mt-4 relative z-10",children:d.map(n=>t.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-50 px-2.5 py-1 rounded-full border border-slate-100",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n.color}}),t.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-wider",children:n.name.length>15?n.name.substring(0,12)+"...":n.name})]},n.id))})]})};export{ze as CompetencyRadarChart};
|
|
|
|
| 1 |
+
import{r as g,j as t}from"./vendor-react-B4AQeu28.js";import{g as A,ad as I,u as B,m as L,B as O,R as W,b as H}from"./index-Bp7MiGcW.js";import{collection as R,getDocs as q,query as K,orderBy as U,limit as $,Timestamp as G,getDoc as J,doc as V}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as X,s as Y}from"./subjects-DNoBzeBL.js";import{S as Z}from"./sparkles-fLB3ltj1.js";import{R as ee,f as te,g as se,h as ne,i as ae,j as oe,T as re}from"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-Dyv8TfXk.js";const P=["#1FA7E1","#9956DE","#75D06A","#FFB356","#7274ED","#FF8B8B","#6ED1CF","#FB96BB"];async function ie(a){try{const r=R(A,"users",a,"quizResults"),d=K(r,U("timestamp","desc"),$(500)),l=await q(d);return l.empty?F(a):l.docs.map(s=>{const e=s.data();return{quizId:s.id,moduleId:e.moduleId||"",subjectId:e.subjectId||"",score:typeof e.score=="number"?e.score:0,totalQuestions:e.totalQuestions||0,correctAnswers:e.correctAnswers||0,questionType:e.questionType||"multiple_choice",timestamp:e.timestamp instanceof G||e.timestamp?.toDate?e.timestamp.toDate():new Date,timeSpent:e.timeSpent||0}})}catch(r){return console.error("[competencyService] fetchQuizResults failed, falling back:",r),F(a)}}async function F(a){const r=await J(V(A,"progress",a));return r.exists()?(r.data().quizAttempts||[]).map((s,e)=>({quizId:String(s.quizId||`attempt-${e}`),moduleId:String(s.moduleId||s.quizId||""),subjectId:String(s.subjectId||""),score:typeof s.score=="number"?s.score:0,totalQuestions:s.totalQuestions||0,correctAnswers:typeof s.correctAnswers=="number"?s.correctAnswers:0,questionType:s.questionType||"multiple_choice",timestamp:s.completedAt?new Date(s.completedAt):new Date,timeSpent:s.timeSpent||0})):[]}async function ce(a){try{const r=R(A,"users",a,"moduleProgress"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,subjectId:e.subjectId||"",sessionsCompleted:e.sessionsCompleted||0,lastActive:e.lastActive?e.lastActive instanceof G?e.lastActive.toDate():new Date(e.lastActive):new Date,moduleTitle:e.moduleTitle||s.id,lessonsCompleted:e.lessonsCompleted||[],quizzesCompleted:e.quizzesCompleted||[]}}),l}catch(r){return console.error("[competencyService] fetchModuleProgress failed:",r),{}}}function _(a,r,d,l){const s=r.filter(p=>p.moduleId===a),e=s.length>0?s.reduce((p,b)=>p+b.score,0)/s.length:0,h=["identification","multiple_choice"],u=s.filter(p=>h.includes(p.questionType)),i=u.length>0?u.reduce((p,b)=>p+b.score,0)/u.length:e*.9,o=["word_problem","equation_based","enumeration"],n=s.filter(p=>o.includes(p.questionType)),c=n.length>0?n.reduce((p,b)=>p+b.score,0)/n.length:e*.85,m=d,f=m?.lessonsCompleted?.length||0,N=m?.quizzesCompleted?.length||0,D=m?.sessionsCompleted||0,y=l.find(p=>p.id===a),x=y?.lessons?.length||1,C=y?.quizzes?.length||1,z=Math.min(100,f/x*100),k=Math.min(100,N/C*100),v=Math.min(100,(z+k+D*5)/2.5);if(s.length<2){const p=v>50?60+v*.3:v*.8;return{overallMastery:e,conceptGrasp:i,application:c,engagement:v,consistency:Math.min(100,p)}}const w=s.map(p=>p.score),M=w.reduce((p,b)=>p+b,0)/w.length,E=w.reduce((p,b)=>p+Math.pow(b-M,2),0)/w.length,j=Math.sqrt(E)/Math.max(M,1),S=Math.max(0,Math.min(100,(1-j)*100));return{overallMastery:Math.round(e),conceptGrasp:Math.round(i),application:Math.round(c),engagement:Math.round(v),consistency:Math.round(S)}}async function le(a){try{const r=R(A,"users",a,"competencyMatrix"),d=await q(r);if(d.empty)return{};const l={};return d.forEach(s=>{const e=s.data();l[s.id]={moduleId:s.id,moduleName:e.moduleName||s.id,overallMastery:e.overallMastery??0,conceptGrasp:e.conceptGrasp??0,application:e.application??0,engagement:e.engagement??0,consistency:e.consistency??0,computedAt:e.computedAt?.toDate?.()||new Date}}),l}catch(r){return console.error("[competencyService] fetchCachedCompetencyMatrix failed:",r),{}}}const Q=[{key:"progress",label:"Overall Mastery"},{key:"concept",label:"Concept Grasp"},{key:"application",label:"Application"},{key:"engagement",label:"Engagement"},{key:"consistency",label:"Consistency"}];function de(a){const[r,d]=g.useState([]),[l,s]=g.useState([]),[e,h]=g.useState("N/A"),[u,i]=g.useState(!0),[o,n]=g.useState(null),[c,m]=g.useState(!1),f=g.useRef(0),N=g.useCallback(async(y,x)=>{if(x!==f.current)return;const z=X(null)[0]??"gen-math",k=Y.find(j=>j.id===z)?.modules||[],v=k.map((j,S)=>({id:j.id,name:j.title.length>15?j.title.substring(0,15).trim()+"...":j.title,color:P[S%P.length]})),w=await le(a);if(x!==f.current)return;if(Object.keys(w).length>0){ue(w,v,d,h),m(!1),i(!1);return}const M=await ie(a),E=await ce(a);if(x!==f.current)return;const T=M.length>0;m(!T),pe(M,E,v,k,d,h),i(!1)},[a]),D=g.useCallback(async()=>{if(!a){i(!1);return}const y=++f.current;i(!0),n(null);try{const x=await new Promise(C=>{const z=I(a,k=>{z(),C(k)})});if(y!==f.current)return;await N(x,y)}catch(x){console.error("[useCompetencyMatrix] Failed to load:",x),y===f.current&&(n("Failed to load competency data. Please try again."),i(!1))}},[a,N]);return g.useEffect(()=>{if(!a)return;const y=I(a,x=>{const C=++f.current;N(x,C)});return()=>y()},[a,N]),{data:r,modulesList:l,topModule:e,loading:u,error:o,isEmpty:c,refresh:D}}function ue(a,r,d,l){let s=-1,e="N/A";const h=Q.map(u=>{const i={metric:u.label,fullMark:100};return r.forEach(o=>{const n=a[o.id];n&&(u.key==="progress"?i[o.id]=n.overallMastery:u.key==="concept"?i[o.id]=n.conceptGrasp:u.key==="application"?i[o.id]=n.application:u.key==="engagement"?i[o.id]=n.engagement:u.key==="consistency"&&(i[o.id]=n.consistency))}),i});r.forEach(u=>{const i=a[u.id];if(i){const o=(i.overallMastery+i.conceptGrasp+i.application+i.engagement+i.consistency)/5;o>s&&(s=o,e=u.name)}}),l(e),d(h)}function pe(a,r,d,l,s,e){let h=-1,u="N/A";const i=Q.map(o=>{const n={metric:o.label,fullMark:100};return l.forEach(c=>{const m=r[c.id],f=_(c.id,a,m??{moduleId:c.id,sessionsCompleted:0,moduleTitle:c.title,lessonsCompleted:[],quizzesCompleted:[]},l);o.key==="progress"?n[c.id]=f.overallMastery:o.key==="concept"?n[c.id]=f.conceptGrasp:o.key==="application"?n[c.id]=f.application:o.key==="engagement"?n[c.id]=f.engagement:o.key==="consistency"&&(n[c.id]=f.consistency)}),n});l.forEach(o=>{const n=r[o.id],c=_(o.id,a,n??{moduleId:o.id,sessionsCompleted:0,moduleTitle:o.title,lessonsCompleted:[],quizzesCompleted:[]},l),m=(c.overallMastery+c.conceptGrasp+c.application+c.engagement+c.consistency)/5;m>h&&(h=m,u=d.find(f=>f.id===o.id)?.name||"N/A")}),e(u),s(i)}const ze=()=>{const{userProfile:a}=B(),{data:r,modulesList:d,topModule:l,loading:s,error:e,isEmpty:h,refresh:u}=de(a?.uid??""),[i,o]=g.useState(!1);return t.jsxs(L.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"relative overflow-hidden bg-white rounded-[16px] border border-slate-200 shadow-sm p-6 lg:p-8 group",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[t.jsx("div",{className:"absolute -right-12 -bottom-12 w-32 h-32 bg-[#9956DE]/5 rounded-full transition-transform duration-500 group-hover:scale-[1.8] group-hover:-translate-y-4 group-hover:-translate-x-4"}),t.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-6 relative z-10 gap-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-[12px] bg-gradient-to-br from-[#a855f7] to-[#9333ea] flex items-center justify-center shadow-[0_4px_12px_rgba(168,85,247,0.2)]",children:t.jsx(O,{size:20,className:"text-white"})}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-[15px] font-bold text-slate-900",children:"Competency Matrix"}),t.jsx("p",{className:"text-[12px] text-slate-500",children:"Realtime performance across modules"})]})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[!s&&!h&&!e&&t.jsxs("div",{className:"flex items-center gap-2 bg-[#f5f3ff] border border-[#e0e7ff] px-3 py-1.5 rounded-full",children:[t.jsx(Z,{size:12,className:"text-amber-500"}),t.jsx("span",{className:"text-[11px] font-bold text-[#9956DE] uppercase tracking-wider",children:l})]}),!s&&t.jsx("button",{onClick:u,className:"w-8 h-8 rounded-full bg-white border border-slate-200 flex items-center justify-center hover:bg-[#f5f3ff] hover:border-[#9956DE]/30 transition-colors shadow-sm",title:"Refresh",children:t.jsx(W,{size:13,className:"text-slate-400"})})]})]}),t.jsx("div",{className:"h-[300px] sm:h-[360px] w-full relative z-10",children:s?t.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 border-4 border-[#9956DE]/20 border-t-[#9956DE] rounded-full animate-spin"}),t.jsx("p",{className:"text-[13px] text-slate-400 font-medium",children:"Analyzing skill vectors..."})]})}):h||e?t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center gap-4",children:[t.jsx("div",{className:"w-14 h-14 rounded-[16px] bg-gradient-to-br from-slate-100 to-slate-50 flex items-center justify-center border border-slate-200",children:t.jsx(H,{size:24,className:"text-slate-400"})}),t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-[13px] font-semibold text-slate-600 mb-1",children:e?"Unable to load competency data":"No activity yet"}),t.jsx("p",{className:"text-[12px] text-slate-400 max-w-[260px]",children:e||"Complete quizzes and lessons to see your competency matrix here."})]}),e&&t.jsx("button",{onClick:u,className:"px-4 py-2 text-[12px] font-semibold bg-[#9956DE] text-white rounded-full hover:bg-[#8b45d1] transition-colors shadow-md",children:"Try Again"})]}):t.jsx(ee,{width:"100%",height:"100%",children:t.jsxs(te,{cx:"50%",cy:"50%",outerRadius:i?"75%":"70%",data:r,children:[t.jsx(se,{stroke:"#e2e8f0",strokeDasharray:"4 4",polarRadius:[20,40,60,80,100]}),t.jsx(ne,{dataKey:"metric",tick:{fill:"#475569",fontSize:12,fontWeight:600}}),t.jsx(ae,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10},tickCount:6,axisLine:!1}),d.map(n=>t.jsx(oe,{name:n.name,dataKey:n.id,stroke:n.color,strokeWidth:2,fill:n.color,fillOpacity:.3,dot:{r:3,fill:"#fff",stroke:n.color,strokeWidth:2},activeDot:{r:5,fill:n.color,stroke:"#fff",strokeWidth:2},isAnimationActive:!0,animationDuration:1500,animationEasing:"ease-out"},n.id)),t.jsx(re,{cursor:!1,content:({active:n,payload:c})=>n&&c&&c.length?t.jsxs("div",{className:"bg-white/95 backdrop-blur-[12px] shadow-[0_8px_24px_rgba(0,0,0,0.12)] border border-slate-100 rounded-[12px] p-4",children:[t.jsx("p",{className:"font-bold text-slate-800 text-[13px] mb-2",children:c[0].payload.metric}),t.jsx("div",{className:"flex flex-col gap-1.5",children:c.map(m=>t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:m.stroke}}),t.jsx("span",{className:"text-[11px] font-semibold text-slate-600 truncate max-w-[120px]",children:String(m.name)})]}),t.jsxs("span",{className:"text-[13px] font-bold",style:{color:m.stroke},children:[Math.round(m.value),"%"]})]},m.name))})]}):null})]})})}),!s&&!h&&!e&&d.length>0&&t.jsx("div",{className:"flex flex-wrap justify-center items-center gap-3 mt-4 relative z-10",children:d.map(n=>t.jsxs("div",{className:"flex items-center gap-1.5 bg-slate-50 px-2.5 py-1 rounded-full border border-slate-100",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:n.color}}),t.jsx("span",{className:"text-[10px] font-bold text-slate-600 uppercase tracking-wider",children:n.name.length>15?n.name.substring(0,12)+"...":n.name})]},n.id))})]})};export{ze as CompetencyRadarChart};
|
assets/{CompositeAvatar-Col05lJc.js β CompositeAvatar-DoKZfi7O.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{j as a}from"./vendor-react-B4AQeu28.js";import{g as e}from"./avatarData-
|
| 2 |
@keyframes head-sway {
|
| 3 |
0%, 100% { transform: rotate(-2deg) translateY(0); }
|
| 4 |
50% { transform: rotate(2deg) translateY(-3px); }
|
|
|
|
| 1 |
+
import{j as a}from"./vendor-react-B4AQeu28.js";import{g as e}from"./avatarData-ChByUhv2.js";const m=`
|
| 2 |
@keyframes head-sway {
|
| 3 |
0%, 100% { transform: rotate(-2deg) translateY(0); }
|
| 4 |
50% { transform: rotate(2deg) translateY(-3px); }
|
assets/{ConfirmModal-B3J78vrR.js β ConfirmModal-CH3zQe0u.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e}from"./vendor-react-B4AQeu28.js";import{B as i}from"./button-
|
|
|
|
| 1 |
+
import{j as e}from"./vendor-react-B4AQeu28.js";import{B as i}from"./button-BMVm9YQO.js";import{h as u,m as r,y as f}from"./index-Bp7MiGcW.js";import{X as y}from"./x-k8d6VLEw.js";import{T as j}from"./trash-2-BhUbBhdb.js";import{L as w}from"./log-out-DrAbcVI9.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const O=({isOpen:s,onClose:t,onConfirm:n,title:a,message:l,confirmText:c="Confirm",cancelText:d="Cancel",type:m="warning",icon:x="warning",zIndexClass:g="z-50"})=>{const b=()=>{switch(x){case"logout":return e.jsx(w,{size:32});case"delete":return e.jsx(j,{size:32});case"warning":default:return e.jsx(f,{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(u,{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:h=>h.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-CbAKGmA6.js β DashboardAvatar-D5djDQQ1.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{j as a}from"./vendor-react-B4AQeu28.js";import{g as e}from"./avatarData-
|
| 2 |
@keyframes head-sway {
|
| 3 |
0%, 100% { transform: rotate(-2deg); }
|
| 4 |
50% { transform: rotate(2deg); }
|
|
|
|
| 1 |
+
import{j as a}from"./vendor-react-B4AQeu28.js";import{g as e}from"./avatarData-ChByUhv2.js";const l=`
|
| 2 |
@keyframes head-sway {
|
| 3 |
0%, 100% { transform: rotate(-2deg); }
|
| 4 |
50% { transform: rotate(2deg); }
|
assets/{DiagnosticBreakdown-BF7w8Bn-.js β DiagnosticBreakdown-DkqMV9oI.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as y,doc as _}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as k,w as Z,B as H,Z as J,y as C,T as W,r as S,m,h as Y}from"./index-BufUS6SI.js";import{X as G}from"./x-BuBjuj2Y.js";import{C as A}from"./clock-CooTZK0X.js";import{L as T,C as K}from"./lightbulb-bxzKA78M.js";import{C as q}from"./circle-check-BzgmgbHa.js";import{C as D}from"./chart-column-BcVJ31XT.js";import{a as O,C as V}from"./chevron-up-CoNRuMZ7.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const ge=({userId:d,mode:h,isOpen:c=!0,onClose:p})=>{const[o,P]=i.useState([]),[B,$]=i.useState({}),[r,R]=i.useState({}),[a,E]=i.useState(null),[L,x]=i.useState(!0),[Q,j]=i.useState(!0),[g,z]=i.useState(null);i.useEffect(()=>{!d||!c||M()},[d,c]);const M=async()=>{x(!0);try{const s=await y(_(k,"diagnosticResults",d));if(!s.exists()){x(!1);return}const t=s.data(),U=t.responses||[];$(t.domainScores||{}),R(t.riskProfile||{});const b=t.testId;let v={};if(b){const l=await y(_(k,"diagnosticSessions",b));if(l.exists()){const X=l.data();for(const w of X.questions||[])v[w.question_id]=w.question_text}}P(U.map(l=>({...l,question_text:v[l.question_id]}))),x(!1),j(!0);try{const l=await Z("/api/diagnostic/analyze",{method:"POST",body:JSON.stringify({user_id:d})});l.success&&E(l.analysis)}catch(l){console.error("[DiagnosticBreakdown] AI analysis failed:",l)}finally{j(!1)}}catch(s){console.error("[DiagnosticBreakdown] Failed to load data:",s),x(!1),j(!1)}},u=o.filter(s=>s.is_correct).length,n=o.length,f=o.reduce((s,t)=>s+t.time_spent_seconds,0),F=n>0?Math.round(f/n):0,I=n>0?Math.round(u/n*100):0;if(!c)return null;const N=e.jsxs("div",{className:`${h==="fullscreen"?"min-h-screen bg-gradient-to-br from-slate-50 via-white to-indigo-50/30":""} flex flex-col`,children:[e.jsx("div",{className:"top-0 z-10 bg-white border-b border-slate-200/60 px-6 py-4",children:e.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg shadow-indigo-200",children:e.jsx(H,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold text-slate-900",children:"Diagnostic Assessment Breakdown"}),e.jsx("p",{className:"text-xs text-slate-500",children:"AI-powered analysis of your performance"})]})]}),e.jsx("button",{onClick:p,className:"p-2 hover:bg-slate-100 rounded-xl transition-colors",title:"Close",children:e.jsx(G,{className:"w-5 h-5 text-slate-500"})})]})}),e.jsx("div",{className:"max-w-6xl mx-auto w-full px-6 py-8 space-y-8",children:L?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx("div",{className:"h-32 bg-slate-100 rounded-2xl animate-pulse"},s))}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-2xl p-5 text-white shadow-lg shadow-indigo-200/50",children:[e.jsx("p",{className:"text-indigo-200 text-xs font-medium uppercase",children:"Score"}),e.jsxs("p",{className:"text-3xl font-black mt-1",children:[I,"%"]}),e.jsxs("p",{className:"text-indigo-200 text-sm",children:[u,"/",n," correct"]})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(A,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Avg Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[F,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"per question"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(J,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Total Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[Math.floor(f/60),"m ",f%60,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"assessment duration"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(C,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Risk"})]}),e.jsx("p",{className:`text-2xl font-bold ${r.overall_risk==="high"||r.overall_risk==="critical"?"text-red-600":r.overall_risk==="moderate"?"text-amber-600":"text-emerald-600"}`,children:(r.overall_risk||"unknown").charAt(0).toUpperCase()+(r.overall_risk||"unknown").slice(1)}),e.jsx("p",{className:"text-xs text-slate-400",children:"risk level"})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100 bg-gradient-to-r from-amber-50 to-orange-50",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{className:"w-5 h-5 text-amber-500"}),e.jsx("h2",{className:"font-bold text-slate-800",children:"AI Analysis"})]})}),e.jsx("div",{className:"p-6",children:Q?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-5/6"})]}):a?e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-slate-700 leading-relaxed",children:a.overall_summary}),e.jsxs("div",{className:"bg-sky-50 border border-sky-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-sky-800 text-sm mb-2 flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4"})," Timing Patterns"]}),e.jsx("p",{className:"text-sm text-sky-700",children:a.time_analysis.insight}),a.time_analysis.slow_questions.length>0&&e.jsxs("p",{className:"text-xs text-sky-600 mt-2",children:[e.jsx("span",{className:"font-medium",children:"Took longest on:"})," ",a.time_analysis.slow_questions.join(", ")]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.strength_areas.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-emerald-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(W,{className:"w-4 h-4"})," Strengths"]}),e.jsx("ul",{className:"space-y-2",children:a.strength_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx(q,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]}),a.weakness_areas.length>0&&e.jsxs("div",{className:"border border-red-100 bg-red-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-red-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4"})," Weak Areas"]}),e.jsx("ul",{className:"space-y-2",children:a.weakness_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-red-700 flex items-start gap-2",children:[e.jsx(C,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]})]}),a.answer_patterns.common_mistakes.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("h3",{className:"font-semibold text-amber-800 text-sm mb-2",children:"Answer Patterns"}),e.jsx("p",{className:"text-sm text-amber-700 mb-2",children:a.answer_patterns.description}),e.jsx("ul",{className:"space-y-1",children:a.answer_patterns.common_mistakes.map((s,t)=>e.jsxs("li",{className:"text-xs text-amber-600",children:["β’ ",s]},t))})]}),a.recommendations.length>0&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-indigo-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(T,{className:"w-4 h-4"})," Recommendations"]}),e.jsx("ol",{className:"space-y-2",children:a.recommendations.map((s,t)=>e.jsxs("li",{className:"text-sm text-indigo-700",children:[e.jsxs("span",{className:"font-medium",children:[t+1,". ",s.action]}),e.jsxs("span",{className:"text-indigo-500 text-xs ml-2",children:["β ",s.reason]})]},t))})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-slate-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"})," Performance by Difficulty"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Easy"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.easy_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Medium"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.medium_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Hard"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.hard_performance})]})]})]})]}):e.jsx("p",{className:"text-slate-500 text-sm",children:"Analysis unavailable."})})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(D,{className:"w-5 h-5 text-indigo-500"})," Domain Scores"]})}),e.jsx("div",{className:"p-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Object.entries(B).map(([s,t])=>e.jsxs("div",{className:"border border-slate-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-700 mb-2",children:s}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsxs("span",{className:"text-2xl font-black text-slate-800",children:[t.percentage,"%"]}),e.jsxs("span",{className:"text-xs text-slate-400 mb-1",children:[t.correct,"/",t.total]})]}),e.jsx("div",{className:"mt-2 h-2 bg-slate-100 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all ${t.percentage>=80?"bg-emerald-500":t.percentage>=60?"bg-amber-500":"bg-red-500"}`,style:{width:`${t.percentage}%`}})}),e.jsx("p",{className:`text-xs mt-1 font-medium ${t.mastery_level==="mastered"?"text-emerald-600":t.mastery_level==="developing"?"text-amber-600":"text-red-600"}`,children:t.mastery_level})]},s))})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(S,{className:"w-5 h-5 text-indigo-500"})," Question-by-Question Breakdown"]})}),e.jsx("div",{className:"divide-y divide-slate-50",children:o.map((s,t)=>e.jsxs("div",{className:"px-6 py-3 hover:bg-slate-50/50 transition-colors",children:[e.jsxs("button",{onClick:()=>z(g===t?null:t),className:"w-full flex items-center gap-3 text-left",children:[e.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0 ${s.is_correct?"bg-emerald-100 text-emerald-600":"bg-red-100 text-red-600"}`,children:s.is_correct?e.jsx(q,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700 truncate",children:["Q",t+1,". ",s.question_text||`${s.topic} (${s.domain})`]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[e.jsx("span",{className:"text-xs text-slate-400",children:s.difficulty}),e.jsxs("span",{className:"text-xs text-slate-400",children:[s.time_spent_seconds,"s"]}),e.jsx("span",{className:"text-xs text-slate-400",children:s.domain})]})]}),g===t?e.jsx(O,{className:"w-4 h-4 text-slate-400"}):e.jsx(V,{className:"w-4 h-4 text-slate-400"})]}),g===t&&e.jsxs(m.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"ml-10 mt-2 pb-2 space-y-2",children:[s.question_text&&e.jsx("p",{className:"text-sm text-slate-600",children:s.question_text}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[e.jsxs("span",{className:s.is_correct?"text-emerald-600":"text-red-600",children:["Your answer: ",e.jsx("strong",{children:s.student_answer||"β"})]}),!s.is_correct&&e.jsxs("span",{className:"text-emerald-600",children:["Correct: ",e.jsx("strong",{children:s.correct_answer})]}),e.jsxs("span",{className:"text-slate-500",children:["Time: ",s.time_spent_seconds,"s"]}),e.jsxs("span",{className:"text-slate-500",children:["Bloom: ",s.bloom_level]})]})]})]},t))})]}),e.jsx("div",{className:"flex justify-center pb-8",children:e.jsx("button",{onClick:p,className:"px-8 py-3 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-lg shadow-indigo-200 transition-all",children:h==="fullscreen"?"Continue to Dashboard":"Close"})})]})})]});return h==="modal"?e.jsx(Y,{children:c&&e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4",onClick:p,children:e.jsx(m.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"bg-white rounded-2xl shadow-xl w-full max-w-5xl max-h-[90vh] overflow-y-auto will-change-transform",onClick:s=>s.stopPropagation(),children:N})})}):e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},className:"fixed inset-0 z-50 overflow-y-auto bg-gradient-to-br from-slate-50 via-white to-indigo-50/30",children:N})};export{ge as default};
|
|
|
|
| 1 |
+
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as y,doc as _}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as k,w as Z,B as H,Z as J,y as C,T as W,r as S,m,h as Y}from"./index-Bp7MiGcW.js";import{X as G}from"./x-k8d6VLEw.js";import{C as A}from"./clock-Cc6sJz1J.js";import{L as T,C as K}from"./lightbulb-DG1NwVgr.js";import{C as q}from"./circle-check-DzQphSnP.js";import{C as D}from"./chart-column-Dyv8TfXk.js";import{a as O,C as V}from"./chevron-up-DtS9MvUZ.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const ge=({userId:d,mode:h,isOpen:c=!0,onClose:p})=>{const[o,P]=i.useState([]),[B,$]=i.useState({}),[r,R]=i.useState({}),[a,E]=i.useState(null),[L,x]=i.useState(!0),[Q,j]=i.useState(!0),[g,z]=i.useState(null);i.useEffect(()=>{!d||!c||M()},[d,c]);const M=async()=>{x(!0);try{const s=await y(_(k,"diagnosticResults",d));if(!s.exists()){x(!1);return}const t=s.data(),U=t.responses||[];$(t.domainScores||{}),R(t.riskProfile||{});const b=t.testId;let v={};if(b){const l=await y(_(k,"diagnosticSessions",b));if(l.exists()){const X=l.data();for(const w of X.questions||[])v[w.question_id]=w.question_text}}P(U.map(l=>({...l,question_text:v[l.question_id]}))),x(!1),j(!0);try{const l=await Z("/api/diagnostic/analyze",{method:"POST",body:JSON.stringify({user_id:d})});l.success&&E(l.analysis)}catch(l){console.error("[DiagnosticBreakdown] AI analysis failed:",l)}finally{j(!1)}}catch(s){console.error("[DiagnosticBreakdown] Failed to load data:",s),x(!1),j(!1)}},u=o.filter(s=>s.is_correct).length,n=o.length,f=o.reduce((s,t)=>s+t.time_spent_seconds,0),F=n>0?Math.round(f/n):0,I=n>0?Math.round(u/n*100):0;if(!c)return null;const N=e.jsxs("div",{className:`${h==="fullscreen"?"min-h-screen bg-gradient-to-br from-slate-50 via-white to-indigo-50/30":""} flex flex-col`,children:[e.jsx("div",{className:"top-0 z-10 bg-white border-b border-slate-200/60 px-6 py-4",children:e.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-indigo-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg shadow-indigo-200",children:e.jsx(H,{className:"w-5 h-5 text-white"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-bold text-slate-900",children:"Diagnostic Assessment Breakdown"}),e.jsx("p",{className:"text-xs text-slate-500",children:"AI-powered analysis of your performance"})]})]}),e.jsx("button",{onClick:p,className:"p-2 hover:bg-slate-100 rounded-xl transition-colors",title:"Close",children:e.jsx(G,{className:"w-5 h-5 text-slate-500"})})]})}),e.jsx("div",{className:"max-w-6xl mx-auto w-full px-6 py-8 space-y-8",children:L?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx("div",{className:"h-32 bg-slate-100 rounded-2xl animate-pulse"},s))}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-500 to-purple-600 rounded-2xl p-5 text-white shadow-lg shadow-indigo-200/50",children:[e.jsx("p",{className:"text-indigo-200 text-xs font-medium uppercase",children:"Score"}),e.jsxs("p",{className:"text-3xl font-black mt-1",children:[I,"%"]}),e.jsxs("p",{className:"text-indigo-200 text-sm",children:[u,"/",n," correct"]})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(A,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Avg Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[F,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"per question"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(J,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Total Time"})]}),e.jsxs("p",{className:"text-2xl font-bold text-slate-800",children:[Math.floor(f/60),"m ",f%60,"s"]}),e.jsx("p",{className:"text-xs text-slate-400",children:"assessment duration"})]}),e.jsxs("div",{className:"bg-white rounded-2xl p-5 border border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2 text-slate-500 mb-1",children:[e.jsx(C,{className:"w-4 h-4"})," ",e.jsx("span",{className:"text-xs font-medium uppercase",children:"Risk"})]}),e.jsx("p",{className:`text-2xl font-bold ${r.overall_risk==="high"||r.overall_risk==="critical"?"text-red-600":r.overall_risk==="moderate"?"text-amber-600":"text-emerald-600"}`,children:(r.overall_risk||"unknown").charAt(0).toUpperCase()+(r.overall_risk||"unknown").slice(1)}),e.jsx("p",{className:"text-xs text-slate-400",children:"risk level"})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100 bg-gradient-to-r from-amber-50 to-orange-50",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{className:"w-5 h-5 text-amber-500"}),e.jsx("h2",{className:"font-bold text-slate-800",children:"AI Analysis"})]})}),e.jsx("div",{className:"p-6",children:Q?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-100 rounded animate-pulse w-5/6"})]}):a?e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-slate-700 leading-relaxed",children:a.overall_summary}),e.jsxs("div",{className:"bg-sky-50 border border-sky-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-sky-800 text-sm mb-2 flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4"})," Timing Patterns"]}),e.jsx("p",{className:"text-sm text-sky-700",children:a.time_analysis.insight}),a.time_analysis.slow_questions.length>0&&e.jsxs("p",{className:"text-xs text-sky-600 mt-2",children:[e.jsx("span",{className:"font-medium",children:"Took longest on:"})," ",a.time_analysis.slow_questions.join(", ")]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.strength_areas.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-emerald-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(W,{className:"w-4 h-4"})," Strengths"]}),e.jsx("ul",{className:"space-y-2",children:a.strength_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx(q,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]}),a.weakness_areas.length>0&&e.jsxs("div",{className:"border border-red-100 bg-red-50/50 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-red-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4"})," Weak Areas"]}),e.jsx("ul",{className:"space-y-2",children:a.weakness_areas.map((s,t)=>e.jsxs("li",{className:"text-sm text-red-700 flex items-start gap-2",children:[e.jsx(C,{className:"w-3.5 h-3.5 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsxs("strong",{children:[s.domain,":"]})," ",s.detail]})]},t))})]})]}),a.answer_patterns.common_mistakes.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("h3",{className:"font-semibold text-amber-800 text-sm mb-2",children:"Answer Patterns"}),e.jsx("p",{className:"text-sm text-amber-700 mb-2",children:a.answer_patterns.description}),e.jsx("ul",{className:"space-y-1",children:a.answer_patterns.common_mistakes.map((s,t)=>e.jsxs("li",{className:"text-xs text-amber-600",children:["β’ ",s]},t))})]}),a.recommendations.length>0&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-indigo-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(T,{className:"w-4 h-4"})," Recommendations"]}),e.jsx("ol",{className:"space-y-2",children:a.recommendations.map((s,t)=>e.jsxs("li",{className:"text-sm text-indigo-700",children:[e.jsxs("span",{className:"font-medium",children:[t+1,". ",s.action]}),e.jsxs("span",{className:"text-indigo-500 text-xs ml-2",children:["β ",s.reason]})]},t))})]}),e.jsxs("div",{className:"bg-slate-50 border border-slate-100 rounded-xl p-4",children:[e.jsxs("h3",{className:"font-semibold text-slate-800 text-sm mb-3 flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"})," Performance by Difficulty"]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Easy"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.easy_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Medium"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.medium_performance})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-slate-500 uppercase font-medium",children:"Hard"}),e.jsx("p",{className:"text-sm font-bold text-slate-700 mt-1",children:a.difficulty_analysis.hard_performance})]})]})]})]}):e.jsx("p",{className:"text-slate-500 text-sm",children:"Analysis unavailable."})})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(D,{className:"w-5 h-5 text-indigo-500"})," Domain Scores"]})}),e.jsx("div",{className:"p-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Object.entries(B).map(([s,t])=>e.jsxs("div",{className:"border border-slate-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-700 mb-2",children:s}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsxs("span",{className:"text-2xl font-black text-slate-800",children:[t.percentage,"%"]}),e.jsxs("span",{className:"text-xs text-slate-400 mb-1",children:[t.correct,"/",t.total]})]}),e.jsx("div",{className:"mt-2 h-2 bg-slate-100 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all ${t.percentage>=80?"bg-emerald-500":t.percentage>=60?"bg-amber-500":"bg-red-500"}`,style:{width:`${t.percentage}%`}})}),e.jsx("p",{className:`text-xs mt-1 font-medium ${t.mastery_level==="mastered"?"text-emerald-600":t.mastery_level==="developing"?"text-amber-600":"text-red-600"}`,children:t.mastery_level})]},s))})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 overflow-hidden",children:[e.jsx("div",{className:"px-6 py-4 border-b border-slate-100",children:e.jsxs("h2",{className:"font-bold text-slate-800 flex items-center gap-2",children:[e.jsx(S,{className:"w-5 h-5 text-indigo-500"})," Question-by-Question Breakdown"]})}),e.jsx("div",{className:"divide-y divide-slate-50",children:o.map((s,t)=>e.jsxs("div",{className:"px-6 py-3 hover:bg-slate-50/50 transition-colors",children:[e.jsxs("button",{onClick:()=>z(g===t?null:t),className:"w-full flex items-center gap-3 text-left",children:[e.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0 ${s.is_correct?"bg-emerald-100 text-emerald-600":"bg-red-100 text-red-600"}`,children:s.is_correct?e.jsx(q,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700 truncate",children:["Q",t+1,". ",s.question_text||`${s.topic} (${s.domain})`]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[e.jsx("span",{className:"text-xs text-slate-400",children:s.difficulty}),e.jsxs("span",{className:"text-xs text-slate-400",children:[s.time_spent_seconds,"s"]}),e.jsx("span",{className:"text-xs text-slate-400",children:s.domain})]})]}),g===t?e.jsx(O,{className:"w-4 h-4 text-slate-400"}):e.jsx(V,{className:"w-4 h-4 text-slate-400"})]}),g===t&&e.jsxs(m.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"ml-10 mt-2 pb-2 space-y-2",children:[s.question_text&&e.jsx("p",{className:"text-sm text-slate-600",children:s.question_text}),e.jsxs("div",{className:"flex flex-wrap gap-4 text-xs",children:[e.jsxs("span",{className:s.is_correct?"text-emerald-600":"text-red-600",children:["Your answer: ",e.jsx("strong",{children:s.student_answer||"β"})]}),!s.is_correct&&e.jsxs("span",{className:"text-emerald-600",children:["Correct: ",e.jsx("strong",{children:s.correct_answer})]}),e.jsxs("span",{className:"text-slate-500",children:["Time: ",s.time_spent_seconds,"s"]}),e.jsxs("span",{className:"text-slate-500",children:["Bloom: ",s.bloom_level]})]})]})]},t))})]}),e.jsx("div",{className:"flex justify-center pb-8",children:e.jsx("button",{onClick:p,className:"px-8 py-3 bg-indigo-600 hover:bg-indigo-700 text-white font-bold rounded-xl shadow-lg shadow-indigo-200 transition-all",children:h==="fullscreen"?"Continue to Dashboard":"Close"})})]})})]});return h==="modal"?e.jsx(Y,{children:c&&e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4",onClick:p,children:e.jsx(m.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"bg-white rounded-2xl shadow-xl w-full max-w-5xl max-h-[90vh] overflow-y-auto will-change-transform",onClick:s=>s.stopPropagation(),children:N})})}):e.jsx(m.div,{initial:{opacity:0},animate:{opacity:1},className:"fixed inset-0 z-50 overflow-y-auto bg-gradient-to-br from-slate-50 via-white to-indigo-50/30",children:N})};export{ge as default};
|
assets/{FloatingAITutor-BnnsbuI9.js β FloatingAITutor-wfjL9MBE.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
| 2 |
-
import{g as T,_ as w,aG as O,u as D,m as A,N as P}from"./index-
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bp7MiGcW.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-Dja0MwoB.css","assets/ChatMarkdown-Cwsa2RCx.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{g as T,_ as w,aG as O,u as D,m as A,N as P}from"./index-Bp7MiGcW.js";import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{collection as $,query as B,limit as q,orderBy as H,where as V,onSnapshot as F,doc as U,updateDoc as G}from"./vendor-firebase-firestore-CNv3xXal.js";import{M as K}from"./maximize-2-CWmKKmit.js";import{M as z}from"./minus-BK7K7Pi2.js";import{X as C}from"./x-k8d6VLEw.js";import{S as W}from"./send-BA-OOIJf.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";function X(s,o){const n=$(T,"tutorNudges",s,"nudges"),u=B(n,V("consumed","==",!1),H("createdAt","desc"),q(1));return F(u,d=>{if(d.empty){o(null);return}const h=d.docs[0],m=h.data();o({id:h.id,message:m.message,topic:m.topic,createdAt:m.createdAt?.toDate?.()||new Date,consumed:!1})},()=>o(null))}async function J(s,o){const n=U(T,"tutorNudges",s,"nudges",o);await G(n,{consumed:!0})}const Q="https://deign86-mathpulse-api-v3test.hf.space";async function Y(s){try{const{auth:o}=await w(async()=>{const{auth:u}=await import("./index-Bp7MiGcW.js").then(d=>d.b7);return{auth:u}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),n=await o.currentUser?.getIdToken();await fetch(`${Q}/api/pipeline/nudge/${s}`,{method:"POST",headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{}}})}catch{}}const Z=a.lazy(()=>w(()=>import("./ChatMarkdown-Cwsa2RCx.js"),__vite__mapDeps([12,0,1,2,3,4,5,6,7,8,9,10,11])));function ee(s){return s?s instanceof Date?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):typeof s=="object"&&"toDate"in s?s.toDate().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):String(s):""}const xe=({constraintsRef:s,onFullScreen:o})=>{const{activeSessionId:n,setActiveSessionId:u,createNewSession:d,getActiveSession:h,sendMessage:m,isLoading:f}=O(),{currentUser:c,userRole:y}=D(),[i,x]=a.useState(!1),[g,j]=a.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("floating_ai_tutor_minimized")==="1"),[p,v]=a.useState(""),[r,b]=a.useState(null),N=a.useRef(null),k=a.useRef(null);a.useEffect(()=>{if(!c?.uid||y!=="student")return;let t=!1;return X(c.uid,l=>{l&&l.id!==k.current?b(l):(b(null),t||(t=!0,Y(c.uid)))})},[c?.uid,y]),a.useEffect(()=>{typeof window>"u"||window.localStorage.setItem("floating_ai_tutor_minimized",g?"1":"0")},[g]),a.useEffect(()=>{i&&w(async()=>{const{warmupBackend:t}=await import("./index-Bp7MiGcW.js").then(l=>l.b8);return{warmupBackend:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])).then(({warmupBackend:t})=>{t()}).catch(t=>{console.warn("Floating tutor warmup skipped:",t)})},[i]),a.useEffect(()=>{if(i&&!n){const t=r?r.message:"Hi! I'm your AI math tutor. What would you like to learn about today?",l={id:r?`nudge-${r.id}`:"1",sender:"ai",text:t,timestamp:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},R=d(l);u(R)}},[i]),a.useEffect(()=>{i&&r&&c?.uid&&(k.current=r.id,J(c.uid,r.id).catch(()=>{}),b(null))},[i,r]);const I=h()?.messages||[],M=()=>{N.current?.scrollIntoView({behavior:"smooth"})};a.useEffect(()=>{M()},[I]);const _=async()=>{if(!p.trim()||!n||f)return;const t=p.trim();v(""),await m(n,t)},E=()=>{o()},S=()=>{x(!1),j(!0)},L=()=>{j(!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 ${i?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-10 pointer-events-none h-0"}`,style:{"--max-h":i?"32rem":"0",willChange:"transform, opacity"},children:[e.jsxs("div",{className:"bg-gradient-to-r from-sky-600 to-sky-500 p-4 flex items-center justify-between flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center backdrop-blur-sm",children:e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-9 h-9 object-contain drop-shadow-md"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold text-sm",children:"L.O.L.I."}),e.jsxs("p",{className:"text-sky-100 text-[10px] leading-tight",children:["Logical Operations &",e.jsx("br",{}),"Learning Intelligence"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:E,type:"button","aria-label":"Open fullscreen",className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Open fullscreen",children:e.jsx(K,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",onClick:S,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",title:"Minimize",children:e.jsx(z,{size:16,className:"text-white"})}),e.jsx("button",{type:"button","aria-label":"Close chat",onClick:()=>x(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:e.jsx(C,{size:16,className:"text-white"})})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 bg-[#edf1f7]",children:[I.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(Z,{children:t.text})}),e.jsx("p",{className:`text-[10px] mt-1 ${t.sender==="user"?"text-sky-200":"text-slate-500"}`,children:ee(t.timestamp)})]})},t.id)),f&&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:N})]}),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:p,onChange:t=>v(t.target.value),onKeyPress:t=>t.key==="Enter"&&_(),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:_,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:!p.trim()||f,children:e.jsx(W,{size:18})})]})})]}),e.jsx("div",{className:"pointer-events-auto relative self-end",children:g?e.jsx(A.button,{type:"button",onClick:L,whileHover:{scale:1.08},whileTap:{scale:.95},transition:{duration:.15,ease:"easeOut"},className:"h-9 w-9 rounded-full bg-slate-900/85 text-white shadow-lg ring-1 ring-white/20 backdrop-blur-sm flex items-center justify-center","aria-label":"Restore AI tutor launcher",title:"Show AI tutor",style:{willChange:"transform"},children:e.jsx(P,{size:14})}):e.jsxs("div",{className:"relative group",children:[!i&&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"})]}),!i&&e.jsx("button",{type:"button","aria-label":"Minimize AI tutor launcher",title:"Minimize",onClick:S,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(z,{size:12})}),e.jsxs(A.button,{type:"button",onClick:()=>x(!i),whileHover:{scale:1.1},whileTap:{scale:.9},transition:{duration:.15,ease:"easeOut"},className:"w-16 h-16 bg-gradient-to-br from-sky-600 to-sky-500 rounded-xl shadow-2xl flex items-center justify-center text-white hover:shadow-sky-300/50 transition-all","aria-label":i?"Close AI tutor chat":"Open AI tutor chat",style:{willChange:"transform"},children:[i?e.jsx(C,{size:28}):e.jsx("img",{src:"/avatar/avatar_icon.png",alt:"AI Tutor",className:"w-14 h-14 object-contain drop-shadow-lg"}),!i&&r&&e.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 bg-amber-400 rounded-full border-2 border-white animate-pulse"})]})]})})]})};export{xe as default};
|
assets/{GradesPage-Dtj8WgVn.js β GradesPage-CTmxSKZ7.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DiagnosticBreakdown-
|
| 2 |
-
import{u as re,aH as le,aI as ne,ad as oe,g as S,H as ie,A as ce,r as O,T as F,B as de,_ as me}from"./index-
|
| 3 |
`),x=new Blob([l],{type:"text/csv;charset=utf-8;"}),n=window.URL.createObjectURL(x),i=document.createElement("a"),j=r.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";i.href=n,i.setAttribute("download",`grade-report-${j}-${a}.csv`),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)};return V?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-6 lg: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-5 sm:p-6 rounded-[1.5rem] sm: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(k,{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(ie,{className:"w-4 h-4 mr-2 text-slate-400"}),"This Quarter"]}),e.jsxs(k,{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:ae,children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),"Report"]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 sm:gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 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-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm: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-10 h-10 sm:w-14 sm:h-14 bg-indigo-100 text-indigo-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(ce,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"GEN. AVE."}),e.jsx("span",{className:"hidden sm:inline",children:"General Average"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsxs("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:[ee,N>0?"%":""]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 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-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm: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-10 h-10 sm:w-14 sm:h-14 bg-emerald-100 text-emerald-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(O,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Weakest"}),e.jsx("span",{className:"hidden sm:inline",children:"Weakest Subject"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-lg sm:text-2xl font-display font-black text-slate-800 truncate",children:m?.weaknesses?.[0]||"β"})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 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-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm: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-10 h-10 sm:w-14 sm:h-14 bg-violet-100 text-violet-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(F,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Quizzes"}),e.jsx("span",{className:"hidden sm:inline",children:"Quizzes Completed"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:Z})})]})]})]}),m&&e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 p-6 shadow-sm cursor-pointer hover:shadow-md hover:border-indigo-200 transition-all",onClick:()=>v(!0),role:"button",tabIndex:0,onKeyDown:s=>{s.key==="Enter"&&v(!0)},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 bg-indigo-100 rounded-xl flex items-center justify-center",children:e.jsx(de,{className:"w-5 h-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-slate-800",children:"Diagnostic Assessment Results"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Your initial competency evaluation"})]})]}),e.jsxs("span",{className:`px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5 ${m.riskLevel==="Low"?"bg-emerald-100 text-emerald-700":m.riskLevel==="High"||m.riskLevel==="At Risk"?"bg-red-100 text-red-700":"bg-amber-100 text-amber-700"}`,children:[m.riskLevel==="Low"?e.jsx(be,{size:12}):e.jsx(ge,{size:12}),m.riskLevel]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[m.score>0&&e.jsxs("div",{className:"bg-slate-50 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase mb-1",children:"Score"}),e.jsxs("p",{className:"text-2xl font-black text-slate-800",children:[m.score,"%"]})]}),m.weaknesses.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-amber-600 uppercase mb-2",children:"Focus Areas"}),e.jsx("ul",{className:"space-y-1",children:m.weaknesses.map((s,t)=>e.jsxs("li",{className:"text-sm text-amber-800 flex items-center gap-2",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),s]},t))})]}),m.recommendation&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-indigo-600 uppercase mb-2",children:"Recommendation"}),e.jsx("p",{className:"text-sm text-indigo-800",children:m.recommendation})]})]})]}),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-[1.5rem] sm:rounded-[2rem] border border-slate-100 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] overflow-hidden flex flex-col h-full w-full",children:[e.jsxs("div",{className:"p-5 sm:p-8 border-b border-slate-50 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 sm: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-2 sm:gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:u,onChange:s=>E(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[140px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Subjects"}),h.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(q,{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:b,onChange:s=>H(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[120px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"quiz",children:"Quiz"}),e.jsx("option",{value:"practice",children:"Practice"})]}),e.jsx(q,{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 no-scrollbar flex-1 px-4 sm:px-6 pb-4 -mx-4 sm:mx-0",children:e.jsxs("table",{className:"w-full text-left border-separate border-spacing-y-2 mb-4 whitespace-nowrap md:whitespace-normal",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:f.length>0?f.map(s=>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:s.title}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:s.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:s.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 ${s.type==="practice"?"bg-emerald-100/50 text-emerald-600":"bg-indigo-100/50 text-indigo-600"}`,children:s.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 ${s.score>=80?"bg-emerald-100 text-emerald-700":s.score>=60?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:[s.score,"%"]})})]},s.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(O,{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-[1.5rem] sm:rounded-[2rem] border border-slate-100 p-5 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:I.map((s,t)=>{const r=$[s.color]||$.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`}),s.subject]}),e.jsxs("p",{className:"text-[11px] text-slate-400 font-bold ml-4 mt-0.5",children:[s.quizzes," activities"]})]}),e.jsxs("span",{className:"text-[15px] font-black text-slate-800",children:[s.average,"%"]})]}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded-full overflow-hidden shadow-inner",children:e.jsx("div",{className:`h-full rounded-full e-w ${r.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{"--w":`${Math.max(s.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]"})})})]},t)})})]}),e.jsxs("div",{className:"relative bg-gradient-to-br from-indigo-600 to-violet-700 rounded-[1.5rem] sm:rounded-[2rem] p-5 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(F,{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:G.length})," activities recently. Try a practice session to boost your lowest scores."]}),e.jsx(k,{onClick:()=>{sessionStorage.setItem("mathpulse_modules_tab","practice"),window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Modules"}}))},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"})]})]})]})]}),T&&d?.uid&&e.jsx(o.Suspense,{fallback:null,children:e.jsx(fe,{userId:d.uid,mode:"modal",isOpen:T,onClose:()=>v(!1)})})]})};export{$e as default};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DiagnosticBreakdown-DkqMV9oI.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/index-Bp7MiGcW.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-Dja0MwoB.css","assets/x-k8d6VLEw.js","assets/clock-Cc6sJz1J.js","assets/lightbulb-DG1NwVgr.js","assets/circle-check-DzQphSnP.js","assets/chart-column-Dyv8TfXk.js","assets/chevron-up-DtS9MvUZ.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{u as re,aH as le,aI as ne,ad as oe,g as S,H as ie,A as ce,r as O,T as F,B as de,_ as me}from"./index-Bp7MiGcW.js";import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{B as k}from"./button-BMVm9YQO.js";import{g as xe,S as _,s as pe}from"./subjects-DNoBzeBL.js";import{u as ue}from"./useCurriculum-BaLeFz19.js";import{getDoc as A,doc as z}from"./vendor-firebase-firestore-CNv3xXal.js";import{D as he}from"./download-DFL4ZCXr.js";import{C as be}from"./circle-check-DzQphSnP.js";import{C as ge}from"./circle-alert-CHGy8HcB.js";import{F as q}from"./funnel-KPSYPixk.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chart-column-Dyv8TfXk.js";const fe=o.lazy(()=>me(()=>import("./DiagnosticBreakdown-DkqMV9oI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))),$e=()=>{const{currentUser:d,userProfile:C}=re(),[u,E]=o.useState("all"),[b,H]=o.useState("all"),[V,w]=o.useState(!0),[g,Y]=o.useState(null),[M,K]=o.useState([]),[m,W]=o.useState(null),[T,v]=o.useState(!1),[p,J]=o.useState(null),L=C?.grade,P=xe(L),R=new Set(P),{isLoading:X}=ue(L);o.useEffect(()=>{},[X]);const D=s=>{if(s==null)return"N/A";const t=s instanceof Date?s:new Date(s);return Number.isNaN(t.getTime())?"N/A":t.toISOString().split("T")[0]};o.useEffect(()=>{if(!d)return;w(!0);const s=le(d.uid,a=>{Y(a),w(!1)}),t=ne(d.uid,a=>{K(a),w(!1)}),r=oe(d.uid,a=>{J(a)});return()=>{s(),t(),r()}},[d]),o.useEffect(()=>{d?.uid&&(async()=>{try{let s=0,t="Unknown",r=[],a="";const l=await A(z(S,"users",d.uid,"dashboardSummary","heroBannerModal"));if(l.exists()){const n=l.data();n.status==="ready"&&(s=n.latestScorePercent||0,t=n.latestRiskLevel||"Unknown",r=n.weaknesses||[],a=n.recommendation||"")}else{const n=await A(z(S,"users",d.uid));if(n.exists()){const i=n.data();(i.initialAssessmentCompleted||i.hasCompletedInitialAssessment)&&(t=i.atRiskSubjects?.length>0?"Moderate":"Low",r=i.atRiskSubjects||[])}}const x=await A(z(S,"diagnosticResults",d.uid,"cache","analysis"));if(x.exists()){const n=x.data(),i=n.recommendations||[];i.length>0&&(a=i.map(c=>c.action).join(". ")+".");const j=n.weakness_areas||[];j.length>0&&(r=j.map(c=>c.domain))}(s>0||t!=="Unknown"||r.length>0)&&W({score:s,riskLevel:t,weaknesses:r,recommendation:a||"Continue with your personalized learning path."})}catch{}})()},[d?.uid]);const N=g?.averageScore?Math.round(g.averageScore):p?.averageScore?Math.round(p.averageScore):0,Z=Math.max(g?.quizzesCompleted??0,p?.quizAttempts?.length??0),ee=N>0?N.toString():"β",se={"gen-math":"indigo","stats-prob":"violet"},$={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"}},U=_.reduce((s,t)=>(s[t.id]={label:t.name,color:se[t.id]||"slate"},s),{}),h=_.filter(s=>R.has(s.id)).map(s=>s.name),B=Object.entries(p?.subjects??{}).filter(([s])=>R.has(s)).map(([s,t])=>{const r=U[s]||{label:s,color:"slate"},a=(p?.quizAttempts||[]).filter(x=>{const n=t?.modulesProgress||{};return Object.values(n).some(i=>i.quizzesCompleted?.includes(x.quizId))}),l=a.length>0?Math.round(a.reduce((x,n)=>x+n.score,0)/a.length):Math.round(t?.progress??0);return{subject:r.label,average:l,quizzes:a.length||t?.completedModules||0,color:r.color}}),te=P.map(s=>{const t=U[s]||{label:s,color:"slate"},r=g?.subjectPerformance?.[t.label],a=r?.avgScore?Math.round(r.avgScore):0;return{subject:t.label,average:a,quizzes:r?.count||0,color:t.color}}),I=B.length>0?B:te,Q=o.useMemo(()=>{if(!p?.quizAttempts?.length)return[];const s=new Map;return pe.forEach(t=>{const a=_.find(l=>l.id===t.id)?.name||t.title;t.modules.forEach(l=>{l.quizzes.forEach(x=>{s.set(x.id,{title:x.title,subject:a})})})}),p.quizAttempts.map((t,r)=>{const a=s.get(t.quizId),l=t.completedAt instanceof Date?t.completedAt:new Date(t.completedAt);return{id:1e4+r,title:a?.title||t.quizId.replace(/-/g," ").replace(/\b\w/g,x=>x.toUpperCase()),subject:a?.subject||"General Mathematics",score:Math.round(t.score),date:D(l),type:"quiz",status:t.score>=80?"Excellent":t.score>=60?"Passing":"Needs Review",_timestamp:l.getTime()}})},[p?.quizAttempts]),G=o.useMemo(()=>{const s=M.slice().map((a,l)=>({id:l+1,title:a.title||`Assessment ${l+1}`,subject:a.subject||"General",score:a.score,date:a.completedAt?D(a.completedAt.toDate()):"N/A",type:a.type==="practice"?"practice":(a.type==="diagnostic","quiz"),status:a.score>=80?"Excellent":a.score>=60?"Passing":"Needs Review",_timestamp:a.completedAt?.toDate?.()?.getTime()??0})),t=new Set(s.map(a=>a.title.toLowerCase())),r=Q.filter(a=>!t.has(a.title.toLowerCase()));return[...s,...r].sort((a,l)=>(l._timestamp||0)-(a._timestamp||0)).slice(0,20).filter(a=>h.includes(a.subject))},[M,Q,h]),f=G.filter(s=>{if(!h.includes(s.subject))return!1;const t=u==="all"||s.subject===u,r=b==="all"||s.type===b;return t&&r});o.useEffect(()=>{u!=="all"&&(h.includes(u)||E("all"))},[h,u]);const ae=()=>{const s=c=>{const y=String(c??"");return/[",\n]/.test(y)?`"${y.replace(/"/g,'""')}"`:y},t=[],r=C?.name||d?.displayName||d?.email||"Student",a=new Date().toISOString().split("T")[0];t.push("Grade Report"),t.push(`Student,${s(r)}`),t.push(`Export Date,${s(a)}`),t.push(`Subject Filter,${s(u)}`),t.push(`Type Filter,${s(b)}`),t.push(""),t.push("Subject Performance"),t.push("Subject,Average Score"),I.forEach(c=>{t.push([s(c.subject),s(c.average)].join(","))}),t.push(""),t.push("Recent Quizzes"),t.push("Title,Subject,Score,Date,Type,Status"),f.length===0?t.push("No quiz data available for the selected filters"):f.forEach(c=>{t.push([s(c.title),s(c.subject),s(c.score),s(c.date),s(c.type),s(c.status)].join(","))});const l=t.join(`
|
| 3 |
`),x=new Blob([l],{type:"text/csv;charset=utf-8;"}),n=window.URL.createObjectURL(x),i=document.createElement("a"),j=r.replace(/[^a-z0-9]+/gi,"-").replace(/^-+|-+$/g,"").toLowerCase()||"student";i.href=n,i.setAttribute("download",`grade-report-${j}-${a}.csv`),document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)};return V?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-6 lg: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-5 sm:p-6 rounded-[1.5rem] sm: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(k,{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(ie,{className:"w-4 h-4 mr-2 text-slate-400"}),"This Quarter"]}),e.jsxs(k,{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:ae,children:[e.jsx(he,{className:"w-4 h-4 mr-2"}),"Report"]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 sm:gap-6",children:[e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 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-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm: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-10 h-10 sm:w-14 sm:h-14 bg-indigo-100 text-indigo-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(ce,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"GEN. AVE."}),e.jsx("span",{className:"hidden sm:inline",children:"General Average"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsxs("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:[ee,N>0?"%":""]})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 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-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm: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-10 h-10 sm:w-14 sm:h-14 bg-emerald-100 text-emerald-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(O,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Weakest"}),e.jsx("span",{className:"hidden sm:inline",children:"Weakest Subject"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-lg sm:text-2xl font-display font-black text-slate-800 truncate",children:m?.weaknesses?.[0]||"β"})})]})]}),e.jsxs("div",{className:"bg-white rounded-[1.2rem] sm:rounded-[2rem] border border-slate-100 p-4 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-6 -top-6 sm:-right-8 sm:-top-8 w-20 h-20 sm:w-32 sm: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-10 h-10 sm:w-14 sm:h-14 bg-violet-100 text-violet-600 rounded-xl sm:rounded-2xl flex items-center justify-center mb-3 sm:mb-6 shadow-sm",children:e.jsx(F,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),e.jsxs("p",{className:"text-slate-400 font-bold text-[9px] sm:text-sm tracking-wider sm:tracking-wide uppercase h-6 sm:h-auto flex items-end sm:block",children:[e.jsx("span",{className:"sm:hidden",children:"Quizzes"}),e.jsx("span",{className:"hidden sm:inline",children:"Quizzes Completed"})]}),e.jsx("div",{className:"flex items-end gap-2 mt-1 sm:mt-2",children:e.jsx("h3",{className:"text-xl sm:text-4xl font-display font-black text-slate-800",children:Z})})]})]})]}),m&&e.jsxs("div",{className:"bg-white rounded-2xl border border-slate-100 p-6 shadow-sm cursor-pointer hover:shadow-md hover:border-indigo-200 transition-all",onClick:()=>v(!0),role:"button",tabIndex:0,onKeyDown:s=>{s.key==="Enter"&&v(!0)},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 bg-indigo-100 rounded-xl flex items-center justify-center",children:e.jsx(de,{className:"w-5 h-5 text-indigo-600"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-slate-800",children:"Diagnostic Assessment Results"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Your initial competency evaluation"})]})]}),e.jsxs("span",{className:`px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5 ${m.riskLevel==="Low"?"bg-emerald-100 text-emerald-700":m.riskLevel==="High"||m.riskLevel==="At Risk"?"bg-red-100 text-red-700":"bg-amber-100 text-amber-700"}`,children:[m.riskLevel==="Low"?e.jsx(be,{size:12}):e.jsx(ge,{size:12}),m.riskLevel]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[m.score>0&&e.jsxs("div",{className:"bg-slate-50 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase mb-1",children:"Score"}),e.jsxs("p",{className:"text-2xl font-black text-slate-800",children:[m.score,"%"]})]}),m.weaknesses.length>0&&e.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-amber-600 uppercase mb-2",children:"Focus Areas"}),e.jsx("ul",{className:"space-y-1",children:m.weaknesses.map((s,t)=>e.jsxs("li",{className:"text-sm text-amber-800 flex items-center gap-2",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400"}),s]},t))})]}),m.recommendation&&e.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 rounded-xl p-4",children:[e.jsx("p",{className:"text-xs font-bold text-indigo-600 uppercase mb-2",children:"Recommendation"}),e.jsx("p",{className:"text-sm text-indigo-800",children:m.recommendation})]})]})]}),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-[1.5rem] sm:rounded-[2rem] border border-slate-100 shadow-[0_8px_30px_-12px_rgba(0,0,0,0.06)] overflow-hidden flex flex-col h-full w-full",children:[e.jsxs("div",{className:"p-5 sm:p-8 border-b border-slate-50 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 sm: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-2 sm:gap-3 w-full sm:w-auto",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-none",children:[e.jsxs("select",{value:u,onChange:s=>E(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[140px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Subjects"}),h.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx(q,{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:b,onChange:s=>H(s.target.value),className:"appearance-none w-full pl-3 pr-8 py-2.5 border-none bg-slate-50 rounded-xl text-xs sm:text-sm font-bold text-slate-600 focus:ring-2 focus:ring-indigo-500/30 transition-all cursor-pointer min-w-0 sm:min-w-[120px] shadow-sm",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"quiz",children:"Quiz"}),e.jsx("option",{value:"practice",children:"Practice"})]}),e.jsx(q,{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 no-scrollbar flex-1 px-4 sm:px-6 pb-4 -mx-4 sm:mx-0",children:e.jsxs("table",{className:"w-full text-left border-separate border-spacing-y-2 mb-4 whitespace-nowrap md:whitespace-normal",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:f.length>0?f.map(s=>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:s.title}),e.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-1",children:s.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:s.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 ${s.type==="practice"?"bg-emerald-100/50 text-emerald-600":"bg-indigo-100/50 text-indigo-600"}`,children:s.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 ${s.score>=80?"bg-emerald-100 text-emerald-700":s.score>=60?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:[s.score,"%"]})})]},s.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(O,{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-[1.5rem] sm:rounded-[2rem] border border-slate-100 p-5 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:I.map((s,t)=>{const r=$[s.color]||$.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`}),s.subject]}),e.jsxs("p",{className:"text-[11px] text-slate-400 font-bold ml-4 mt-0.5",children:[s.quizzes," activities"]})]}),e.jsxs("span",{className:"text-[15px] font-black text-slate-800",children:[s.average,"%"]})]}),e.jsx("div",{className:"h-2.5 w-full bg-slate-100 rounded-full overflow-hidden shadow-inner",children:e.jsx("div",{className:`h-full rounded-full e-w ${r.bar} shadow-sm relative overflow-hidden transition-all duration-1000`,style:{"--w":`${Math.max(s.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]"})})})]},t)})})]}),e.jsxs("div",{className:"relative bg-gradient-to-br from-indigo-600 to-violet-700 rounded-[1.5rem] sm:rounded-[2rem] p-5 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(F,{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:G.length})," activities recently. Try a practice session to boost your lowest scores."]}),e.jsx(k,{onClick:()=>{sessionStorage.setItem("mathpulse_modules_tab","practice"),window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Modules"}}))},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"})]})]})]})]}),T&&d?.uid&&e.jsx(o.Suspense,{fallback:null,children:e.jsx(fe,{userId:d.uid,mode:"modal",isOpen:T,onClose:()=>v(!1)})})]})};export{$e as default};
|
assets/{HeroBanner-B32-rtu2.js β HeroBanner-BMkaVujy.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-
|
| 2 |
-
import{T as R,g as b,a3 as M,h as _,m as f,a4 as E,A as G,B as S,r as z,Z as Y,a as F,_ as Q}from"./index-
|
| 3 |
-
${s.latestRiskLevel==="At Risk"?"bg-red-100 text-red-700":s.latestRiskLevel==="Needs Attention"?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"}`,children:[s.latestRiskLevel==="At Risk"?e.jsx(V,{className:"w-4 h-4"}):s.latestRiskLevel==="Needs Attention"?e.jsx(H,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"}),s.latestRiskLevel]})]}),e.jsx("div",{className:"bg-slate-50 p-5 rounded-2xl border border-slate-100",children:e.jsx("p",{className:"text-slate-700 leading-relaxed",children:s.summary})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.strengths?.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/30 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-semibold text-emerald-800 mb-3 flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Strengths"]}),e.jsx("ul",{className:"space-y-2",children:s.strengths.map((a,r)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 mt-1.5 flex-shrink-0"}),e.jsx("span",{children:a})]},r))})]}),s.weaknesses?.length>0&&e.jsxs("div",{className:"border border-amber-100 bg-amber-50/30 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-semibold text-amber-800 mb-3 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Focus Areas"]}),e.jsx("ul",{className:"space-y-2",children:s.weaknesses.map((a,r)=>e.jsxs("li",{className:"text-sm text-amber-700 flex items-start gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 mt-1.5 flex-shrink-0"}),e.jsx("span",{children:a})]},r))})]})]}),s.recommendation&&e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50 to-purple-50 rounded-xl p-5 border border-indigo-100",children:[e.jsxs("h4",{className:"font-semibold text-indigo-900 mb-2 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4 text-indigo-500"}),"Recommended Next Step"]}),e.jsx("p",{className:"text-sm text-indigo-800 leading-relaxed",children:s.recommendation})]})]}),de=({heroBannerSummary:s,latestResult:a,loading:r})=>r?e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-32 bg-slate-200 rounded-xl"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-slate-200 rounded w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-200 rounded w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-200 rounded w-5/6"})]})]}):!s&&!a?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-16 h-16 bg-sky-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(S,{className:"w-8 h-8 text-sky-500"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"Let's personalize your learning"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-xs mx-auto",children:"Complete your diagnostic assessment so I can understand your strengths, weak areas, and the best next lessons for you."})]}):s?.status==="ready"?e.jsx(ie,{summary:s}):a?e.jsx(ne,{result:a}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-16 h-16 bg-amber-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(H,{className:"w-8 h-8 text-amber-500"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"Your learning summary is being prepared"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-xs mx-auto",children:"Please try opening this again in a moment."})]});async function ce(s){const a=await L(C(b,"competencyProfiles",s)).catch(()=>null);if(a?.exists()){const t=a.data(),l=t.primaryStrength?[t.primaryStrength]:[],o=t.primaryWeakness?[t.primaryWeakness]:[];return{status:"ready",headline:t.overallScore>=70?"Good job β keep it up!":"Let's build your foundation",summary:o.length>0?`Focus on strengthening ${o[0]} to improve your overall performance.`:"Keep practicing to maintain and expand your skills.",strengths:l,weaknesses:o,recommendation:t.suggestedModule?`Start with the ${t.suggestedModule} module.`:"Continue with your personalized learning path.",latestAssessmentId:"",latestScorePercent:t.overallScore||0,latestRiskLevel:t.overallScore>=70?"Low":t.overallScore>=50?"Moderate":"High",updatedAt:t.updatedAt?.toDate?.()||new Date}}const r=await A(w(v(b,"assessments",s,"attempts"),k("completedAt","desc"),N(1))).catch(()=>null);if(r&&!r.empty){const t=r.docs[0].data(),l=t.rawScore||t.overallScorePercent||0,o=t.proficiencyProfile;return{status:"ready",headline:l>=70?"Good job β keep it up!":"Let's build your foundation",summary:o?.weaknesses?.length>0?`Focus on strengthening ${o.weaknesses[0]} to improve.`:l>=70?"You have a solid foundation!":"With practice, you'll build confidence.",strengths:o?.strengths||[],weaknesses:o?.weaknesses||[],recommendation:o?.suggestedStartingModule?`Start with ${o.suggestedStartingModule}.`:"Follow your personalized learning path.",latestAssessmentId:t.assessmentId||"",latestScorePercent:l,latestRiskLevel:l>=70?"Low":l>=50?"Moderate":"High",updatedAt:t.completedAt?.toDate?.()||new Date}}const c=await L(C(b,"diagnosticResults",s)).catch(()=>null);if(c?.exists()){const t=c.data(),l=t.overallScorePercent||t.overall_score_percent||0,o=t.riskProfile?.weak_domains||[];return{status:"ready",headline:l>=70?"Good job β keep it up!":"Let's build your foundation",summary:o.length>0?`Areas to focus on: ${o.join(", ")}.`:"Assessment completed. Follow your learning path.",strengths:[],weaknesses:o,recommendation:t.recommended_intervention||"Continue with your personalized learning path.",latestAssessmentId:"",latestScorePercent:l,latestRiskLevel:t.overall_risk||(l>=70?"Low":"Moderate"),updatedAt:t.completedAt?.toDate?.()||new Date}}const i=await A(w(v(b,"users",s,"assessments"),k("completedAt","desc"),N(5))).catch(()=>null);if(i&&!i.empty){const t=i.docs.map(p=>p.data()),l=t[0],o=l.score||l.scorePercent||0,x=t.length,j=Math.round(t.reduce((p,u)=>p+(u.score||u.scorePercent||0),0)/x);return{status:"ready",headline:o>=70?"Good job β keep it up!":"Let's build your foundation",summary:`You've completed ${x} diagnostic assessment${x>1?"s":""}. Your latest score is ${o}% (average: ${j}%).`,strengths:[],weaknesses:l.risk==="At Risk"||l.risk==="High"?[l.subject||"General Mathematics"]:[],recommendation:"Continue with your personalized learning path to strengthen weak areas.",latestAssessmentId:l.testId||"",latestScorePercent:o,latestRiskLevel:l.risk||(o>=70?"Low":o>=50?"Moderate":"High"),updatedAt:l.completedAt?.toDate?.()||new Date}}const n=await L(C(b,"users",s)).catch(()=>null);if(n?.exists()){const t=n.data();if(t.initialAssessmentCompleted||t.hasCompletedInitialAssessment){const l=t.atRiskSubjects||[];return{status:"ready",headline:"Assessment Complete! β",summary:l.length>0?`Areas to focus on: ${l.join(", ")}. Follow your personalized learning path to improve.`:"Your diagnostic assessment is complete. Your personalized learning path is ready.",strengths:[],weaknesses:l,recommendation:"Continue with your recommended lessons to strengthen your skills.",latestAssessmentId:"",latestScorePercent:0,latestRiskLevel:l.length>0?"Moderate":"Low",updatedAt:t.assessmentCompletedAt?.toDate?.()||new Date}}}return null}const me=({isOpen:s,onClose:a,studentId:r,latestResult:c,heroBannerSummary:i})=>{const[n,t]=m.useState("latest"),[l,o]=m.useState(c||null),[x,j]=m.useState([]),[p,u]=m.useState(!1),[g,y]=m.useState(null);m.useEffect(()=>{if(s&&r&&!i){const d=M(r,h=>{y(h)});return()=>d()}},[s,r,i]);const $=i||g;m.useEffect(()=>{s&&r&&(u(!0),(async()=>{try{const[h,T]=await Promise.all([c?Promise.resolve(c):le(r),re(r)]);if(o(h),j(T),!i&&!g){const D=await E(r);if(D)y(D);else{const P=await ce(r);P&&y(P)}}}catch(h){console.error("[AssessmentResultsModal] fetch error:",h)}finally{u(!1)}})())},[s,r,c]);const B=[{key:"latest",label:"Last Results",icon:e.jsx(G,{className:"w-4 h-4"})},{key:"history",label:"History & Trends",icon:e.jsx(R,{className:"w-4 h-4"})}];return e.jsx(W,{open:s,onOpenChange:d=>!d&&a(),children:e.jsxs(q,{className:"max-w-2xl max-h-[85vh] overflow-y-auto p-0 bg-white rounded-2xl shadow-2xl border-0",children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-white border-b border-slate-200 rounded-t-2xl px-6 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-xl font-bold text-slate-800",children:"Assessment Results"}),e.jsx("button",{onClick:a,className:"p-1.5 rounded-lg hover:bg-slate-100 transition-colors",children:e.jsx(ee,{className:"w-5 h-5 text-slate-400"})})]}),e.jsx("div",{className:"flex gap-1 bg-slate-100 p-1 rounded-lg",children:B.map(d=>e.jsxs("button",{onClick:()=>t(d.key),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-all ${n===d.key?"bg-white text-sky-600 shadow-sm":"text-slate-600 hover:text-slate-800"}`,children:[d.icon,d.label]},d.key))})]}),e.jsx("div",{className:"px-6 py-5",children:e.jsxs(_,{mode:"wait",children:[n==="latest"&&e.jsx(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:e.jsx(de,{heroBannerSummary:$,latestResult:l,loading:p})},"latest"),n==="history"&&e.jsxs(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:[e.jsx(ae,{history:x}),x.length>0&&e.jsxs("div",{className:"mt-6 space-y-2",children:[e.jsx("h3",{className:"font-semibold text-slate-800 mb-3",children:"All Attempts"}),x.map((d,h)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700",children:["Attempt ",x.length-h]}),e.jsx("p",{className:"text-xs text-slate-500",children:new Date(d.completedAt).toLocaleDateString()})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-sm font-semibold text-sky-600",children:[d.percentage,"%"]}),e.jsx("p",{className:"text-xs text-slate-500",children:d.proficiencyLevel})]})]},h))]})]},"history")]})})]})})},xe=m.lazy(()=>Q(()=>import("./DashboardAvatar-CbAKGmA6.js"),__vite__mapDeps([0,1,2]))),Ce=({userName:s="Student",userLevel:a=1,avatarLayers:r,onContinueLearning:c,showAssessmentTooltip:i,onOpenAssessment:n,studentId:t,assessmentCompleted:l=!1})=>{const[o,x]=m.useState(!1),[j,p]=m.useState(null);m.useEffect(()=>{if(!o||!t)return;const g=M(t,y=>{p(y)});return()=>g()},[o,t]),m.useEffect(()=>{o||p(null)},[o]);const u=()=>{const g=new Date().getHours();return g<12?"Good Morning":g<18?"Good Afternoon":"Good Evening"};return e.jsxs(f.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-2xl md:rounded-[2rem] p-5 md: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-2xl md: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 flex-col md:flex-row min-h-[140px] lg:min-h-[160px] items-start md:items-center justify-between gap-4 md:gap-6 pb-0",children:e.jsxs("div",{className:"flex-1 w-full md:w-auto min-w-0 pr-0 md:pr-40 lg:pr-[280px] pb-2 md:pb-0 py-1",children:[e.jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center gap-2 mb-3 md: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 ",a]})}),e.jsxs("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-rose-50 border border-rose-200",children:[e.jsx(Y,{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-2xl md:text-2xl lg:text-3xl font-display font-black text-[#0a1628] mb-1.5 tracking-tight leading-[1.1]",children:[u(),", ",s,"!"]}),e.jsx("p",{className:"text-slate-500 mb-2 md:mb-1 text-sm md:text-sm font-body font-bold pr-[155px] md:pr-0",children:"Today is a great day to move one step forward in math mastery."}),e.jsx("p",{className:"text-xs md:text-xs text-slate-400 font-body mb-5 md:mb-4 pr-[150px] md:pr-0",children:"Focus on your next recommended lesson and keep your momentum."}),e.jsxs(f.button,{onClick:c,whileHover:{scale:1.03},whileTap:{scale:.97},className:"mt-2 md:mt-2 bg-gradient-to-r from-purple-600 to-[#9956DE] text-white px-5 py-3 md:py-2 rounded-xl font-body font-bold text-base md:text-sm shadow-lg shadow-purple-500/20 hover:shadow-purple-500/30 transition-all flex justify-center md:justify-start items-center gap-2 group w-auto md:w-auto",children:["Continue Learning",e.jsx(F,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})}),i&&e.jsx(f.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:n,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(S,{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"})]})}),l&&!i&&e.jsx(f.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:()=>window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Grades"}})),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-teal-300 relative transition-all group-hover:bg-teal-50 group-hover:border-teal-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 bg-teal-100 rounded-full flex items-center justify-center shrink-0",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"text-teal-600",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-teal-900 leading-tight",children:["Assessment Complete!",e.jsx("br",{}),e.jsx("span",{className:"text-[10px] lg:text-[11px] font-normal text-teal-700",children:"View results & history"})]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-teal-300 border-b-teal-300 rotate-45 group-hover:bg-teal-50 group-hover:border-r-teal-400 group-hover:border-b-teal-400 transition-colors"})]})}),o&&t&&e.jsx(me,{isOpen:o,onClose:()=>x(!1),studentId:t,heroBannerSummary:j}),e.jsx("div",{className:"absolute right-0 bottom-0 lg:right-10 w-[160px] md: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-[10%] md:translate-y-[21%] lg:translate-y-[19%] drop-shadow-2xl",children:e.jsx(m.Suspense,{fallback:e.jsx("div",{className:"w-full h-full scale-[1.15] md:scale-[1.25] lg:scale-[1.3] origin-bottom"}),children:e.jsx(xe,{layers:r,className:"w-full h-full scale-[1.35] md:scale-[1.25] lg:scale-[1.3] origin-bottom"})})})})]})};export{Ce as default};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardAvatar-D5djDQQ1.js","assets/vendor-react-B4AQeu28.js","assets/avatarData-ChByUhv2.js"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{T as R,g as b,a3 as M,h as _,m as f,a4 as E,A as G,B as S,r as z,Z as Y,a as F,_ as Q}from"./index-Bp7MiGcW.js";import{j as e,r as m}from"./vendor-react-B4AQeu28.js";import{D as W,a as q,S as V}from"./dialog-C3ON9pD8.js";import{R as K,L as X,C as U,X as Z,Y as O,T as I,e as J}from"./vendor-charts-CAmziV1y.js";import{collection as v,query as w,limit as N,orderBy as k,getDocs as A,getDoc as L,doc as C}from"./vendor-firebase-firestore-CNv3xXal.js";import{X as ee}from"./x-k8d6VLEw.js";import{C as H}from"./circle-alert-CHGy8HcB.js";import{C as se}from"./circle-check-DzQphSnP.js";import{S as te}from"./sparkles-fLB3ltj1.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-markdown-yqZQ_iQm.js";const ae=({history:s})=>{if(s.length===0)return e.jsxs("div",{className:"text-center py-12 text-slate-400",children:[e.jsx(R,{className:"w-12 h-12 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"Complete more assessments to see your progress history."})]});const a=s.map(r=>({date:new Date(r.completedAt).toLocaleDateString("en-US",{month:"short",day:"numeric"}),score:r.percentage,level:r.proficiencyLevel}));return e.jsx("div",{className:"w-full",children:e.jsx(K,{width:"100%",height:250,children:e.jsxs(X,{data:a,margin:{top:10,right:20,left:0,bottom:5},children:[e.jsx(U,{strokeDasharray:"3 3",stroke:"#e2e8f0"}),e.jsx(Z,{dataKey:"date",tick:{fontSize:12,fill:"#64748b"}}),e.jsx(O,{domain:[0,100],tick:{fontSize:12,fill:"#64748b"}}),e.jsx(I,{contentStyle:{borderRadius:"12px",border:"1px solid #e2e8f0",boxShadow:"0 4px 12px rgba(0,0,0,0.08)"}}),e.jsx(J,{type:"monotone",dataKey:"score",stroke:"#0ea5e9",strokeWidth:3,dot:{fill:"#0ea5e9",strokeWidth:2,r:5},activeDot:{r:7,fill:"#0284c7"}})]})})})};async function re(s){const a=v(b,"assessmentResults",s,"attempts"),r=w(a,k("completedAt","desc"),N(10));return(await A(r)).docs.map(i=>{const n=i.data();return{attemptId:n.attemptId,score:n.score,totalQuestions:n.totalQuestions,percentage:n.percentage,completedAt:n.completedAt?.toDate?.()?.toISOString()||n.completedAt,proficiencyLevel:n.proficiencyLevel}})}async function le(s){const a=v(b,"assessmentResults",s,"attempts"),r=w(a,k("completedAt","desc"),N(1)),c=await A(r);if(c.empty)return null;const n=c.docs[0].data();return{...n,completedAt:n.completedAt?.toDate?.()?.toISOString()||n.completedAt}}const oe={Beginner:"bg-amber-100 text-amber-700 border-amber-300",Developing:"bg-blue-100 text-blue-700 border-blue-300",Proficient:"bg-emerald-100 text-emerald-700 border-emerald-300",Advanced:"bg-violet-100 text-violet-700 border-violet-300"},ne=({result:s})=>e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"bg-gradient-to-br from-sky-500 to-teal-600 rounded-xl p-6 text-white",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sky-200 text-sm font-medium",children:"Total Score"}),e.jsxs("p",{className:"text-4xl font-bold",children:[s.score,"/",s.totalQuestions]}),e.jsxs("p",{className:"text-sky-200 text-sm mt-1",children:[s.percentage,"% Correct"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-sky-200 text-sm font-medium",children:"Proficiency"}),e.jsx("span",{className:`inline-block mt-1 px-3 py-1 rounded-full text-sm font-semibold border ${oe[s.proficiencyLevel]}`,children:s.proficiencyLevel})]})]})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-slate-800 mb-3 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4 text-sky-500"}),"Competency Breakdown"]}),e.jsx("div",{className:"space-y-2",children:s.competencyBreakdown.map((a,r)=>e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-slate-700",children:a.topic}),e.jsxs("p",{className:"text-xs text-slate-500",children:[a.correctAnswers,"/",a.totalQuestions," correct"]})]}),e.jsx("div",{className:"w-20 h-2 bg-slate-200 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${a.accuracyPercent>=70?"bg-emerald-500":"bg-red-400"}`,style:{width:`${a.accuracyPercent}%`}})}),e.jsxs("span",{className:"text-sm font-semibold text-slate-600 w-10 text-right",children:[a.accuracyPercent,"%"]})]},r))})]}),s.aiNarrative&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(te,{className:"w-4 h-4 text-amber-500 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm text-amber-800 leading-relaxed",children:s.aiNarrative})]})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"font-semibold text-slate-800 mb-3 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4 text-sky-500"}),"Question Breakdown"]}),e.jsx("div",{className:"space-y-3",children:s.answers.map((a,r)=>e.jsxs("div",{className:`p-4 rounded-xl border-2 ${a.isCorrect?"border-emerald-200 bg-emerald-50/30":"border-red-200 bg-red-50/30"}`,children:[e.jsxs("p",{className:"text-sm font-medium text-slate-800 mb-2",children:["Q",r+1,". ",a.questionText]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("span",{className:"text-slate-500",children:["Your answer: ",e.jsx("span",{className:a.isCorrect?"text-emerald-600 font-medium":"text-red-500 font-medium",children:a.userAnswer||"β"})]}),!a.isCorrect&&e.jsxs("span",{className:"text-slate-500",children:["Correct: ",e.jsx("span",{className:"text-emerald-600 font-medium",children:a.correctAnswer})]})]}),a.explanation&&e.jsx("p",{className:"text-xs text-slate-500 mt-2 leading-relaxed",children:a.explanation})]},r))})]})]}),ie=({summary:s})=>e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[e.jsxs("div",{className:"bg-sky-50 border border-sky-100 rounded-2xl p-4 flex items-center gap-4 flex-1",children:[e.jsxs("div",{className:"w-12 h-12 bg-sky-500 rounded-full flex items-center justify-center text-white font-bold text-lg shadow-sm",children:[s.latestScorePercent,"%"]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-slate-500",children:"Latest Score"}),e.jsx("p",{className:"text-slate-800 font-bold",children:s.headline})]})]}),s.latestRiskLevel&&e.jsxs("div",{className:`px-4 py-2 rounded-full text-sm font-semibold flex items-center gap-2
|
| 3 |
+
${s.latestRiskLevel==="At Risk"?"bg-red-100 text-red-700":s.latestRiskLevel==="Needs Attention"?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"}`,children:[s.latestRiskLevel==="At Risk"?e.jsx(V,{className:"w-4 h-4"}):s.latestRiskLevel==="Needs Attention"?e.jsx(H,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"}),s.latestRiskLevel]})]}),e.jsx("div",{className:"bg-slate-50 p-5 rounded-2xl border border-slate-100",children:e.jsx("p",{className:"text-slate-700 leading-relaxed",children:s.summary})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.strengths?.length>0&&e.jsxs("div",{className:"border border-emerald-100 bg-emerald-50/30 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-semibold text-emerald-800 mb-3 flex items-center gap-2",children:[e.jsx(R,{className:"w-4 h-4"}),"Strengths"]}),e.jsx("ul",{className:"space-y-2",children:s.strengths.map((a,r)=>e.jsxs("li",{className:"text-sm text-emerald-700 flex items-start gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 mt-1.5 flex-shrink-0"}),e.jsx("span",{children:a})]},r))})]}),s.weaknesses?.length>0&&e.jsxs("div",{className:"border border-amber-100 bg-amber-50/30 rounded-xl p-4",children:[e.jsxs("h4",{className:"font-semibold text-amber-800 mb-3 flex items-center gap-2",children:[e.jsx(z,{className:"w-4 h-4"}),"Focus Areas"]}),e.jsx("ul",{className:"space-y-2",children:s.weaknesses.map((a,r)=>e.jsxs("li",{className:"text-sm text-amber-700 flex items-start gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 mt-1.5 flex-shrink-0"}),e.jsx("span",{children:a})]},r))})]})]}),s.recommendation&&e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50 to-purple-50 rounded-xl p-5 border border-indigo-100",children:[e.jsxs("h4",{className:"font-semibold text-indigo-900 mb-2 flex items-center gap-2",children:[e.jsx(S,{className:"w-4 h-4 text-indigo-500"}),"Recommended Next Step"]}),e.jsx("p",{className:"text-sm text-indigo-800 leading-relaxed",children:s.recommendation})]})]}),de=({heroBannerSummary:s,latestResult:a,loading:r})=>r?e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-32 bg-slate-200 rounded-xl"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-slate-200 rounded w-3/4"}),e.jsx("div",{className:"h-4 bg-slate-200 rounded w-1/2"}),e.jsx("div",{className:"h-4 bg-slate-200 rounded w-5/6"})]})]}):!s&&!a?e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-16 h-16 bg-sky-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(S,{className:"w-8 h-8 text-sky-500"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"Let's personalize your learning"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-xs mx-auto",children:"Complete your diagnostic assessment so I can understand your strengths, weak areas, and the best next lessons for you."})]}):s?.status==="ready"?e.jsx(ie,{summary:s}):a?e.jsx(ne,{result:a}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-16 h-16 bg-amber-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(H,{className:"w-8 h-8 text-amber-500"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-800 mb-2",children:"Your learning summary is being prepared"}),e.jsx("p",{className:"text-sm text-slate-500 max-w-xs mx-auto",children:"Please try opening this again in a moment."})]});async function ce(s){const a=await L(C(b,"competencyProfiles",s)).catch(()=>null);if(a?.exists()){const t=a.data(),l=t.primaryStrength?[t.primaryStrength]:[],o=t.primaryWeakness?[t.primaryWeakness]:[];return{status:"ready",headline:t.overallScore>=70?"Good job β keep it up!":"Let's build your foundation",summary:o.length>0?`Focus on strengthening ${o[0]} to improve your overall performance.`:"Keep practicing to maintain and expand your skills.",strengths:l,weaknesses:o,recommendation:t.suggestedModule?`Start with the ${t.suggestedModule} module.`:"Continue with your personalized learning path.",latestAssessmentId:"",latestScorePercent:t.overallScore||0,latestRiskLevel:t.overallScore>=70?"Low":t.overallScore>=50?"Moderate":"High",updatedAt:t.updatedAt?.toDate?.()||new Date}}const r=await A(w(v(b,"assessments",s,"attempts"),k("completedAt","desc"),N(1))).catch(()=>null);if(r&&!r.empty){const t=r.docs[0].data(),l=t.rawScore||t.overallScorePercent||0,o=t.proficiencyProfile;return{status:"ready",headline:l>=70?"Good job β keep it up!":"Let's build your foundation",summary:o?.weaknesses?.length>0?`Focus on strengthening ${o.weaknesses[0]} to improve.`:l>=70?"You have a solid foundation!":"With practice, you'll build confidence.",strengths:o?.strengths||[],weaknesses:o?.weaknesses||[],recommendation:o?.suggestedStartingModule?`Start with ${o.suggestedStartingModule}.`:"Follow your personalized learning path.",latestAssessmentId:t.assessmentId||"",latestScorePercent:l,latestRiskLevel:l>=70?"Low":l>=50?"Moderate":"High",updatedAt:t.completedAt?.toDate?.()||new Date}}const c=await L(C(b,"diagnosticResults",s)).catch(()=>null);if(c?.exists()){const t=c.data(),l=t.overallScorePercent||t.overall_score_percent||0,o=t.riskProfile?.weak_domains||[];return{status:"ready",headline:l>=70?"Good job β keep it up!":"Let's build your foundation",summary:o.length>0?`Areas to focus on: ${o.join(", ")}.`:"Assessment completed. Follow your learning path.",strengths:[],weaknesses:o,recommendation:t.recommended_intervention||"Continue with your personalized learning path.",latestAssessmentId:"",latestScorePercent:l,latestRiskLevel:t.overall_risk||(l>=70?"Low":"Moderate"),updatedAt:t.completedAt?.toDate?.()||new Date}}const i=await A(w(v(b,"users",s,"assessments"),k("completedAt","desc"),N(5))).catch(()=>null);if(i&&!i.empty){const t=i.docs.map(p=>p.data()),l=t[0],o=l.score||l.scorePercent||0,x=t.length,j=Math.round(t.reduce((p,u)=>p+(u.score||u.scorePercent||0),0)/x);return{status:"ready",headline:o>=70?"Good job β keep it up!":"Let's build your foundation",summary:`You've completed ${x} diagnostic assessment${x>1?"s":""}. Your latest score is ${o}% (average: ${j}%).`,strengths:[],weaknesses:l.risk==="At Risk"||l.risk==="High"?[l.subject||"General Mathematics"]:[],recommendation:"Continue with your personalized learning path to strengthen weak areas.",latestAssessmentId:l.testId||"",latestScorePercent:o,latestRiskLevel:l.risk||(o>=70?"Low":o>=50?"Moderate":"High"),updatedAt:l.completedAt?.toDate?.()||new Date}}const n=await L(C(b,"users",s)).catch(()=>null);if(n?.exists()){const t=n.data();if(t.initialAssessmentCompleted||t.hasCompletedInitialAssessment){const l=t.atRiskSubjects||[];return{status:"ready",headline:"Assessment Complete! β",summary:l.length>0?`Areas to focus on: ${l.join(", ")}. Follow your personalized learning path to improve.`:"Your diagnostic assessment is complete. Your personalized learning path is ready.",strengths:[],weaknesses:l,recommendation:"Continue with your recommended lessons to strengthen your skills.",latestAssessmentId:"",latestScorePercent:0,latestRiskLevel:l.length>0?"Moderate":"Low",updatedAt:t.assessmentCompletedAt?.toDate?.()||new Date}}}return null}const me=({isOpen:s,onClose:a,studentId:r,latestResult:c,heroBannerSummary:i})=>{const[n,t]=m.useState("latest"),[l,o]=m.useState(c||null),[x,j]=m.useState([]),[p,u]=m.useState(!1),[g,y]=m.useState(null);m.useEffect(()=>{if(s&&r&&!i){const d=M(r,h=>{y(h)});return()=>d()}},[s,r,i]);const $=i||g;m.useEffect(()=>{s&&r&&(u(!0),(async()=>{try{const[h,T]=await Promise.all([c?Promise.resolve(c):le(r),re(r)]);if(o(h),j(T),!i&&!g){const D=await E(r);if(D)y(D);else{const P=await ce(r);P&&y(P)}}}catch(h){console.error("[AssessmentResultsModal] fetch error:",h)}finally{u(!1)}})())},[s,r,c]);const B=[{key:"latest",label:"Last Results",icon:e.jsx(G,{className:"w-4 h-4"})},{key:"history",label:"History & Trends",icon:e.jsx(R,{className:"w-4 h-4"})}];return e.jsx(W,{open:s,onOpenChange:d=>!d&&a(),children:e.jsxs(q,{className:"max-w-2xl max-h-[85vh] overflow-y-auto p-0 bg-white rounded-2xl shadow-2xl border-0",children:[e.jsxs("div",{className:"sticky top-0 z-10 bg-white border-b border-slate-200 rounded-t-2xl px-6 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-xl font-bold text-slate-800",children:"Assessment Results"}),e.jsx("button",{onClick:a,className:"p-1.5 rounded-lg hover:bg-slate-100 transition-colors",children:e.jsx(ee,{className:"w-5 h-5 text-slate-400"})})]}),e.jsx("div",{className:"flex gap-1 bg-slate-100 p-1 rounded-lg",children:B.map(d=>e.jsxs("button",{onClick:()=>t(d.key),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-all ${n===d.key?"bg-white text-sky-600 shadow-sm":"text-slate-600 hover:text-slate-800"}`,children:[d.icon,d.label]},d.key))})]}),e.jsx("div",{className:"px-6 py-5",children:e.jsxs(_,{mode:"wait",children:[n==="latest"&&e.jsx(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:e.jsx(de,{heroBannerSummary:$,latestResult:l,loading:p})},"latest"),n==="history"&&e.jsxs(f.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},children:[e.jsx(ae,{history:x}),x.length>0&&e.jsxs("div",{className:"mt-6 space-y-2",children:[e.jsx("h3",{className:"font-semibold text-slate-800 mb-3",children:"All Attempts"}),x.map((d,h)=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-50 rounded-lg",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-medium text-slate-700",children:["Attempt ",x.length-h]}),e.jsx("p",{className:"text-xs text-slate-500",children:new Date(d.completedAt).toLocaleDateString()})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-sm font-semibold text-sky-600",children:[d.percentage,"%"]}),e.jsx("p",{className:"text-xs text-slate-500",children:d.proficiencyLevel})]})]},h))]})]},"history")]})})]})})},xe=m.lazy(()=>Q(()=>import("./DashboardAvatar-D5djDQQ1.js"),__vite__mapDeps([0,1,2]))),Ce=({userName:s="Student",userLevel:a=1,avatarLayers:r,onContinueLearning:c,showAssessmentTooltip:i,onOpenAssessment:n,studentId:t,assessmentCompleted:l=!1})=>{const[o,x]=m.useState(!1),[j,p]=m.useState(null);m.useEffect(()=>{if(!o||!t)return;const g=M(t,y=>{p(y)});return()=>g()},[o,t]),m.useEffect(()=>{o||p(null)},[o]);const u=()=>{const g=new Date().getHours();return g<12?"Good Morning":g<18?"Good Afternoon":"Good Evening"};return e.jsxs(f.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-2xl md:rounded-[2rem] p-5 md: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-2xl md: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 flex-col md:flex-row min-h-[140px] lg:min-h-[160px] items-start md:items-center justify-between gap-4 md:gap-6 pb-0",children:e.jsxs("div",{className:"flex-1 w-full md:w-auto min-w-0 pr-0 md:pr-40 lg:pr-[280px] pb-2 md:pb-0 py-1",children:[e.jsxs("div",{className:"flex flex-wrap md:flex-nowrap items-center gap-2 mb-3 md: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 ",a]})}),e.jsxs("div",{className:"px-3 md:px-4 py-1.5 rounded-full bg-rose-50 border border-rose-200",children:[e.jsx(Y,{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-2xl md:text-2xl lg:text-3xl font-display font-black text-[#0a1628] mb-1.5 tracking-tight leading-[1.1]",children:[u(),", ",s,"!"]}),e.jsx("p",{className:"text-slate-500 mb-2 md:mb-1 text-sm md:text-sm font-body font-bold pr-[155px] md:pr-0",children:"Today is a great day to move one step forward in math mastery."}),e.jsx("p",{className:"text-xs md:text-xs text-slate-400 font-body mb-5 md:mb-4 pr-[150px] md:pr-0",children:"Focus on your next recommended lesson and keep your momentum."}),e.jsxs(f.button,{onClick:c,whileHover:{scale:1.03},whileTap:{scale:.97},className:"mt-2 md:mt-2 bg-gradient-to-r from-purple-600 to-[#9956DE] text-white px-5 py-3 md:py-2 rounded-xl font-body font-bold text-base md:text-sm shadow-lg shadow-purple-500/20 hover:shadow-purple-500/30 transition-all flex justify-center md:justify-start items-center gap-2 group w-auto md:w-auto",children:["Continue Learning",e.jsx(F,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})}),i&&e.jsx(f.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:n,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(S,{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"})]})}),l&&!i&&e.jsx(f.div,{initial:{opacity:0,scale:.9,x:10},animate:{opacity:1,scale:1,x:0},transition:{delay:.5,type:"spring"},onClick:()=>window.dispatchEvent(new CustomEvent("mathpulse:navigate",{detail:{tab:"Grades"}})),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-teal-300 relative transition-all group-hover:bg-teal-50 group-hover:border-teal-400 group-hover:-translate-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 bg-teal-100 rounded-full flex items-center justify-center shrink-0",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"text-teal-600",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})})}),e.jsxs("p",{className:"text-xs lg:text-sm font-bold text-teal-900 leading-tight",children:["Assessment Complete!",e.jsx("br",{}),e.jsx("span",{className:"text-[10px] lg:text-[11px] font-normal text-teal-700",children:"View results & history"})]})]}),e.jsx("div",{className:"absolute -right-2 bottom-0 w-4 h-4 bg-white border-2 border-transparent border-r-teal-300 border-b-teal-300 rotate-45 group-hover:bg-teal-50 group-hover:border-r-teal-400 group-hover:border-b-teal-400 transition-colors"})]})}),o&&t&&e.jsx(me,{isOpen:o,onClose:()=>x(!1),studentId:t,heroBannerSummary:j}),e.jsx("div",{className:"absolute right-0 bottom-0 lg:right-10 w-[160px] md: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-[10%] md:translate-y-[21%] lg:translate-y-[19%] drop-shadow-2xl",children:e.jsx(m.Suspense,{fallback:e.jsx("div",{className:"w-full h-full scale-[1.15] md:scale-[1.25] lg:scale-[1.3] origin-bottom"}),children:e.jsx(xe,{layers:r,className:"w-full h-full scale-[1.35] md:scale-[1.25] lg:scale-[1.3] origin-bottom"})})})})]})};export{Ce as default};
|
assets/{InitialAssessmentModal-DcJcuab5.js β InitialAssessmentModal-CnFHhYba.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{B as j}from"./button-
|
|
|
|
| 1 |
+
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{B as j}from"./button-BMVm9YQO.js";import{g as y}from"./diagnosticService-E5zPXoFs.js";import{updateDoc as N,doc as v,serverTimestamp as w}from"./vendor-firebase-firestore-CNv3xXal.js";import{m as o,B as k,y as C,q as L,g as z}from"./index-Bp7MiGcW.js";import{X as S}from"./x-k8d6VLEw.js";import{C as A}from"./circle-check-big-JdaMs3bP.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const H=({isOpen:n,onClose:d,onDismiss:m,userId:c,strand:x,gradeLevel:p,onAssessmentStart:u,onAssessmentComplete:I})=>{const[t,a]=l.useState(!1),[r,i]=l.useState(null),h=async()=>{a(!0),i(null);try{const s=await y(x,p);sessionStorage.setItem("mathpulse_diagnostic",JSON.stringify({testId:s.test_id,questions:s.questions,totalItems:s.total_items,estimatedMinutes:s.estimated_minutes})),u(s.test_id,s.questions)}catch(s){const b=s instanceof Error?s.message:"Failed to load assessment";i(b),a(!1)}},f=()=>{sessionStorage.setItem("mathpulse_iar_session_dismissed","true"),d()},g=async()=>{try{await N(v(z,"users",c),{assessmentDismissed:!0,assessmentDismissedAt:w()})}catch(s){console.error("[diagnostic] Failed to save dismiss state:",s)}m()};return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:s=>s.stopPropagation(),children:e.jsxs(o.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:{type:"spring",damping:25,stiffness:200},className:"bg-white rounded-2xl shadow-2xl max-w-[44rem] w-full flex flex-col overflow-hidden pointer-events-auto",onClick:s=>s.stopPropagation(),style:{willChange:"transform, opacity"},children:[e.jsxs("div",{className:"px-5 py-3 border-b border-[#dde3eb] flex items-center justify-between bg-[#edf1f7] flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center text-purple-600",children:e.jsx(k,{size:18})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-bold text-[#0a1628] leading-tight",children:"Initial Assessment"}),e.jsx("p",{className:"text-[11px] text-[#5a6578]",children:"Analyze your strengths & weaknesses"})]})]}),e.jsx("button",{onClick:f,"aria-label":"Close assessment modal",className:"ml-auto w-8 h-8 rounded-lg flex items-center justify-center text-[#5a6578] hover:bg-[#dde3eb] hover:text-[#0a1628] transition-colors",children:e.jsx(S,{size:18})})]}),e.jsx("div",{className:"p-5 text-center space-y-3",children:e.jsxs(o.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut"},children:[e.jsx("div",{className:"w-20 h-20 bg-purple-50 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx("svg",{className:"w-9 h-9 text-purple-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"})})}),e.jsx("h3",{className:"text-lg font-bold text-[#0a1628]",children:"Welcome to MathPulse AI!"}),e.jsx("p",{className:"text-[13px] text-[#5a6578] max-w-[24rem] mx-auto leading-relaxed",children:"To personalize your learning path, complete a DepEd competency-based SHS diagnostic (15 items, around 11.6 minutes)."}),e.jsxs("div",{className:"grid grid-cols-2 gap-2.5 max-w-[28rem] mx-auto text-left mt-4",children:[e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(A,{size:14,className:"text-teal-500"}),"Personalized Path"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Get recommendations based on your level."})]}),e.jsxs("div",{className:"bg-[#edf1f7] p-2.5 rounded-lg border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-[13px] text-[#0a1628] mb-1",children:[e.jsx(C,{size:14,className:"text-rose-500"}),"Identify Risks"]}),e.jsx("p",{className:"text-[10px] text-[#5a6578] pl-[18px]",children:"Spot areas that need more attention early."})]})]}),r&&e.jsx("div",{className:"mt-3 p-2.5 bg-red-50 border border-red-200 rounded-lg",children:e.jsx("p",{className:"text-xs text-red-700",children:r})}),e.jsxs("div",{className:"pt-3 space-y-2.5",children:[e.jsx(j,{onClick:h,disabled:t,className:"bg-gradient-to-r from-purple-600 to-purple-500 hover:from-purple-700 hover:to-purple-600 text-white px-5 py-3 rounded-xl text-sm font-bold shadow-lg shadow-purple-200 w-full max-w-[380px] mx-auto",children:t?e.jsxs(e.Fragment,{children:[e.jsx(L,{size:16,className:"animate-spin mr-2"}),"Crafting your assessment..."]}):"Start Assessment"}),t&&e.jsx("p",{className:"text-[10px] text-slate-400 max-w-[24rem] mx-auto text-center leading-relaxed",children:"This may take up to 90 seconds while AI generates your personalized test."}),!t&&e.jsx("button",{onClick:g,disabled:t,className:"block mx-auto text-xs text-slate-500 hover:text-[#5a6578] transition-colors font-medium disabled:opacity-40",children:"Skip for now"})]})]})})]})}):null};export{H as default};
|
assets/{LeaderboardPage-FEtdr_oR.js β LeaderboardPage-Cl1rvXzo.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{e as O,aK as W,h as q,m as n,b as y,r as P,A as k,F as m,T as E,q as _,a6 as T,a7 as H,$ as U,u as $,aL as K,R as G,L as Q,D as X}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r as l,j as e}from"./vendor-react-B4AQeu28.js";import{e as O,aK as W,h as q,m as n,b as y,r as P,A as k,F as m,T as E,q as _,a6 as T,a7 as H,$ as U,u as $,aL as K,R as G,L as Q,D as X}from"./index-Bp7MiGcW.js";import{X as V}from"./x-k8d6VLEw.js";import{C as Z}from"./clock-Cc6sJz1J.js";import{u as J}from"./useFeatureAccess-O2Vj4dYD.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{LearningPath-Dtvj49AG.js β LearningPath-8IT3WoMT.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as p,d as g,j as r}from"./vendor-react-B4AQeu28.js";import{u as b,ab as j,ac as N,z as k,b as P,a as I}from"./index-
|
|
|
|
| 1 |
+
import{r as p,d as g,j as r}from"./vendor-react-B4AQeu28.js";import{u as b,ab as j,ac as N,z as k,b as P,a as I}from"./index-Bp7MiGcW.js";import{M as v}from"./ModuleFolderCard-BaBw0Pd9.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./useSubjectAvailability-Dm-85m8R.js";import"./deepseekRagService-Bke9fSTt.js";import"./clock-Cc6sJz1J.js";import"./bell-DyLbgepV.js";import"./info-Bcg_cBHY.js";const Y=({onNavigateToModules:m,atRiskSubjects:l=[],priorityTopics:o=[],modules:i})=>{const{userProfile:d}=b(),[x,h]=p.useState(null),a=g.useMemo(()=>{const e=o.length>0?o:l.map(s=>j(s)).filter(s=>s!==null),t=new Set;return e.filter(s=>t.has(s)?!1:(t.add(s),!0))},[o,l]),u=g.useMemo(()=>{if(a.length===0)return i.slice(0,3);const e=new Map(a.map((t,s)=>[N[t],s]));return[...i].sort((t,s)=>{const n=e.get(t.id)??Number.POSITIVE_INFINITY,w=e.get(s.id)??Number.POSITIVE_INFINITY;return n-w}).slice(0,3)},[i,a]);p.useEffect(()=>{d?.uid&&k(d.uid).then(h).catch(console.error)},[d?.uid]);const c=u.slice(0,3).map(e=>{const t=x?.subjects?.[e.subject]?.modulesProgress?.[e.id],s=e.lessons.length,n=t?.progress??(s>0?Math.round((t?.lessonsCompleted?.length||0)/s*100):0);return{...e,progress:n,status:n===100?"Completed":n>0?"In Progress":"Not Started"}}),f=c.some(e=>e.progress>0)?"Continue Learning":"Start Learning";return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-4 md:mb-6 px-1",children:[r.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[r.jsx("div",{className:"w-8 h-8 md:w-10 md:h-10 shrink-0 rounded-xl md:rounded-[14px] bg-indigo-50 border border-indigo-100 flex items-center justify-center text-indigo-500 shadow-inner",children:r.jsx(P,{className:"w-4 h-4 md:w-5 md:h-5",strokeWidth:2.5})}),r.jsx("h2",{className:"font-display font-black text-lg md:text-[24px] text-slate-800 tracking-tight whitespace-nowrap",children:f})]}),r.jsxs("button",{onClick:()=>m?.(),className:"text-primary font-bold text-xs md:text-sm flex shrink-0 items-center gap-1 hover:gap-2 transition-all bg-primary/10 px-3 py-1.5 md:px-4 md:py-2 rounded-lg md:rounded-xl hover:bg-primary/20 whitespace-nowrap",children:["View All ",r.jsx(I,{className:"w-3.5 h-3.5 md:w-4 md:h-4"})]})]}),r.jsx("div",{className:"flex overflow-x-auto snap-x snap-mandatory scrollbar-hide -mx-4 px-4 pb-4 gap-4 md:grid md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 md:gap-6 md:pb-0 md:mx-0 md:px-0 md:overflow-visible",children:c.map((e,t)=>r.jsx("div",{className:"w-[72vw] max-w-[260px] h-[220px] shrink-0 snap-center md:min-w-0 md:max-w-none md:w-auto md:shrink md:h-auto",children:r.jsx(v,{module:e,index:t,onClick:()=>m?.(e.id),isAtRisk:a.length>0,badgeLabel:e.status!=="Not Started"?e.status:void 0})},e.id))})]})};export{Y as default};
|
assets/{LoginPage-DpTH-gW8.js β LoginPage-LAyBJ2QS.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as s,j as e}from"./vendor-react-B4AQeu28.js";import{B as je}from"./button-DsnZWCoA.js";import{I as L}from"./input-BPglbGHJ.js";import{m as i,B as we,T as Ne,A as ke,U as Q,L as X,a as K,G as Se,b as Pe,s as ee,c as Ae,d as te}from"./index-BufUS6SI.js";import{S as Me}from"./sparkles-DYlMf97S.js";import{M as Re}from"./mail-d6dXXOFo.js";import{E as Ce,a as Ee}from"./eye-CDIJHn8i.js";import{S as Te}from"./shield-check-DMfBBdB0.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const se="/assets/shader-bg-DA7bEbBA.mp4",Le=[{id:"length",label:"At least 8 characters",test:a=>a.length>=8},{id:"upper-lower",label:"Contains uppercase and lowercase letters",test:a=>/[A-Z]/.test(a)&&/[a-z]/.test(a)},{id:"number",label:"Contains at least one number",test:a=>/\d/.test(a)},{id:"special",label:"Contains at least one special character",test:a=>/[^A-Za-z0-9]/.test(a)}],I="Use at least 8 characters with uppercase, lowercase, number, and special character.",Ie=a=>{const c=typeof a=="object"&&a!==null?a:null,o=a instanceof Error?a.message:"";if(c?.code&&typeof c.code=="string")return{code:c.code.toLowerCase(),message:o};const n=o.match(/auth\/[a-z-]+/i);return{code:n?n[0].toLowerCase():"",message:o}},ze=a=>a.replace(/^Firebase:\s*/i,"").replace(/\s*\(auth\/[a-z-]+\)\.?/i,"").trim(),ae=(a,c)=>{const{code:o,message:n}=Ie(a),h=ze(n);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. ${I}`: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:n.includes("Firebase:")||n.includes("auth/")?c:n||c},et=()=>{const a={"Grade 11":["Academic","Tech-Pro"]},[c,o]=s.useState(""),[n,h]=s.useState(""),[S,re]=s.useState(!1),[l,z]=s.useState(!1),[P,ie]=s.useState(""),[y,D]=s.useState("student"),[b,De]=s.useState("Grade 11"),[v,B]=s.useState(a["Grade 11"][0]),[_,x]=s.useState(!1),[f,u]=s.useState(null),[oe,le]=s.useState(!1),[ne,ce]=s.useState(!1),[A,de]=s.useState(16),[q,V]=s.useState("primary"),[O,M]=s.useState(0),R=s.useRef(null),C=s.useRef(null),j=oe&&ne,g=s.useRef("primary"),w=s.useRef(0),N=s.useRef(!1),F=1.1,G=.34,U=t=>{const r=Math.max(0,Math.min(1,t));Math.abs(w.current-r)<.02||(w.current=r,M(r))},$=t=>{!Number.isFinite(t)||t<=0||Math.abs(A-t)>.05&&de(t)},E=s.useMemo(()=>Le.map(t=>({...t,met:t.test(n)})),[n]),W=s.useMemo(()=>E.every(t=>t.met),[E]),me=s.useMemo(()=>{if(!l||!f)return!1;const t=f.toLowerCase();return t.includes("password requirements not met")||t.includes("password does not meet")},[f,l]),ue=()=>{const t=R.current?.duration;t&&Number.isFinite(t)&&t>0&&$(t)},pe=()=>{const t=C.current?.duration;t&&Number.isFinite(t)&&t>0&&$(t)};s.useEffect(()=>{if(!j)return;const t=R.current,r=C.current;if(!t||!r)return;let d=!1,m=0;g.current="primary",V("primary"),N.current=!1,w.current=0,M(0),t.loop=!1,r.loop=!1,t.currentTime=0,r.currentTime=0,r.pause(),t.play().catch(()=>{});const k=()=>{if(d)return;const p=g.current==="primary"?t:r,Z=g.current==="primary"?r:t,ge=Number.isFinite(p.duration)&&p.duration>0?p.duration:A,T=Math.max(ge-p.currentTime,0);if(T<=F){N.current||(N.current=!0,Z.currentTime=0,Z.play().catch(()=>{}));const ve=1-T/F;if(U(ve),T<=.03||p.ended){p.pause(),p.currentTime=0;const J=g.current==="primary"?"secondary":"primary";g.current=J,V(J),N.current=!1,w.current=0,M(0)}}else U(0);m=window.requestAnimationFrame(k)};return m=window.requestAnimationFrame(k),()=>{d=!0,m&&window.cancelAnimationFrame(m)}},[A,j]);const Y=j?G*(1-O):0,H=j?G*O:0,xe=q==="primary"?Y:H,ye=q==="secondary"?Y:H;s.useEffect(()=>{const t=a[b]||[];t.length>0&&!t.includes(v)&&B(t[0])},[b,v]);const he=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:Se,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:Pe,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:Te,color:"rose"}],be=async(t,r,d)=>{u(null),x(!0),o(t),h(r),D(d),z(!1);try{ee(d),await te(t,r)}catch(m){u(ae(m,"Demo sign-in failed. Please try again.")),x(!1)}},fe=async t=>{t.preventDefault(),u(null),x(!0);try{if(l){if(!P.trim()){u("Please enter your name"),x(!1);return}if(y==="student"&&!b){u("Please select a grade level"),x(!1);return}if(y==="admin"){u("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!W){u(`Password does not meet signup requirements. ${I}`),x(!1);return}ee(y),await Ae(c,n,P,y,y==="student"?{grade:b,section:v}:{department:"Mathematics"})}else await te(c,n)}catch(r){const d=l?`Sign-up failed. ${I}`:"Sign-in failed. Please check your credentials and try again.";u(ae(r,d)),x(!1)}};return e.jsxs("div",{className:"min-h-screen w-full flex items-center justify-center px-4 sm:px-6 py-8 overflow-y-auto relative login-bg",children:[e.jsx("video",{ref:R,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>le(!0),onLoadedMetadata:ue,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":xe},src:se}),e.jsx("video",{ref:C,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>ce(!0),onLoadedMetadata:pe,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":ye},src:se}),e.jsx("div",{className:"absolute inset-0 pointer-events-none login-frost-overlay"}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply login-orb-purple"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply login-orb-pink"}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen login-orb-blue"}),e.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[e.jsxs(i.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col items-center lg:items-start justify-center space-y-5 lg:space-y-8 text-center lg:text-left",children:[e.jsxs(i.div,{className:"flex items-center justify-center lg:justify-start gap-2.5",children:[e.jsx(i.div,{className:"relative flex items-center justify-center drop-shadow-md",children:e.jsx("img",{src:"/mathpulse_final_logo.png",alt:"MathPulse AI Logo",className:"w-10 h-10 lg:w-16 lg:h-16 object-contain flex-shrink-0"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl lg: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(Me,{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(i.div,{className:"space-y-3 lg:space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[e.jsxs("h2",{className:"text-3xl sm: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-sm lg:text-base text-slate-500 leading-relaxed max-w-md mx-auto lg:mx-0 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-2 lg:gap-3",children:[{icon:we,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Ne,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:ke,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,r)=>{const d=t.icon,m={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"},k={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},p={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(i.div,{className:`bg-white/80 backdrop-blur-xl border ${m[t.color]} rounded-xl p-3 lg: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+r*.1},whileHover:{scale:1.03,y:-4},children:[e.jsx("div",{className:`w-7 h-7 lg:w-9 lg:h-9 rounded-lg ${p[t.color]} flex items-center justify-center mx-auto lg:mx-0 mb-2 lg:mb-3`,children:e.jsx(d,{size:15,className:k[t.color]})}),e.jsx("h3",{className:"text-xs lg:text-sm font-display font-semibold text-slate-800 mb-0.5",children:t.label}),e.jsx("p",{className:"text-[10px] lg:text-xs text-slate-400 font-body",children:t.desc})]},r)})})]}),e.jsx(i.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-6 sm:p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)] max-h-[85vh] overflow-y-auto",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-4 relative",children:[e.jsx(i.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(i.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:fe,className:"space-y-3 mb-4 relative",children:[f&&!me&&e.jsx(i.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:f}),l&&e.jsxs(i.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(Q,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"text",placeholder:"Your Name",value:P,onChange:t=>ie(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(i.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 r=y===t.role;return e.jsx("button",{type:"button",onClick:()=>D(t.role),className:`rounded-lg border px-3 py-2.5 text-sm font-body font-semibold transition-all ${r?"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&&y==="student"&&e.jsx(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-3",children:e.jsxs("div",{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(Q,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:v,onChange:t=>B(t.target.value),className:"w-full pl-11 pr-4 py-2.5 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:(a[b]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]})}),e.jsxs(i.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(Re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"email",placeholder:"your.email@school.edu",value:c,onChange:t=>o(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(i.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(X,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:S?"text":"password",placeholder:"β’β’β’β’β’β’β’β’",value:n,onChange:t=>h(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(i.button,{type:"button",onClick:()=>re(!S),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:S?e.jsx(Ce,{size:16}):e.jsx(Ee,{size:16})})]}),l&&n.length>0&&!W&&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:E.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))})]})]}),e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(je,{type:"submit",disabled:_,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(i.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:[_?"Please wait...":l?"Create Account":"Sign In",e.jsx(K,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{z(!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(i.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:he.map(t=>{const r=t.icon,d={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},m={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return e.jsxs(i.button,{type:"button",onClick:()=>be(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 ${d[t.color]}`,children:e.jsx(r,{size:15,className:m[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(K,{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(i.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(X,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{et as default};
|
|
|
|
| 1 |
+
import{r as s,j as e}from"./vendor-react-B4AQeu28.js";import{B as je}from"./button-BMVm9YQO.js";import{I as L}from"./input-Co0dljwe.js";import{m as i,B as we,T as Ne,A as ke,U as Q,L as X,a as K,G as Se,b as Pe,s as ee,c as Ae,d as te}from"./index-Bp7MiGcW.js";import{S as Me}from"./sparkles-fLB3ltj1.js";import{M as Re}from"./mail-jAg7cqFw.js";import{E as Ce,a as Ee}from"./eye-B_U0s6fm.js";import{S as Te}from"./shield-check-qhTHRSP5.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-markdown-yqZQ_iQm.js";const se="/assets/shader-bg-DA7bEbBA.mp4",Le=[{id:"length",label:"At least 8 characters",test:a=>a.length>=8},{id:"upper-lower",label:"Contains uppercase and lowercase letters",test:a=>/[A-Z]/.test(a)&&/[a-z]/.test(a)},{id:"number",label:"Contains at least one number",test:a=>/\d/.test(a)},{id:"special",label:"Contains at least one special character",test:a=>/[^A-Za-z0-9]/.test(a)}],I="Use at least 8 characters with uppercase, lowercase, number, and special character.",Ie=a=>{const c=typeof a=="object"&&a!==null?a:null,o=a instanceof Error?a.message:"";if(c?.code&&typeof c.code=="string")return{code:c.code.toLowerCase(),message:o};const n=o.match(/auth\/[a-z-]+/i);return{code:n?n[0].toLowerCase():"",message:o}},ze=a=>a.replace(/^Firebase:\s*/i,"").replace(/\s*\(auth\/[a-z-]+\)\.?/i,"").trim(),ae=(a,c)=>{const{code:o,message:n}=Ie(a),h=ze(n);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. ${I}`: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:n.includes("Firebase:")||n.includes("auth/")?c:n||c},et=()=>{const a={"Grade 11":["Academic","Tech-Pro"]},[c,o]=s.useState(""),[n,h]=s.useState(""),[S,re]=s.useState(!1),[l,z]=s.useState(!1),[P,ie]=s.useState(""),[y,D]=s.useState("student"),[b,De]=s.useState("Grade 11"),[v,B]=s.useState(a["Grade 11"][0]),[_,x]=s.useState(!1),[f,u]=s.useState(null),[oe,le]=s.useState(!1),[ne,ce]=s.useState(!1),[A,de]=s.useState(16),[q,V]=s.useState("primary"),[O,M]=s.useState(0),R=s.useRef(null),C=s.useRef(null),j=oe&&ne,g=s.useRef("primary"),w=s.useRef(0),N=s.useRef(!1),F=1.1,G=.34,U=t=>{const r=Math.max(0,Math.min(1,t));Math.abs(w.current-r)<.02||(w.current=r,M(r))},$=t=>{!Number.isFinite(t)||t<=0||Math.abs(A-t)>.05&&de(t)},E=s.useMemo(()=>Le.map(t=>({...t,met:t.test(n)})),[n]),W=s.useMemo(()=>E.every(t=>t.met),[E]),me=s.useMemo(()=>{if(!l||!f)return!1;const t=f.toLowerCase();return t.includes("password requirements not met")||t.includes("password does not meet")},[f,l]),ue=()=>{const t=R.current?.duration;t&&Number.isFinite(t)&&t>0&&$(t)},pe=()=>{const t=C.current?.duration;t&&Number.isFinite(t)&&t>0&&$(t)};s.useEffect(()=>{if(!j)return;const t=R.current,r=C.current;if(!t||!r)return;let d=!1,m=0;g.current="primary",V("primary"),N.current=!1,w.current=0,M(0),t.loop=!1,r.loop=!1,t.currentTime=0,r.currentTime=0,r.pause(),t.play().catch(()=>{});const k=()=>{if(d)return;const p=g.current==="primary"?t:r,Z=g.current==="primary"?r:t,ge=Number.isFinite(p.duration)&&p.duration>0?p.duration:A,T=Math.max(ge-p.currentTime,0);if(T<=F){N.current||(N.current=!0,Z.currentTime=0,Z.play().catch(()=>{}));const ve=1-T/F;if(U(ve),T<=.03||p.ended){p.pause(),p.currentTime=0;const J=g.current==="primary"?"secondary":"primary";g.current=J,V(J),N.current=!1,w.current=0,M(0)}}else U(0);m=window.requestAnimationFrame(k)};return m=window.requestAnimationFrame(k),()=>{d=!0,m&&window.cancelAnimationFrame(m)}},[A,j]);const Y=j?G*(1-O):0,H=j?G*O:0,xe=q==="primary"?Y:H,ye=q==="secondary"?Y:H;s.useEffect(()=>{const t=a[b]||[];t.length>0&&!t.includes(v)&&B(t[0])},[b,v]);const he=[{label:"Student",role:"student",email:"teststudent@school.edu",password:"TestPass123!",icon:Se,color:"sky"},{label:"Teacher",role:"teacher",email:"testteacher@school.edu",password:"TestPass123!",icon:Pe,color:"emerald"},{label:"Admin",role:"admin",email:"testadmin@school.edu",password:"TestPass123!",icon:Te,color:"rose"}],be=async(t,r,d)=>{u(null),x(!0),o(t),h(r),D(d),z(!1);try{ee(d),await te(t,r)}catch(m){u(ae(m,"Demo sign-in failed. Please try again.")),x(!1)}},fe=async t=>{t.preventDefault(),u(null),x(!0);try{if(l){if(!P.trim()){u("Please enter your name"),x(!1);return}if(y==="student"&&!b){u("Please select a grade level"),x(!1);return}if(y==="admin"){u("Admin account creation is restricted. Please contact an existing administrator."),x(!1);return}if(!W){u(`Password does not meet signup requirements. ${I}`),x(!1);return}ee(y),await Ae(c,n,P,y,y==="student"?{grade:b,section:v}:{department:"Mathematics"})}else await te(c,n)}catch(r){const d=l?`Sign-up failed. ${I}`:"Sign-in failed. Please check your credentials and try again.";u(ae(r,d)),x(!1)}};return e.jsxs("div",{className:"min-h-screen w-full flex items-center justify-center px-4 sm:px-6 py-8 overflow-y-auto relative login-bg",children:[e.jsx("video",{ref:R,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>le(!0),onLoadedMetadata:ue,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":xe},src:se}),e.jsx("video",{ref:C,autoPlay:!0,muted:!0,playsInline:!0,preload:"auto",onCanPlay:()=>ce(!0),onLoadedMetadata:pe,className:"absolute inset-0 w-full h-full object-cover transition-opacity duration-150 e-opacity",style:{"--o":ye},src:se}),e.jsx("div",{className:"absolute inset-0 pointer-events-none login-frost-overlay"}),e.jsx("div",{className:"absolute top-[10%] left-[-10%] w-[60%] h-[60%] rounded-full blur-[140px] pointer-events-none mix-blend-multiply login-orb-purple"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[70%] h-[70%] rounded-full blur-[160px] pointer-events-none mix-blend-multiply login-orb-pink"}),e.jsx("div",{className:"absolute top-[40%] left-[40%] w-[40%] h-[40%] rounded-full blur-[120px] pointer-events-none mix-blend-screen login-orb-blue"}),e.jsx("div",{className:"relative z-10 w-full max-w-6xl mx-auto",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 lg:gap-12 items-center",children:[e.jsxs(i.div,{initial:{opacity:0,x:-40},animate:{opacity:1,x:0},transition:{duration:.8,ease:[.22,1,.36,1]},className:"flex flex-col items-center lg:items-start justify-center space-y-5 lg:space-y-8 text-center lg:text-left",children:[e.jsxs(i.div,{className:"flex items-center justify-center lg:justify-start gap-2.5",children:[e.jsx(i.div,{className:"relative flex items-center justify-center drop-shadow-md",children:e.jsx("img",{src:"/mathpulse_final_logo.png",alt:"MathPulse AI Logo",className:"w-10 h-10 lg:w-16 lg:h-16 object-contain flex-shrink-0"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl lg: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(Me,{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(i.div,{className:"space-y-3 lg:space-y-5",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.8},children:[e.jsxs("h2",{className:"text-3xl sm: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-sm lg:text-base text-slate-500 leading-relaxed max-w-md mx-auto lg:mx-0 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-2 lg:gap-3",children:[{icon:we,label:"AI Predictions",desc:"Smart detection",color:"sky"},{icon:Ne,label:"Analytics",desc:"Real-time data",color:"rose"},{icon:ke,label:"Gamified",desc:"Learn & earn",color:"emerald"}].map((t,r)=>{const d=t.icon,m={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"},k={sky:"text-sky-600",rose:"text-rose-500",emerald:"text-emerald-600"},p={sky:"bg-sky-100",rose:"bg-rose-100",emerald:"bg-emerald-100"};return e.jsxs(i.div,{className:`bg-white/80 backdrop-blur-xl border ${m[t.color]} rounded-xl p-3 lg: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+r*.1},whileHover:{scale:1.03,y:-4},children:[e.jsx("div",{className:`w-7 h-7 lg:w-9 lg:h-9 rounded-lg ${p[t.color]} flex items-center justify-center mx-auto lg:mx-0 mb-2 lg:mb-3`,children:e.jsx(d,{size:15,className:k[t.color]})}),e.jsx("h3",{className:"text-xs lg:text-sm font-display font-semibold text-slate-800 mb-0.5",children:t.label}),e.jsx("p",{className:"text-[10px] lg:text-xs text-slate-400 font-body",children:t.desc})]},r)})})]}),e.jsx(i.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-6 sm:p-7 w-full max-w-md relative overflow-hidden shadow-[0_20px_60px_-15px_rgba(168,85,247,0.15)] max-h-[85vh] overflow-y-auto",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-4 relative",children:[e.jsx(i.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(i.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:fe,className:"space-y-3 mb-4 relative",children:[f&&!me&&e.jsx(i.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:f}),l&&e.jsxs(i.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(Q,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"text",placeholder:"Your Name",value:P,onChange:t=>ie(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(i.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 r=y===t.role;return e.jsx("button",{type:"button",onClick:()=>D(t.role),className:`rounded-lg border px-3 py-2.5 text-sm font-body font-semibold transition-all ${r?"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&&y==="student"&&e.jsx(i.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-3",children:e.jsxs("div",{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(Q,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("select",{value:v,onChange:t=>B(t.target.value),className:"w-full pl-11 pr-4 py-2.5 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:(a[b]||[]).map(t=>e.jsx("option",{value:t,children:t},t))})]})]})}),e.jsxs(i.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(Re,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:"email",placeholder:"your.email@school.edu",value:c,onChange:t=>o(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(i.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(X,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx(L,{type:S?"text":"password",placeholder:"β’β’β’β’β’β’β’β’",value:n,onChange:t=>h(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(i.button,{type:"button",onClick:()=>re(!S),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition-colors",whileTap:{scale:.9},children:S?e.jsx(Ce,{size:16}):e.jsx(Ee,{size:16})})]}),l&&n.length>0&&!W&&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:E.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))})]})]}),e.jsx(i.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.7},children:e.jsxs(je,{type:"submit",disabled:_,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(i.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:[_?"Please wait...":l?"Create Account":"Sign In",e.jsx(K,{size:16,className:"group-hover:translate-x-1 transition-transform"})]})]})}),e.jsx("div",{className:"text-center",children:e.jsx("button",{type:"button",onClick:()=>{z(!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(i.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:he.map(t=>{const r=t.icon,d={sky:"bg-sky-100",emerald:"bg-emerald-100",rose:"bg-rose-100"},m={sky:"text-sky-600",emerald:"text-emerald-600",rose:"text-rose-500"};return e.jsxs(i.button,{type:"button",onClick:()=>be(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 ${d[t.color]}`,children:e.jsx(r,{size:15,className:m[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(K,{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(i.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(X,{size:10,className:"inline mr-1 -mt-0.5"})," Your data is encrypted and secure"]})]})})]})})]})};export{et as default};
|
assets/{LogoutActionButton-ke8I5kxg.js β LogoutActionButton-BlHbD8Uf.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e,m as r,o as l}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e,m as r,o as l}from"./index-Bp7MiGcW.js";import{j as t}from"./vendor-react-B4AQeu28.js";import{L as n}from"./log-out-DrAbcVI9.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ModuleFolderCard-CqhxwGI0.js β ModuleFolderCard-BaBw0Pd9.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{j as e,r as h}from"./vendor-react-B4AQeu28.js";import{u as j}from"./useSubjectAvailability-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{j as e,r as h}from"./vendor-react-B4AQeu28.js";import{u as j}from"./useSubjectAvailability-Dm-85m8R.js";import{a as y}from"./deepseekRagService-Bke9fSTt.js";import{e as u,m as N,b as k,y as _,G as B}from"./index-Bp7MiGcW.js";import{C as z}from"./clock-Cc6sJz1J.js";import{B as A}from"./bell-DyLbgepV.js";import{I as M}from"./info-Bcg_cBHY.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/ModulesPage-CT0lsQBD.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/ModulesPage-CTVBRDaK.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{NotificationDropdown-BwLtHvqY.js β NotificationDropdown-DNm6nFOm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as n,E as b,u as N,h as w,m as j,a as g,U as k}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as n,E as b,u as N,h as w,m as j,a as g,U as k}from"./index-Bp7MiGcW.js";import{r as _,j as e}from"./vendor-react-B4AQeu28.js";import"./vendor-firebase-firestore-CNv3xXal.js";import{C as y,f as v}from"./formatDistanceToNow-D-5-www2.js";import{B as o}from"./bell-DyLbgepV.js";import{C}from"./circle-check-DzQphSnP.js";import{C as A}from"./circle-alert-CHGy8HcB.js";import{S as z}from"./sparkles-fLB3ltj1.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ProfileModal-CsRM_gfJ.js β ProfileModal-c1MJMwBW.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r,j as e}from"./vendor-react-B4AQeu28.js";import{e as R,h as U,m as k,U as u,A as x,b as w,H as _,a1 as D,aL as T,aV as B,j as V}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r,j as e}from"./vendor-react-B4AQeu28.js";import{e as R,h as U,m as k,U as u,A as x,b as w,H as _,a1 as D,aL as T,aV as B,j as V}from"./index-Bp7MiGcW.js";import{B as b}from"./button-BMVm9YQO.js";import{I as d}from"./input-Co0dljwe.js";import{S as $,a as q,c as G,d as p}from"./select-CNQuOudF.js";import{P as X,M as z,V as C}from"./ProfilePictureUploader-Cdp-MoCI.js";import{X as Y}from"./x-k8d6VLEw.js";import{M as H}from"./mail-jAg7cqFw.js";import{C as L}from"./circle-help-CLCoBWDy.js";import{S as K}from"./save-D7oNX_Ki.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chevron-up-DtS9MvUZ.js";import"./check-qsSFTYCr.js";import"./minus-BK7K7Pi2.js";import"./plus-D4SEqrVj.js";import"./upload-CP6O7WIX.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{ProfilePictureUploader-B-ipxzWy.js β ProfilePictureUploader-Cdp-MoCI.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/index-
|
| 2 |
-
import{e as V,o as B,k as K,J as ge,_ as $,b4 as we,u as xe,W as ye,X as be,Y as Ce,h as Pe,m as J,j as Q}from"./index-
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
|
@@ -107,4 +107,4 @@ import{e as V,o as B,k as K,J as ge,_ as $,b4 as we,u as xe,W as ye,X as be,Y as
|
|
| 107 |
border-left: 0;
|
| 108 |
border-right: 0;
|
| 109 |
}
|
| 110 |
-
`,nt=1,at=3,st=1,ct=(function(a){Ee(o,a);function o(){var e=a!==null&&a.apply(this,arguments)||this;return e.cropperRef=x.createRef(),e.imageRef=x.createRef(),e.videoRef=x.createRef(),e.containerPosition={x:0,y:0},e.containerRef=null,e.styleRef=null,e.containerRect=null,e.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},e.dragStartPosition={x:0,y:0},e.dragStartCrop={x:0,y:0},e.gestureZoomStart=0,e.gestureRotationStart=0,e.isTouching=!1,e.lastPinchDistance=0,e.lastPinchRotation=0,e.rafDragTimeout=null,e.rafPinchTimeout=null,e.wheelTimer=null,e.currentDoc=typeof document<"u"?document:null,e.currentWindow=typeof window<"u"?window:null,e.resizeObserver=null,e.previousCropSize=null,e.isInitialized=!1,e.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},e.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!e.containerRef)){var t=!0;e.resizeObserver=new window.ResizeObserver(function(r){if(t){t=!1;return}e.computeSizes()}),e.resizeObserver.observe(e.containerRef)}},e.preventZoomSafari=function(t){return t.preventDefault()},e.cleanEvents=function(){e.currentDoc&&(e.currentDoc.removeEventListener("mousemove",e.onMouseMove),e.currentDoc.removeEventListener("mouseup",e.onDragStopped),e.currentDoc.removeEventListener("touchmove",e.onTouchMove),e.currentDoc.removeEventListener("touchend",e.onDragStopped),e.currentDoc.removeEventListener("gesturechange",e.onGestureChange),e.currentDoc.removeEventListener("gestureend",e.onGestureEnd),e.currentDoc.removeEventListener("scroll",e.onScroll))},e.clearScrollEvent=function(){e.containerRef&&e.containerRef.removeEventListener("wheel",e.onWheel),e.wheelTimer&&clearTimeout(e.wheelTimer)},e.onMediaLoad=function(){var t=e.computeSizes();t&&(e.previousCropSize=t,e.emitCropData(),e.setInitialCrop(t),e.isInitialized=!0),e.props.onMediaLoaded&&e.props.onMediaLoaded(e.mediaSize)},e.setInitialCrop=function(t){if(e.props.initialCroppedAreaPercentages){var r=et(e.props.initialCroppedAreaPercentages,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=r.crop,n=r.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}else if(e.props.initialCroppedAreaPixels){var s=rt(e.props.initialCroppedAreaPixels,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=s.crop,n=s.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}},e.computeSizes=function(){var t,r,i,n,s,c,l=e.imageRef.current||e.videoRef.current;if(l&&e.containerRef){e.containerRect=e.containerRef.getBoundingClientRect(),e.saveContainerPosition();var u=e.containerRect.width/e.containerRect.height,h=((t=e.imageRef.current)===null||t===void 0?void 0:t.naturalWidth)||((r=e.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,d=((i=e.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((n=e.videoRef.current)===null||n===void 0?void 0:n.videoHeight)||0,m=l.offsetWidth<h||l.offsetHeight<d,w=h/d,v=void 0;if(m)switch(e.state.mediaObjectFit){default:case"contain":v=u>w?{width:e.containerRect.height*w,height:e.containerRect.height}:{width:e.containerRect.width,height:e.containerRect.width/w};break;case"horizontal-cover":v={width:e.containerRect.width,height:e.containerRect.width/w};break;case"vertical-cover":v={width:e.containerRect.height*w,height:e.containerRect.height};break}else v={width:l.offsetWidth,height:l.offsetHeight};e.mediaSize=b(b({},v),{naturalWidth:h,naturalHeight:d}),e.props.setMediaSize&&e.props.setMediaSize(e.mediaSize);var f=e.props.cropSize?e.props.cropSize:Xe(e.mediaSize.width,e.mediaSize.height,e.containerRect.width,e.containerRect.height,e.props.aspect,e.props.rotation);return(((s=e.state.cropSize)===null||s===void 0?void 0:s.height)!==f.height||((c=e.state.cropSize)===null||c===void 0?void 0:c.width)!==f.width)&&e.props.onCropSizeChange&&e.props.onCropSizeChange(f),e.setState({cropSize:f},e.recomputeCropPosition),e.props.setCropSize&&e.props.setCropSize(f),f}},e.saveContainerPosition=function(){if(e.containerRef){var t=e.containerRef.getBoundingClientRect();e.containerPosition={x:t.left,y:t.top}}},e.onMouseDown=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("mousemove",e.onMouseMove),e.currentDoc.addEventListener("mouseup",e.onDragStopped),e.saveContainerPosition(),e.onDragStart(o.getMousePoint(t)))},e.onMouseMove=function(t){return e.onDrag(o.getMousePoint(t))},e.onScroll=function(t){e.currentDoc&&(t.preventDefault(),e.saveContainerPosition())},e.onTouchStart=function(t){e.currentDoc&&(e.isTouching=!0,!(e.props.onTouchRequest&&!e.props.onTouchRequest(t))&&(e.currentDoc.addEventListener("touchmove",e.onTouchMove,{passive:!1}),e.currentDoc.addEventListener("touchend",e.onDragStopped),e.saveContainerPosition(),t.touches.length===2?e.onPinchStart(t):t.touches.length===1&&e.onDragStart(o.getTouchPoint(t.touches[0]))))},e.onTouchMove=function(t){t.preventDefault(),t.touches.length===2?e.onPinchMove(t):t.touches.length===1&&e.onDrag(o.getTouchPoint(t.touches[0]))},e.onGestureStart=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("gesturechange",e.onGestureChange),e.currentDoc.addEventListener("gestureend",e.onGestureEnd),e.gestureZoomStart=e.props.zoom,e.gestureRotationStart=e.props.rotation)},e.onGestureChange=function(t){if(t.preventDefault(),!e.isTouching){var r=o.getMousePoint(t),i=e.gestureZoomStart-1+t.scale;if(e.setNewZoom(i,r,{shouldUpdatePosition:!0}),e.props.onRotationChange){var n=e.gestureRotationStart+t.rotation;e.props.onRotationChange(n)}}},e.onGestureEnd=function(t){e.cleanEvents()},e.onDragStart=function(t){var r,i,n=t.x,s=t.y;e.dragStartPosition={x:n,y:s},e.dragStartCrop=b({},e.props.crop),(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r)},e.onDrag=function(t){var r=t.x,i=t.y;e.currentWindow&&(e.rafDragTimeout&&e.currentWindow.cancelAnimationFrame(e.rafDragTimeout),e.rafDragTimeout=e.currentWindow.requestAnimationFrame(function(){if(e.state.cropSize&&!(r===void 0||i===void 0)){var n=r-e.dragStartPosition.x,s=i-e.dragStartPosition.y,c={x:e.dragStartCrop.x+n,y:e.dragStartCrop.y+s},l=e.props.restrictPosition?N(c,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):c;e.props.onCropChange(l)}}))},e.onDragStopped=function(){var t,r;e.isTouching=!1,e.cleanEvents(),e.emitCropData(),(r=(t=e.props).onInteractionEnd)===null||r===void 0||r.call(t)},e.onWheel=function(t){if(e.currentWindow&&!(e.props.onWheelRequest&&!e.props.onWheelRequest(t))){t.preventDefault();var r=o.getMousePoint(t),i=Ye(t).pixelY,n=e.props.zoom-i*e.props.zoomSpeed/200;e.setNewZoom(n,r,{shouldUpdatePosition:!0}),e.state.hasWheelJustStarted||e.setState({hasWheelJustStarted:!0},function(){var s,c;return(c=(s=e.props).onInteractionStart)===null||c===void 0?void 0:c.call(s)}),e.wheelTimer&&clearTimeout(e.wheelTimer),e.wheelTimer=e.currentWindow.setTimeout(function(){return e.setState({hasWheelJustStarted:!1},function(){var s,c;return(c=(s=e.props).onInteractionEnd)===null||c===void 0?void 0:c.call(s)})},250)}},e.getPointOnContainer=function(t,r){var i=t.x,n=t.y;if(!e.containerRect)throw new Error("The Cropper is not mounted");return{x:e.containerRect.width/2-(i-r.x),y:e.containerRect.height/2-(n-r.y)}},e.getPointOnMedia=function(t){var r=t.x,i=t.y,n=e.props,s=n.crop,c=n.zoom;return{x:(r+s.x)/c,y:(i+s.y)/c}},e.setNewZoom=function(t,r,i){var n=i===void 0?{}:i,s=n.shouldUpdatePosition,c=s===void 0?!0:s;if(!(!e.state.cropSize||!e.props.onZoomChange)){var l=O(t,e.props.minZoom,e.props.maxZoom);if(c){var u=e.getPointOnContainer(r,e.containerPosition),h=e.getPointOnMedia(u),d={x:h.x*l-u.x,y:h.y*l-u.y},m=e.props.restrictPosition?N(d,e.mediaSize,e.state.cropSize,l,e.props.rotation):d;e.props.onCropChange(m)}e.props.onZoomChange(l)}},e.getCropData=function(){if(!e.state.cropSize)return null;var t=e.props.restrictPosition?N(e.props.crop,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):e.props.crop;return Ke(t,e.mediaSize,e.state.cropSize,e.getAspect(),e.props.zoom,e.props.rotation,e.props.restrictPosition)},e.emitCropData=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropComplete&&e.props.onCropComplete(r,i),e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.emitCropAreaChange=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.recomputeCropPosition=function(){var t,r;if(e.state.cropSize){var i=e.props.crop;if(e.isInitialized&&(!((t=e.previousCropSize)===null||t===void 0)&&t.width)&&(!((r=e.previousCropSize)===null||r===void 0)&&r.height)){var n=Math.abs(e.previousCropSize.width-e.state.cropSize.width)>1e-6||Math.abs(e.previousCropSize.height-e.state.cropSize.height)>1e-6;if(n){var s=e.state.cropSize.width/e.previousCropSize.width,c=e.state.cropSize.height/e.previousCropSize.height;i={x:e.props.crop.x*s,y:e.props.crop.y*c}}}var l=e.props.restrictPosition?N(i,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):i;e.previousCropSize=e.state.cropSize,e.props.onCropChange(l),e.emitCropData()}},e.onKeyDown=function(t){var r,i,n=e.props,s=n.crop,c=n.onCropChange,l=n.keyboardStep,u=n.zoom,h=n.rotation,d=l;if(e.state.cropSize){t.shiftKey&&(d*=.2);var m=b({},s);switch(t.key){case"ArrowUp":m.y-=d,t.preventDefault();break;case"ArrowDown":m.y+=d,t.preventDefault();break;case"ArrowLeft":m.x-=d,t.preventDefault();break;case"ArrowRight":m.x+=d,t.preventDefault();break;default:return}e.props.restrictPosition&&(m=N(m,e.mediaSize,e.state.cropSize,u,h)),t.repeat||(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r),c(m)}},e.onKeyUp=function(t){var r,i;switch(t.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":t.preventDefault();break;default:return}e.emitCropData(),(i=(r=e.props).onInteractionEnd)===null||i===void 0||i.call(r)},e}return o.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=it,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},o.prototype.componentWillUnmount=function(){var e,t;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((t=this.styleRef.parentNode)===null||t===void 0||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},o.prototype.componentDidUpdate=function(e){var t,r,i,n,s,c,l,u,h;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():((t=e.cropSize)===null||t===void 0?void 0:t.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((i=e.cropSize)===null||i===void 0?void 0:i.width)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.width)?this.computeSizes():(((s=e.crop)===null||s===void 0?void 0:s.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((l=e.crop)===null||l===void 0?void 0:l.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&((h=this.videoRef.current)===null||h===void 0||h.load());var d=this.getObjectFit();d!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:d},this.computeSizes)},o.prototype.getAspect=function(){var e=this.props,t=e.cropSize,r=e.aspect;return t?t.width/t.height:r},o.prototype.getObjectFit=function(){var e,t,r,i;if(this.props.objectFit==="cover"){var n=this.imageRef.current||this.videoRef.current;if(n&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,c=((e=this.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((t=this.videoRef.current)===null||t===void 0?void 0:t.videoWidth)||0,l=((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,u=c/l;return u<s?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},o.prototype.onPinchStart=function(e){var t=o.getTouchPoint(e.touches[0]),r=o.getTouchPoint(e.touches[1]);this.lastPinchDistance=se(t,r),this.lastPinchRotation=ce(t,r),this.onDragStart(le(t,r))},o.prototype.onPinchMove=function(e){var t=this;if(!(!this.currentDoc||!this.currentWindow)){var r=o.getTouchPoint(e.touches[0]),i=o.getTouchPoint(e.touches[1]),n=le(r,i);this.onDrag(n),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=se(r,i),c=t.props.zoom*(s/t.lastPinchDistance);t.setNewZoom(c,n,{shouldUpdatePosition:!1}),t.lastPinchDistance=s;var l=ce(r,i),u=t.props.rotation+(l-t.lastPinchRotation);t.props.onRotationChange&&t.props.onRotationChange(u),t.lastPinchRotation=l})}},o.prototype.render=function(){var e=this,t,r=this.props,i=r.image,n=r.video,s=r.mediaProps,c=r.cropperProps,l=r.transform,u=r.crop,h=u.x,d=u.y,m=r.rotation,w=r.zoom,v=r.cropShape,f=r.showGrid,R=r.roundCropAreaPixels,y=r.style,g=y.containerStyle,E=y.cropAreaStyle,_=y.mediaStyle,P=r.classes,k=P.containerClassName,W=P.cropAreaClassName,D=P.mediaClassName,z=(t=this.state.mediaObjectFit)!==null&&t!==void 0?t:this.getObjectFit();return x.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(U){return e.containerRef=U},"data-testid":"container",style:g,className:L("reactEasyCrop_Container",k)},i?x.createElement("img",b({alt:"",className:L("reactEasyCrop_Image",z==="contain"&&"reactEasyCrop_Contain",z==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",z==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",D)},s,{src:i,ref:this.imageRef,style:b(b({},_),{transform:l||"translate(".concat(h,"px, ").concat(d,"px) rotate(").concat(m,"deg) scale(").concat(w,")")}),onLoad:this.onMediaLoad})):n&&x.createElement("video",b({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:L("reactEasyCrop_Video",z==="contain"&&"reactEasyCrop_Contain",z==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",z==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",D)},s,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:b(b({},_),{transform:l||"translate(".concat(h,"px, ").concat(d,"px) rotate(").concat(m,"deg) scale(").concat(w,")")}),controls:!1}),(Array.isArray(n)?n:[{src:n}]).map(function(T){return x.createElement("source",b({key:T.src},T))})),this.state.cropSize&&x.createElement("div",b({ref:this.cropperRef,style:b(b({},E),{width:R?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:R?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:L("reactEasyCrop_CropArea",v==="round"&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",W)},c)))},o.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:at,minZoom:nt,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:st},o.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},o.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},o})(x.Component);function lt({className:a,defaultValue:o,value:e,min:t=0,max:r=100,...i}){const n=x.useMemo(()=>Array.isArray(e)?e:Array.isArray(o)?o:[t,r],[e,o,t,r]);return p.jsxs(Se,{"data-slot":"slider",defaultValue:o,value:e,min:t,max:r,className:B("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",a),...i,children:[p.jsx(_e,{"data-slot":"slider-track",className:B("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:p.jsx(ze,{"data-slot":"slider-range",className:B("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:n.length},(s,c)=>p.jsx(De,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},c))]})}const de=["image/png","image/jpeg","image/webp"],he=2*1024*1024,fe=256,ut=a=>{const o=a.normalize("NFKD").toLowerCase(),e=o.lastIndexOf("."),t=e>0?o.slice(0,e):o,r=e>0?o.slice(e).replace(/[^.a-z0-9]/g,""):"";return`${t.replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"profile-picture"}${r}`},pt=(a,o,e=Date.now())=>`profile-pictures/${a}/${e}-${ut(o)}`,me=a=>de.includes(a.type)?a.size>he?"Profile pictures must be 2MB or smaller.":a.name.trim()?null:"Please choose a valid image file.":"Only PNG, JPEG, and WebP images are allowed.",dt=a=>new Promise((o,e)=>{const t=URL.createObjectURL(a),r=new Image,i=setTimeout(()=>{URL.revokeObjectURL(t),e(new Error("Image loading timed out. Please try a different file."))},15e3);r.onload=()=>{clearTimeout(i),URL.revokeObjectURL(t),o(r)},r.onerror=()=>{clearTimeout(i),URL.revokeObjectURL(t),e(new Error("Unable to read the selected image. Please try another file."))},r.crossOrigin="anonymous",r.src=t}),ue=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the image for upload."));return}t(i)},o,e)}),ht=async(a,o=fe)=>{const e=await dt(a),t=document.createElement("canvas");t.width=o,t.height=o;const r=t.getContext("2d");if(!r)throw new Error("Your browser cannot process image uploads right now.");const i=e.naturalWidth||e.width,n=e.naturalHeight||e.height,s=Math.min(i,n),c=Math.max(0,(i-s)/2),l=Math.max(0,(n-s)/2);r.clearRect(0,0,o,o),r.drawImage(e,c,l,s,s,0,0,o,o);try{return await ue(t,"image/webp",.9)}catch{return await ue(t,"image/jpeg",.9)}},j=(a,o,e)=>{let t;const r=new Promise((i,n)=>{t=setTimeout(()=>n(new Error(`${e} timed out after ${Math.round(o/1e3)}s`)),o)});return Promise.race([a,r]).finally(()=>clearTimeout(t))},ft=async(a,o,e)=>{const t=we.options.projectId;if(!t)throw new Error("Firebase project ID is not configured.");const r=await a.getIdToken(),i=`https://firestore.googleapis.com/v1/projects/${t}/databases/(default)/documents/users/${o}?updateMask.fieldPaths=photo&updateMask.fieldPaths=updatedAt`,n=await fetch(i,{method:"PATCH",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({fields:{photo:{stringValue:e},updatedAt:{timestampValue:new Date().toISOString()}}})});if(!n.ok){const s=await n.text().catch(()=>"");throw new Error(`Firestore REST update failed (${n.status}): ${s}`)}},mt=async({file:a,uid:o,currentUser:e=K.currentUser,syncFirestore:t=!0})=>{const r=me(a);if(r)throw new Error(r);const i=e??K.currentUser;if(!i)throw new Error("You need to be signed in to change your profile picture.");const n=o||i.uid;if(!n)throw new Error("Unable to determine which profile should be updated.");if(i.uid!==n)throw new Error("The signed-in user does not match the profile being edited.");const s=await j(ht(a,fe),2e4,"Image processing"),c=pt(n,a.name),l=Ae(ge,c),u=await j(Te(l,s,{contentType:s.type||"image/webp",cacheControl:"public, max-age=31536000, immutable"}),3e4,"Storage upload"),h=await j(Ne(u.ref),1e4,"Download URL retrieval");try{await j(Me(i,{photoURL:h}),1e4,"Auth profile update")}catch(d){console.warn("[PROFILE UPLOAD] Auth profile update failed (non-fatal):",d)}if(t){try{await j(ft(i,n,h),1e4,"Firestore profile sync")}catch(d){console.error("[PROFILE UPLOAD] Firestore REST sync failed:",d),console.warn("[PROFILE UPLOAD] Photo was uploaded but the database record may be stale. It will refresh on next login.")}try{const{doc:d,updateDoc:m}=await $(async()=>{const{doc:v,updateDoc:f}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{doc:v,updateDoc:f}},__vite__mapDeps([0,1])),{db:w}=await $(async()=>{const{db:v}=await import("./index-BufUS6SI.js").then(f=>f.b7);return{db:v}},__vite__mapDeps([2,3,0,1,4,5,6,7,8,9,10,11]));await m(d(w,"leaderboard",n),{photo:h}).catch(()=>$(async()=>{const{setDoc:v}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{setDoc:v}},__vite__mapDeps([0,1])).then(({setDoc:v})=>v(d(w,"leaderboard",n),{photo:h},{merge:!0})))}catch{}}return h},vt=a=>`${(a/(1024*1024)).toFixed(1)} MB`,gt=a=>{const o=(a||"").trim();return o?o.split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()).join(""):"U"},wt=a=>new Promise((o,e)=>{const t=new Image;t.onload=()=>o(t),t.onerror=()=>e(new Error("Unable to load the image for cropping.")),t.src=a}),pe=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the cropped image."));return}t(i)},o,e)}),xt=async(a,o,e)=>{const t=await wt(a),r=document.createElement("canvas"),i=640;r.width=i,r.height=i;const n=r.getContext("2d");if(!n)throw new Error("Your browser cannot process the selected image right now.");n.clearRect(0,0,i,i),n.drawImage(t,o.x,o.y,o.width,o.height,0,0,i,i);let s;try{s=await pe(r,"image/webp",.92)}catch{s=await pe(r,"image/jpeg",.92)}if(!s)throw new Error("Could not create an image from the cropped area.");const c=s.type==="image/webp"?"webp":"jpg",u=`${e.name.replace(/\.[^/.]+$/,"")||"profile-picture"}-cropped.${c}`;return new File([s],u,{type:s.type,lastModified:Date.now()})},Nt=({uid:a,photoURL:o,displayName:e,className:t="",onUploaded:r,syncFirestore:i=!0})=>{const{currentUser:n,refreshProfile:s}=xe(),[c,l]=x.useState(null),[u,h]=x.useState(null),[d,m]=x.useState({x:0,y:0}),[w,v]=x.useState(1),[f,R]=x.useState(null),[y,g]=x.useState(""),[E,_]=x.useState(!1),P=x.useRef(null);x.useEffect(()=>{if(!c){h(null);return}const C=URL.createObjectURL(c);return h(C),()=>URL.revokeObjectURL(C)},[c]);const k=u||o||"",W=x.useMemo(()=>`${de.map(S=>S.replace("image/","").toUpperCase()).join(", ")} up to ${vt(he)}. The image will be cropped to a circular avatar.`,[]),D=()=>{l(null),m({x:0,y:0}),v(1),R(null),g(""),P.current&&(P.current.value="")},z=C=>{const S=C.target.files?.[0]||null;if(!S)return;const M=me(S);if(M){g(M),l(null),C.target.value="";return}g(""),l(S),m({x:0,y:0}),v(1),R(null)},T=async()=>{if(!c){g("Choose an image before saving.");return}_(!0),g("");const C=6e4;let S;try{const M=(async()=>{const I=u&&f?await xt(u,f,c):c,Z=a||n?.uid;return mt({file:I,uid:Z,currentUser:n,syncFirestore:i})})(),F=new Promise((I,Z)=>{S=setTimeout(()=>Z(new Error("Upload timed out. Please check your connection and try again.")),C)}),ve=await Promise.race([M,F]);r?.(ve),s().catch(I=>console.warn("[ProfilePictureUploader] refreshProfile failed:",I)),Q.success("Profile picture updated."),D()}catch(M){const F=M instanceof Error?M.message:"Failed to update your profile picture.";g(F),Q.error(F)}finally{clearTimeout(S),_(!1)}},U=()=>{P.current?.click()};return p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:`flex items-center gap-4 rounded-xl border border-slate-200 bg-white p-4 shadow-sm ${t}`,children:[p.jsxs("div",{className:"relative cursor-pointer group",onClick:U,role:"button",tabIndex:0,onKeyDown:C=>C.key==="Enter"&&U(),"aria-label":"Change profile picture",children:[p.jsxs(ye,{className:"size-16 sm:size-20 ring-4 ring-sky-50 shadow-sm transition-transform duration-200 group-hover:scale-105",children:[p.jsx(be,{src:k,alt:`${e||"User"} profile picture`}),p.jsx(Ce,{className:"bg-gradient-to-br from-sky-600 to-cyan-500 text-lg font-semibold text-white",children:gt(e)})]}),p.jsx("span",{className:"absolute -right-1 -top-1 inline-flex items-center justify-center rounded-full bg-slate-900 p-1.5 text-white shadow-md transition-colors group-hover:bg-slate-700",children:p.jsx(Oe,{size:14})})]}),p.jsxs("div",{className:"space-y-1 flex-1",children:[p.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"Profile picture"}),p.jsx("p",{className:"text-xs text-slate-500",children:"Click your avatar to upload a new photo."}),y&&p.jsx("p",{className:"text-xs font-medium text-rose-600 mt-1",children:y})]}),p.jsx("input",{ref:P,type:"file",accept:"image/*",onChange:z,className:"sr-only","aria-label":"Choose profile picture"})]}),p.jsx(Pe,{children:u&&p.jsxs(p.Fragment,{children:[p.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[60]",onClick:D}),p.jsx(J.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{type:"spring",duration:.5,bounce:.3},className:"fixed inset-0 z-[60] flex items-center justify-center p-4 sm:p-6",onClick:C=>C.stopPropagation(),children:p.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg overflow-hidden flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-100",children:[p.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"Update profile picture"}),p.jsx("button",{onClick:D,className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-full transition-colors","aria-label":"Close modal",children:p.jsx(je,{size:20})})]}),p.jsxs("div",{className:"p-4 sm:p-6 bg-slate-50 flex flex-col items-center",children:[p.jsx("div",{className:"relative h-[350px] sm:h-[450px] w-[350px] sm:w-[450px] mx-auto overflow-hidden rounded-xl bg-slate-100 ring-1 ring-inset ring-slate-200 shadow-inner",children:p.jsx(ct,{image:u,crop:d,zoom:w,aspect:1,cropShape:"round",showGrid:!1,objectFit:"cover",restrictPosition:!0,onCropChange:m,onZoomChange:v,onCropComplete:(C,S)=>R(S),style:{containerStyle:{backgroundColor:"#f8fafc"}}})}),p.jsxs("div",{className:"mt-6 w-full max-w-xs flex items-center gap-4",children:[p.jsx(Ue,{size:18,className:"text-slate-500"}),p.jsx(lt,{value:[w],min:1,max:3,step:.05,onValueChange:C=>v(C[0]||1),"aria-label":"Profile picture zoom",className:"flex-1 cursor-pointer"}),p.jsx(Fe,{size:18,className:"text-slate-500"})]}),p.jsx("p",{className:"mt-4 text-xs text-slate-500 text-center",children:W})]}),p.jsxs("div",{className:"p-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-white",children:[p.jsx(ee,{type:"button",variant:"ghost",onClick:D,disabled:E,className:"font-medium text-slate-600 hover:text-slate-900 hover:bg-slate-100 px-5",children:"Cancel"}),p.jsx(ee,{type:"button",onClick:T,disabled:E||!c,className:"bg-sky-600 hover:bg-sky-700 text-white min-w-[120px] gap-2 shadow-sm",children:E?p.jsxs(p.Fragment,{children:[p.jsx(Ie,{size:16,className:"animate-pulse"}),"Saving..."]}):"Save picture"})]})]})})]})})]})};export{At as M,Nt as P,Tt as V};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/index-Bp7MiGcW.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-Dja0MwoB.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{e as V,o as B,k as K,J as ge,_ as $,b4 as we,u as xe,W as ye,X as be,Y as Ce,h as Pe,m as J,j as Q}from"./index-Bp7MiGcW.js";import{g as Re,r as x,j as p}from"./vendor-react-B4AQeu28.js";import{_ as Ee,o as b,p as Se,q as _e,r as ze,s as De}from"./vendor-radix-C5nwdvGr.js";import{B as ee}from"./button-BMVm9YQO.js";import{updateProfile as Me}from"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-core-D7GXCeNu.js";import{r as Ae,u as Te,a as Ne}from"./vendor-firebase-storage-Bi7H_66d.js";import{X as je}from"./x-k8d6VLEw.js";import{M as Ue}from"./minus-BK7K7Pi2.js";import{P as Fe}from"./plus-D4SEqrVj.js";import{U as Ie}from"./upload-CP6O7WIX.js";/**
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
|
|
|
| 107 |
border-left: 0;
|
| 108 |
border-right: 0;
|
| 109 |
}
|
| 110 |
+
`,nt=1,at=3,st=1,ct=(function(a){Ee(o,a);function o(){var e=a!==null&&a.apply(this,arguments)||this;return e.cropperRef=x.createRef(),e.imageRef=x.createRef(),e.videoRef=x.createRef(),e.containerPosition={x:0,y:0},e.containerRef=null,e.styleRef=null,e.containerRect=null,e.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},e.dragStartPosition={x:0,y:0},e.dragStartCrop={x:0,y:0},e.gestureZoomStart=0,e.gestureRotationStart=0,e.isTouching=!1,e.lastPinchDistance=0,e.lastPinchRotation=0,e.rafDragTimeout=null,e.rafPinchTimeout=null,e.wheelTimer=null,e.currentDoc=typeof document<"u"?document:null,e.currentWindow=typeof window<"u"?window:null,e.resizeObserver=null,e.previousCropSize=null,e.isInitialized=!1,e.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},e.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!e.containerRef)){var t=!0;e.resizeObserver=new window.ResizeObserver(function(r){if(t){t=!1;return}e.computeSizes()}),e.resizeObserver.observe(e.containerRef)}},e.preventZoomSafari=function(t){return t.preventDefault()},e.cleanEvents=function(){e.currentDoc&&(e.currentDoc.removeEventListener("mousemove",e.onMouseMove),e.currentDoc.removeEventListener("mouseup",e.onDragStopped),e.currentDoc.removeEventListener("touchmove",e.onTouchMove),e.currentDoc.removeEventListener("touchend",e.onDragStopped),e.currentDoc.removeEventListener("gesturechange",e.onGestureChange),e.currentDoc.removeEventListener("gestureend",e.onGestureEnd),e.currentDoc.removeEventListener("scroll",e.onScroll))},e.clearScrollEvent=function(){e.containerRef&&e.containerRef.removeEventListener("wheel",e.onWheel),e.wheelTimer&&clearTimeout(e.wheelTimer)},e.onMediaLoad=function(){var t=e.computeSizes();t&&(e.previousCropSize=t,e.emitCropData(),e.setInitialCrop(t),e.isInitialized=!0),e.props.onMediaLoaded&&e.props.onMediaLoaded(e.mediaSize)},e.setInitialCrop=function(t){if(e.props.initialCroppedAreaPercentages){var r=et(e.props.initialCroppedAreaPercentages,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=r.crop,n=r.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}else if(e.props.initialCroppedAreaPixels){var s=rt(e.props.initialCroppedAreaPixels,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=s.crop,n=s.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}},e.computeSizes=function(){var t,r,i,n,s,c,l=e.imageRef.current||e.videoRef.current;if(l&&e.containerRef){e.containerRect=e.containerRef.getBoundingClientRect(),e.saveContainerPosition();var u=e.containerRect.width/e.containerRect.height,h=((t=e.imageRef.current)===null||t===void 0?void 0:t.naturalWidth)||((r=e.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,d=((i=e.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((n=e.videoRef.current)===null||n===void 0?void 0:n.videoHeight)||0,m=l.offsetWidth<h||l.offsetHeight<d,w=h/d,v=void 0;if(m)switch(e.state.mediaObjectFit){default:case"contain":v=u>w?{width:e.containerRect.height*w,height:e.containerRect.height}:{width:e.containerRect.width,height:e.containerRect.width/w};break;case"horizontal-cover":v={width:e.containerRect.width,height:e.containerRect.width/w};break;case"vertical-cover":v={width:e.containerRect.height*w,height:e.containerRect.height};break}else v={width:l.offsetWidth,height:l.offsetHeight};e.mediaSize=b(b({},v),{naturalWidth:h,naturalHeight:d}),e.props.setMediaSize&&e.props.setMediaSize(e.mediaSize);var f=e.props.cropSize?e.props.cropSize:Xe(e.mediaSize.width,e.mediaSize.height,e.containerRect.width,e.containerRect.height,e.props.aspect,e.props.rotation);return(((s=e.state.cropSize)===null||s===void 0?void 0:s.height)!==f.height||((c=e.state.cropSize)===null||c===void 0?void 0:c.width)!==f.width)&&e.props.onCropSizeChange&&e.props.onCropSizeChange(f),e.setState({cropSize:f},e.recomputeCropPosition),e.props.setCropSize&&e.props.setCropSize(f),f}},e.saveContainerPosition=function(){if(e.containerRef){var t=e.containerRef.getBoundingClientRect();e.containerPosition={x:t.left,y:t.top}}},e.onMouseDown=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("mousemove",e.onMouseMove),e.currentDoc.addEventListener("mouseup",e.onDragStopped),e.saveContainerPosition(),e.onDragStart(o.getMousePoint(t)))},e.onMouseMove=function(t){return e.onDrag(o.getMousePoint(t))},e.onScroll=function(t){e.currentDoc&&(t.preventDefault(),e.saveContainerPosition())},e.onTouchStart=function(t){e.currentDoc&&(e.isTouching=!0,!(e.props.onTouchRequest&&!e.props.onTouchRequest(t))&&(e.currentDoc.addEventListener("touchmove",e.onTouchMove,{passive:!1}),e.currentDoc.addEventListener("touchend",e.onDragStopped),e.saveContainerPosition(),t.touches.length===2?e.onPinchStart(t):t.touches.length===1&&e.onDragStart(o.getTouchPoint(t.touches[0]))))},e.onTouchMove=function(t){t.preventDefault(),t.touches.length===2?e.onPinchMove(t):t.touches.length===1&&e.onDrag(o.getTouchPoint(t.touches[0]))},e.onGestureStart=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("gesturechange",e.onGestureChange),e.currentDoc.addEventListener("gestureend",e.onGestureEnd),e.gestureZoomStart=e.props.zoom,e.gestureRotationStart=e.props.rotation)},e.onGestureChange=function(t){if(t.preventDefault(),!e.isTouching){var r=o.getMousePoint(t),i=e.gestureZoomStart-1+t.scale;if(e.setNewZoom(i,r,{shouldUpdatePosition:!0}),e.props.onRotationChange){var n=e.gestureRotationStart+t.rotation;e.props.onRotationChange(n)}}},e.onGestureEnd=function(t){e.cleanEvents()},e.onDragStart=function(t){var r,i,n=t.x,s=t.y;e.dragStartPosition={x:n,y:s},e.dragStartCrop=b({},e.props.crop),(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r)},e.onDrag=function(t){var r=t.x,i=t.y;e.currentWindow&&(e.rafDragTimeout&&e.currentWindow.cancelAnimationFrame(e.rafDragTimeout),e.rafDragTimeout=e.currentWindow.requestAnimationFrame(function(){if(e.state.cropSize&&!(r===void 0||i===void 0)){var n=r-e.dragStartPosition.x,s=i-e.dragStartPosition.y,c={x:e.dragStartCrop.x+n,y:e.dragStartCrop.y+s},l=e.props.restrictPosition?N(c,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):c;e.props.onCropChange(l)}}))},e.onDragStopped=function(){var t,r;e.isTouching=!1,e.cleanEvents(),e.emitCropData(),(r=(t=e.props).onInteractionEnd)===null||r===void 0||r.call(t)},e.onWheel=function(t){if(e.currentWindow&&!(e.props.onWheelRequest&&!e.props.onWheelRequest(t))){t.preventDefault();var r=o.getMousePoint(t),i=Ye(t).pixelY,n=e.props.zoom-i*e.props.zoomSpeed/200;e.setNewZoom(n,r,{shouldUpdatePosition:!0}),e.state.hasWheelJustStarted||e.setState({hasWheelJustStarted:!0},function(){var s,c;return(c=(s=e.props).onInteractionStart)===null||c===void 0?void 0:c.call(s)}),e.wheelTimer&&clearTimeout(e.wheelTimer),e.wheelTimer=e.currentWindow.setTimeout(function(){return e.setState({hasWheelJustStarted:!1},function(){var s,c;return(c=(s=e.props).onInteractionEnd)===null||c===void 0?void 0:c.call(s)})},250)}},e.getPointOnContainer=function(t,r){var i=t.x,n=t.y;if(!e.containerRect)throw new Error("The Cropper is not mounted");return{x:e.containerRect.width/2-(i-r.x),y:e.containerRect.height/2-(n-r.y)}},e.getPointOnMedia=function(t){var r=t.x,i=t.y,n=e.props,s=n.crop,c=n.zoom;return{x:(r+s.x)/c,y:(i+s.y)/c}},e.setNewZoom=function(t,r,i){var n=i===void 0?{}:i,s=n.shouldUpdatePosition,c=s===void 0?!0:s;if(!(!e.state.cropSize||!e.props.onZoomChange)){var l=O(t,e.props.minZoom,e.props.maxZoom);if(c){var u=e.getPointOnContainer(r,e.containerPosition),h=e.getPointOnMedia(u),d={x:h.x*l-u.x,y:h.y*l-u.y},m=e.props.restrictPosition?N(d,e.mediaSize,e.state.cropSize,l,e.props.rotation):d;e.props.onCropChange(m)}e.props.onZoomChange(l)}},e.getCropData=function(){if(!e.state.cropSize)return null;var t=e.props.restrictPosition?N(e.props.crop,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):e.props.crop;return Ke(t,e.mediaSize,e.state.cropSize,e.getAspect(),e.props.zoom,e.props.rotation,e.props.restrictPosition)},e.emitCropData=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropComplete&&e.props.onCropComplete(r,i),e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.emitCropAreaChange=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.recomputeCropPosition=function(){var t,r;if(e.state.cropSize){var i=e.props.crop;if(e.isInitialized&&(!((t=e.previousCropSize)===null||t===void 0)&&t.width)&&(!((r=e.previousCropSize)===null||r===void 0)&&r.height)){var n=Math.abs(e.previousCropSize.width-e.state.cropSize.width)>1e-6||Math.abs(e.previousCropSize.height-e.state.cropSize.height)>1e-6;if(n){var s=e.state.cropSize.width/e.previousCropSize.width,c=e.state.cropSize.height/e.previousCropSize.height;i={x:e.props.crop.x*s,y:e.props.crop.y*c}}}var l=e.props.restrictPosition?N(i,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):i;e.previousCropSize=e.state.cropSize,e.props.onCropChange(l),e.emitCropData()}},e.onKeyDown=function(t){var r,i,n=e.props,s=n.crop,c=n.onCropChange,l=n.keyboardStep,u=n.zoom,h=n.rotation,d=l;if(e.state.cropSize){t.shiftKey&&(d*=.2);var m=b({},s);switch(t.key){case"ArrowUp":m.y-=d,t.preventDefault();break;case"ArrowDown":m.y+=d,t.preventDefault();break;case"ArrowLeft":m.x-=d,t.preventDefault();break;case"ArrowRight":m.x+=d,t.preventDefault();break;default:return}e.props.restrictPosition&&(m=N(m,e.mediaSize,e.state.cropSize,u,h)),t.repeat||(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r),c(m)}},e.onKeyUp=function(t){var r,i;switch(t.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":t.preventDefault();break;default:return}e.emitCropData(),(i=(r=e.props).onInteractionEnd)===null||i===void 0||i.call(r)},e}return o.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=it,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},o.prototype.componentWillUnmount=function(){var e,t;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((t=this.styleRef.parentNode)===null||t===void 0||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},o.prototype.componentDidUpdate=function(e){var t,r,i,n,s,c,l,u,h;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():((t=e.cropSize)===null||t===void 0?void 0:t.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((i=e.cropSize)===null||i===void 0?void 0:i.width)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.width)?this.computeSizes():(((s=e.crop)===null||s===void 0?void 0:s.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((l=e.crop)===null||l===void 0?void 0:l.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&((h=this.videoRef.current)===null||h===void 0||h.load());var d=this.getObjectFit();d!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:d},this.computeSizes)},o.prototype.getAspect=function(){var e=this.props,t=e.cropSize,r=e.aspect;return t?t.width/t.height:r},o.prototype.getObjectFit=function(){var e,t,r,i;if(this.props.objectFit==="cover"){var n=this.imageRef.current||this.videoRef.current;if(n&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,c=((e=this.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((t=this.videoRef.current)===null||t===void 0?void 0:t.videoWidth)||0,l=((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,u=c/l;return u<s?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},o.prototype.onPinchStart=function(e){var t=o.getTouchPoint(e.touches[0]),r=o.getTouchPoint(e.touches[1]);this.lastPinchDistance=se(t,r),this.lastPinchRotation=ce(t,r),this.onDragStart(le(t,r))},o.prototype.onPinchMove=function(e){var t=this;if(!(!this.currentDoc||!this.currentWindow)){var r=o.getTouchPoint(e.touches[0]),i=o.getTouchPoint(e.touches[1]),n=le(r,i);this.onDrag(n),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=se(r,i),c=t.props.zoom*(s/t.lastPinchDistance);t.setNewZoom(c,n,{shouldUpdatePosition:!1}),t.lastPinchDistance=s;var l=ce(r,i),u=t.props.rotation+(l-t.lastPinchRotation);t.props.onRotationChange&&t.props.onRotationChange(u),t.lastPinchRotation=l})}},o.prototype.render=function(){var e=this,t,r=this.props,i=r.image,n=r.video,s=r.mediaProps,c=r.cropperProps,l=r.transform,u=r.crop,h=u.x,d=u.y,m=r.rotation,w=r.zoom,v=r.cropShape,f=r.showGrid,R=r.roundCropAreaPixels,y=r.style,g=y.containerStyle,E=y.cropAreaStyle,_=y.mediaStyle,P=r.classes,k=P.containerClassName,W=P.cropAreaClassName,D=P.mediaClassName,z=(t=this.state.mediaObjectFit)!==null&&t!==void 0?t:this.getObjectFit();return x.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(U){return e.containerRef=U},"data-testid":"container",style:g,className:L("reactEasyCrop_Container",k)},i?x.createElement("img",b({alt:"",className:L("reactEasyCrop_Image",z==="contain"&&"reactEasyCrop_Contain",z==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",z==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",D)},s,{src:i,ref:this.imageRef,style:b(b({},_),{transform:l||"translate(".concat(h,"px, ").concat(d,"px) rotate(").concat(m,"deg) scale(").concat(w,")")}),onLoad:this.onMediaLoad})):n&&x.createElement("video",b({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:L("reactEasyCrop_Video",z==="contain"&&"reactEasyCrop_Contain",z==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",z==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",D)},s,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:b(b({},_),{transform:l||"translate(".concat(h,"px, ").concat(d,"px) rotate(").concat(m,"deg) scale(").concat(w,")")}),controls:!1}),(Array.isArray(n)?n:[{src:n}]).map(function(T){return x.createElement("source",b({key:T.src},T))})),this.state.cropSize&&x.createElement("div",b({ref:this.cropperRef,style:b(b({},E),{width:R?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:R?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:L("reactEasyCrop_CropArea",v==="round"&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",W)},c)))},o.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:at,minZoom:nt,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:st},o.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},o.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},o})(x.Component);function lt({className:a,defaultValue:o,value:e,min:t=0,max:r=100,...i}){const n=x.useMemo(()=>Array.isArray(e)?e:Array.isArray(o)?o:[t,r],[e,o,t,r]);return p.jsxs(Se,{"data-slot":"slider",defaultValue:o,value:e,min:t,max:r,className:B("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",a),...i,children:[p.jsx(_e,{"data-slot":"slider-track",className:B("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-4 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:p.jsx(ze,{"data-slot":"slider-range",className:B("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:n.length},(s,c)=>p.jsx(De,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},c))]})}const de=["image/png","image/jpeg","image/webp"],he=2*1024*1024,fe=256,ut=a=>{const o=a.normalize("NFKD").toLowerCase(),e=o.lastIndexOf("."),t=e>0?o.slice(0,e):o,r=e>0?o.slice(e).replace(/[^.a-z0-9]/g,""):"";return`${t.replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"profile-picture"}${r}`},pt=(a,o,e=Date.now())=>`profile-pictures/${a}/${e}-${ut(o)}`,me=a=>de.includes(a.type)?a.size>he?"Profile pictures must be 2MB or smaller.":a.name.trim()?null:"Please choose a valid image file.":"Only PNG, JPEG, and WebP images are allowed.",dt=a=>new Promise((o,e)=>{const t=URL.createObjectURL(a),r=new Image,i=setTimeout(()=>{URL.revokeObjectURL(t),e(new Error("Image loading timed out. Please try a different file."))},15e3);r.onload=()=>{clearTimeout(i),URL.revokeObjectURL(t),o(r)},r.onerror=()=>{clearTimeout(i),URL.revokeObjectURL(t),e(new Error("Unable to read the selected image. Please try another file."))},r.crossOrigin="anonymous",r.src=t}),ue=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the image for upload."));return}t(i)},o,e)}),ht=async(a,o=fe)=>{const e=await dt(a),t=document.createElement("canvas");t.width=o,t.height=o;const r=t.getContext("2d");if(!r)throw new Error("Your browser cannot process image uploads right now.");const i=e.naturalWidth||e.width,n=e.naturalHeight||e.height,s=Math.min(i,n),c=Math.max(0,(i-s)/2),l=Math.max(0,(n-s)/2);r.clearRect(0,0,o,o),r.drawImage(e,c,l,s,s,0,0,o,o);try{return await ue(t,"image/webp",.9)}catch{return await ue(t,"image/jpeg",.9)}},j=(a,o,e)=>{let t;const r=new Promise((i,n)=>{t=setTimeout(()=>n(new Error(`${e} timed out after ${Math.round(o/1e3)}s`)),o)});return Promise.race([a,r]).finally(()=>clearTimeout(t))},ft=async(a,o,e)=>{const t=we.options.projectId;if(!t)throw new Error("Firebase project ID is not configured.");const r=await a.getIdToken(),i=`https://firestore.googleapis.com/v1/projects/${t}/databases/(default)/documents/users/${o}?updateMask.fieldPaths=photo&updateMask.fieldPaths=updatedAt`,n=await fetch(i,{method:"PATCH",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},body:JSON.stringify({fields:{photo:{stringValue:e},updatedAt:{timestampValue:new Date().toISOString()}}})});if(!n.ok){const s=await n.text().catch(()=>"");throw new Error(`Firestore REST update failed (${n.status}): ${s}`)}},mt=async({file:a,uid:o,currentUser:e=K.currentUser,syncFirestore:t=!0})=>{const r=me(a);if(r)throw new Error(r);const i=e??K.currentUser;if(!i)throw new Error("You need to be signed in to change your profile picture.");const n=o||i.uid;if(!n)throw new Error("Unable to determine which profile should be updated.");if(i.uid!==n)throw new Error("The signed-in user does not match the profile being edited.");const s=await j(ht(a,fe),2e4,"Image processing"),c=pt(n,a.name),l=Ae(ge,c),u=await j(Te(l,s,{contentType:s.type||"image/webp",cacheControl:"public, max-age=31536000, immutable"}),3e4,"Storage upload"),h=await j(Ne(u.ref),1e4,"Download URL retrieval");try{await j(Me(i,{photoURL:h}),1e4,"Auth profile update")}catch(d){console.warn("[PROFILE UPLOAD] Auth profile update failed (non-fatal):",d)}if(t){try{await j(ft(i,n,h),1e4,"Firestore profile sync")}catch(d){console.error("[PROFILE UPLOAD] Firestore REST sync failed:",d),console.warn("[PROFILE UPLOAD] Photo was uploaded but the database record may be stale. It will refresh on next login.")}try{const{doc:d,updateDoc:m}=await $(async()=>{const{doc:v,updateDoc:f}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{doc:v,updateDoc:f}},__vite__mapDeps([0,1])),{db:w}=await $(async()=>{const{db:v}=await import("./index-Bp7MiGcW.js").then(f=>f.b7);return{db:v}},__vite__mapDeps([2,3,0,1,4,5,6,7,8,9,10,11]));await m(d(w,"leaderboard",n),{photo:h}).catch(()=>$(async()=>{const{setDoc:v}=await import("./vendor-firebase-firestore-CNv3xXal.js");return{setDoc:v}},__vite__mapDeps([0,1])).then(({setDoc:v})=>v(d(w,"leaderboard",n),{photo:h},{merge:!0})))}catch{}}return h},vt=a=>`${(a/(1024*1024)).toFixed(1)} MB`,gt=a=>{const o=(a||"").trim();return o?o.split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()).join(""):"U"},wt=a=>new Promise((o,e)=>{const t=new Image;t.onload=()=>o(t),t.onerror=()=>e(new Error("Unable to load the image for cropping.")),t.src=a}),pe=(a,o,e)=>new Promise((t,r)=>{a.toBlob(i=>{if(!i){r(new Error("Failed to prepare the cropped image."));return}t(i)},o,e)}),xt=async(a,o,e)=>{const t=await wt(a),r=document.createElement("canvas"),i=640;r.width=i,r.height=i;const n=r.getContext("2d");if(!n)throw new Error("Your browser cannot process the selected image right now.");n.clearRect(0,0,i,i),n.drawImage(t,o.x,o.y,o.width,o.height,0,0,i,i);let s;try{s=await pe(r,"image/webp",.92)}catch{s=await pe(r,"image/jpeg",.92)}if(!s)throw new Error("Could not create an image from the cropped area.");const c=s.type==="image/webp"?"webp":"jpg",u=`${e.name.replace(/\.[^/.]+$/,"")||"profile-picture"}-cropped.${c}`;return new File([s],u,{type:s.type,lastModified:Date.now()})},Nt=({uid:a,photoURL:o,displayName:e,className:t="",onUploaded:r,syncFirestore:i=!0})=>{const{currentUser:n,refreshProfile:s}=xe(),[c,l]=x.useState(null),[u,h]=x.useState(null),[d,m]=x.useState({x:0,y:0}),[w,v]=x.useState(1),[f,R]=x.useState(null),[y,g]=x.useState(""),[E,_]=x.useState(!1),P=x.useRef(null);x.useEffect(()=>{if(!c){h(null);return}const C=URL.createObjectURL(c);return h(C),()=>URL.revokeObjectURL(C)},[c]);const k=u||o||"",W=x.useMemo(()=>`${de.map(S=>S.replace("image/","").toUpperCase()).join(", ")} up to ${vt(he)}. The image will be cropped to a circular avatar.`,[]),D=()=>{l(null),m({x:0,y:0}),v(1),R(null),g(""),P.current&&(P.current.value="")},z=C=>{const S=C.target.files?.[0]||null;if(!S)return;const M=me(S);if(M){g(M),l(null),C.target.value="";return}g(""),l(S),m({x:0,y:0}),v(1),R(null)},T=async()=>{if(!c){g("Choose an image before saving.");return}_(!0),g("");const C=6e4;let S;try{const M=(async()=>{const I=u&&f?await xt(u,f,c):c,Z=a||n?.uid;return mt({file:I,uid:Z,currentUser:n,syncFirestore:i})})(),F=new Promise((I,Z)=>{S=setTimeout(()=>Z(new Error("Upload timed out. Please check your connection and try again.")),C)}),ve=await Promise.race([M,F]);r?.(ve),s().catch(I=>console.warn("[ProfilePictureUploader] refreshProfile failed:",I)),Q.success("Profile picture updated."),D()}catch(M){const F=M instanceof Error?M.message:"Failed to update your profile picture.";g(F),Q.error(F)}finally{clearTimeout(S),_(!1)}},U=()=>{P.current?.click()};return p.jsxs(p.Fragment,{children:[p.jsxs("section",{className:`flex items-center gap-4 rounded-xl border border-slate-200 bg-white p-4 shadow-sm ${t}`,children:[p.jsxs("div",{className:"relative cursor-pointer group",onClick:U,role:"button",tabIndex:0,onKeyDown:C=>C.key==="Enter"&&U(),"aria-label":"Change profile picture",children:[p.jsxs(ye,{className:"size-16 sm:size-20 ring-4 ring-sky-50 shadow-sm transition-transform duration-200 group-hover:scale-105",children:[p.jsx(be,{src:k,alt:`${e||"User"} profile picture`}),p.jsx(Ce,{className:"bg-gradient-to-br from-sky-600 to-cyan-500 text-lg font-semibold text-white",children:gt(e)})]}),p.jsx("span",{className:"absolute -right-1 -top-1 inline-flex items-center justify-center rounded-full bg-slate-900 p-1.5 text-white shadow-md transition-colors group-hover:bg-slate-700",children:p.jsx(Oe,{size:14})})]}),p.jsxs("div",{className:"space-y-1 flex-1",children:[p.jsx("p",{className:"text-sm font-semibold text-slate-900",children:"Profile picture"}),p.jsx("p",{className:"text-xs text-slate-500",children:"Click your avatar to upload a new photo."}),y&&p.jsx("p",{className:"text-xs font-medium text-rose-600 mt-1",children:y})]}),p.jsx("input",{ref:P,type:"file",accept:"image/*",onChange:z,className:"sr-only","aria-label":"Choose profile picture"})]}),p.jsx(Pe,{children:u&&p.jsxs(p.Fragment,{children:[p.jsx(J.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[60]",onClick:D}),p.jsx(J.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{type:"spring",duration:.5,bounce:.3},className:"fixed inset-0 z-[60] flex items-center justify-center p-4 sm:p-6",onClick:C=>C.stopPropagation(),children:p.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-lg overflow-hidden flex flex-col",children:[p.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-slate-100",children:[p.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"Update profile picture"}),p.jsx("button",{onClick:D,className:"p-2 text-slate-400 hover:text-slate-600 hover:bg-slate-100 rounded-full transition-colors","aria-label":"Close modal",children:p.jsx(je,{size:20})})]}),p.jsxs("div",{className:"p-4 sm:p-6 bg-slate-50 flex flex-col items-center",children:[p.jsx("div",{className:"relative h-[350px] sm:h-[450px] w-[350px] sm:w-[450px] mx-auto overflow-hidden rounded-xl bg-slate-100 ring-1 ring-inset ring-slate-200 shadow-inner",children:p.jsx(ct,{image:u,crop:d,zoom:w,aspect:1,cropShape:"round",showGrid:!1,objectFit:"cover",restrictPosition:!0,onCropChange:m,onZoomChange:v,onCropComplete:(C,S)=>R(S),style:{containerStyle:{backgroundColor:"#f8fafc"}}})}),p.jsxs("div",{className:"mt-6 w-full max-w-xs flex items-center gap-4",children:[p.jsx(Ue,{size:18,className:"text-slate-500"}),p.jsx(lt,{value:[w],min:1,max:3,step:.05,onValueChange:C=>v(C[0]||1),"aria-label":"Profile picture zoom",className:"flex-1 cursor-pointer"}),p.jsx(Fe,{size:18,className:"text-slate-500"})]}),p.jsx("p",{className:"mt-4 text-xs text-slate-500 text-center",children:W})]}),p.jsxs("div",{className:"p-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-white",children:[p.jsx(ee,{type:"button",variant:"ghost",onClick:D,disabled:E,className:"font-medium text-slate-600 hover:text-slate-900 hover:bg-slate-100 px-5",children:"Cancel"}),p.jsx(ee,{type:"button",onClick:T,disabled:E||!c,className:"bg-sky-600 hover:bg-sky-700 text-white min-w-[120px] gap-2 shadow-sm",children:E?p.jsxs(p.Fragment,{children:[p.jsx(Ie,{size:16,className:"animate-pulse"}),"Saving..."]}):"Save picture"})]})]})})]})})]})};export{At as M,Nt as P,Tt as V};
|
assets/{QuizBattlePage-Dalws6PZ.js β QuizBattlePage-R77VTOls.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{RewardsModal-wGM2jgcg.js β RewardsModal-C2mMOy8T.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as F,doc as S}from"./vendor-firebase-firestore-CNv3xXal.js";import{aR as g,A as u,aS as U,aT as P,U as $,H as B,i as R,D as I,a1 as T,T as j,aU as q,a6 as N,R as H,V as L,a2 as M,$ as v,a7 as w,B as G,Z as X,r as V,F as Z,G as K,b as Q,aK as W,g as J}from"./index-
|
|
|
|
| 1 |
+
import{r as i,j as e}from"./vendor-react-B4AQeu28.js";import{getDoc as F,doc as S}from"./vendor-firebase-firestore-CNv3xXal.js";import{aR as g,A as u,aS as U,aT as P,U as $,H as B,i as R,D as I,a1 as T,T as j,aU as q,a6 as N,R as H,V as L,a2 as M,$ as v,a7 as w,B as G,Z as X,r as V,F as Z,G as K,b as Q,aK as W,g as J}from"./index-Bp7MiGcW.js";import{X as O}from"./x-k8d6VLEw.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const Y={BookOpen:Q,GraduationCap:K,Trophy:Z,Target:V,Zap:X,Brain:G,Star:w,Flame:v,Swords:M,Shield:L,RefreshCw:H,Crown:N,Sun:q,TrendingUp:j,Globe:T,User:I,UserPlus:R,Calendar:B,Users:$,Compass:P,Heart:U,Award:u},me=({isOpen:o,onClose:c,userLevel:n,currentXP:x,xpToNextLevel:m,totalXP:p,userId:d})=>{const[y,b]=i.useState(!0),[k,_]=i.useState(new Set),[E,C]=i.useState({});i.useEffect(()=>{if(!o||!d)return;(async()=>{b(!0);try{const t=await W(d);_(new Set(t.map(a=>a.id)));const l=await F(S(J,"progress",d));l.exists()&&C(l.data())}catch(t){console.error("Error loading achievements:",t)}finally{b(!1)}})()},[o,d]);const D=s=>{const{condition:t,threshold:l}=s,a=E;let r=0,f=l??1;switch(t){case"lesson_complete":r=a.totalLessonsCompleted||0;break;case"quiz_complete":r=a.totalQuizzesCompleted||0;break;case"battle_win":case"battle_undefeated":r=a.battleWins||0;break;case"mastery_10":case"social_streak_30":case"social_daily_return":r=a.consecutiveDaysActive||0;break;case"mastery_xp":r=p;break;case"explore_friend_added":case"social_friend":case"explore_social":r=a.friendsAdded||0;break;case"perfect_score":{r=(a.quizAttempts||[]).filter(z=>z.score===100).length;break}default:return}return{progress:Math.min(r,f),total:f}},h=g.map(s=>{const t=Y[s.icon.name]??u,l=k.has(s.id),a=D(s);return{id:s.id,icon:t,title:s.title,description:s.description,progress:a?.progress,total:a?.total,unlocked:l,color:l?s.iconColor:"text-slate-500",bgColor:l?s.iconColor.replace("text-","bg-").replace("-500","/10").replace("-400","/10").replace("-600","/10"):"bg-slate-100"}}),A=h.filter(s=>s.unlocked).length;return o?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-2 sm:p-8",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:c}),e.jsxs("div",{className:"relative bg-[#f7f9fc] rounded-2xl shadow-2xl border border-[#dde3eb] w-full max-w-2xl max-h-[90vh] sm:max-h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-[#9956DE] via-[#7274ED] to-[#1FA7E1] p-4 md:p-6 text-white relative flex-shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_14%_12%,rgba(251,150,187,0.35),transparent_42%),radial-gradient(circle_at_80%_80%,rgba(117,208,106,0.25),transparent_38%)]"}),e.jsxs("div",{className:"flex items-center justify-between mb-4 relative z-10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl md:text-2xl font-display font-bold",children:"Rewards & Achievements"}),e.jsxs("p",{className:"text-white/90 text-sm font-body",children:[A," / ",g.length," Achievements Unlocked"]})]}),e.jsx("button",{onClick:c,className:"text-white/90 hover:text-white hover:bg-white/20 p-2 rounded-xl transition-colors",children:e.jsx(O,{size:24})})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 md:gap-3 relative z-10",children:[e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(N,{size:16,className:"text-[#FFB356]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Level"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:n})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(w,{size:16,className:"text-[#6ED1CF]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Total XP"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:p.toLocaleString()})]}),e.jsxs("div",{className:"bg-white/15 backdrop-blur-sm rounded-xl p-3 md:p-4 border border-white/25",children:[e.jsxs("div",{className:"flex items-center gap-1 md:gap-2 mb-1",children:[e.jsx(v,{size:16,className:"text-[#FF8B8B]"}),e.jsx("span",{className:"text-[10px] md:text-xs font-medium text-white/90 font-body",children:"Daily Rewards"})]}),e.jsx("p",{className:"text-xl md:text-2xl font-bold",children:"Check-in"})]})]}),e.jsxs("div",{className:"mt-4 relative z-10",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n]}),e.jsxs("span",{className:"text-sm font-bold text-white font-body",children:["Level ",n+1]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"flex justify-between items-center mb-1",children:e.jsxs("span",{className:"text-xs text-white/90",children:[x," / ",m," XP"]})}),e.jsx("div",{className:"h-3 bg-white/20 rounded-full overflow-hidden border border-white/20",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full transition-all duration-500 e-w",style:{"--w":`${x/m*100}%`}})})]})]})]}),e.jsx("div",{className:"p-4 md:p-6 overflow-y-auto flex-1",children:y?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-[#9956DE] border-t-transparent rounded-full"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-lg font-display font-bold text-[#0a1628] mb-4",children:"Achievements"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:h.map(s=>{const t=s.icon;return e.jsx("div",{className:`${s.unlocked?"bg-white border-[#9956DE]/25":"bg-[#edf1f7] border-[#dde3eb]"} border-2 rounded-xl p-4 transition-all ${s.unlocked?"shadow-md":"opacity-60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-12 h-12 ${s.bgColor} rounded-xl flex items-center justify-center flex-shrink-0`,children:e.jsx(t,{size:24,className:s.color})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:`text-sm font-bold ${s.unlocked?"text-[#0a1628]":"text-slate-500"} font-body`,children:s.title}),s.unlocked&&e.jsx("span",{className:"px-2 py-0.5 bg-[#75D06A] text-white text-[9px] font-bold rounded-full",children:"Unlocked"})]}),e.jsx("p",{className:`text-xs ${s.unlocked?"text-[#5a6578]":"text-slate-500"} mb-2`,children:s.description}),s.progress!==void 0&&s.total!==void 0&&!s.unlocked&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"text-[10px] text-slate-500",children:"Progress"}),e.jsxs("span",{className:"text-[10px] font-bold text-[#5a6578]",children:[s.progress," / ",s.total]})]}),e.jsx("div",{className:"h-1.5 bg-[#dde3eb] rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-[#7274ED] to-[#1FA7E1] rounded-full transition-all e-w",style:{"--w":`${s.progress/s.total*100}%`}})})]})]})]})},s.id)})})]}),e.jsxs("div",{className:"bg-white rounded-xl p-5 border border-[#dde3eb]",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-[#7274ED] to-[#1FA7E1] rounded-lg flex items-center justify-center",children:e.jsx(j,{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-1 sm:grid-cols-2 gap-2",children:[{activity:"Complete a video lesson",xp:50},{activity:"Complete exercises",xp:100},{activity:"Perfect quiz score",xp:150},{activity:"Finish a quiz",xp:75},{activity:"Daily check-in",xp:"20-100"}].map((s,t)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 bg-[#1FA7E1] rounded-full"}),e.jsxs("span",{className:"text-xs text-[#5a6578] font-body",children:[s.activity,":"]}),e.jsxs("span",{className:"text-xs font-bold text-[#7274ED]",children:["+",s.xp," XP"]})]},t))})]})]})})]})]}):null};export{me as default};
|
assets/{RightSidebar-DiW3T5Yf.js β RightSidebar-D6kbBdAu.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{q as S}from"./quiz_battle_avatar-BXHPSput.js";import{h as q,m as c,Z as _,a2 as B,a5 as P,F as W,a6 as v,a7 as X,q as Y,D as k}from"./index-BufUS6SI.js";import{C as M}from"./circle-check-big-CDg2qLfH.js";import{T as O,a as Z,b as H}from"./tooltip-qcWo8nUO.js";import{C as T}from"./chevron-right-DADygX42.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const E=[{id:1,title:"Quiz Battle",subtitle:"Challenge players worldwide!",bgColor:"bg-[#9956de]",orbColor:"bg-[#6D28D9]",icon:e.jsx(B,{size:24,className:"text-white"}),buttonText:"Join Battle",actionType:"quiz-battle",avatarText:"Waiting for you to join..."},{id:2,title:"Topic Explorer",subtitle:"Dive into a new math topic today",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",icon:e.jsx(_,{size:24,className:"text-white"}),buttonText:"Explore",actionType:"explore",avatarText:"Knowledge is power!"},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",icon:e.jsx(M,{size:24,className:"text-white"}),buttonText:null,actionType:null,avatarText:"Ready for action!"}],J=({onNavigateToQuizBattle:s,userPhoto:a})=>{const[x,m]=o.useState(0);o.useEffect(()=>{const r=setInterval(()=>{m(l=>(l+1)%E.length)},5e3);return()=>clearInterval(r)},[]);const t=E[x];return e.jsx("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:e.jsx("div",{className:"relative h-[185px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(q,{mode:"wait",children:e.jsxs(c.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${t.bgColor} p-4 sm:p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -right-4 -bottom-6 w-32 h-32 opacity-25 mix-blend-overlay pointer-events-none z-0 transform group-hover:scale-105 transition-transform duration-700",children:e.jsx("img",{src:S,alt:"",className:"w-full h-full object-contain"})}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${t.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-[25deg] group-hover:scale-110 transition-transform duration-700 flex items-center justify-center z-10",children:t.icon}),e.jsxs("div",{className:"relative z-10 w-full pr-[60px]",children:[e.jsx("h3",{className:"font-display font-bold text-[20px] leading-tight text-white mb-0.5",children:t.title}),e.jsx("p",{className:"text-[12px] font-medium text-white/90 leading-snug",children:t.subtitle}),t.buttonText&&e.jsx("button",{onClick:r=>{r.stopPropagation(),t.actionType==="quiz-battle"&&s&&s()},className:"mt-2.5 bg-white text-[#0a1628] px-2 py-1 rounded-lg font-bold text-xs shadow-sm hover:scale-105 transition-transform uppercase tracking-wider whitespace-nowrap w-fit",children:t.buttonText})]}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 mt-auto pt-2",children:[a?e.jsxs("div",{className:"relative group/avatar shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-white/40 blur-md rounded-full animate-pulse"}),e.jsx("img",{src:a,alt:"You",className:"w-8 h-8 rounded-full border-[2px] border-white object-cover relative z-10 shadow-md group-hover/avatar:scale-110 transition-transform"}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] bg-[#75D06A] border-2 border-[#7C3AED] rounded-full z-20 flex items-center justify-center",children:e.jsx(_,{size:8,className:"text-white",fill:"currentColor"})})]}):null,e.jsx("span",{className:"text-[12px] font-bold text-white tracking-wide leading-tight flex-1 pr-[60px]",children:t.avatarText})]})]},t.id)})})})},K=s=>{if(s>=1e3){const a=s/1e3;return a>=10?`${Math.round(a)}k`:`${a.toFixed(1)}k`}return`${s}`},G=({entry:s,rank:a,isYou:x,userPhoto:m,rankColor:t})=>{const r=x?s?.photo||m:s?.photo,l=x?"You":s?.name||"---",h=s?.xp||0;return e.jsxs(e.Fragment,{children:[e.jsxs(c.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3+a*.1},className:"relative mb-2",children:[a===1&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(v,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("div",{className:`w-10 h-10 rounded-full border-[3px] ${a===1?"w-[52px] h-[52px]":""} ${t.border} z-10 relative overflow-hidden ${t.shadow} bg-white`,children:r?e.jsx("img",{src:r,alt:l,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-slate-200 to-slate-300 flex items-center justify-center",children:e.jsx(k,{size:a===1?22:16,className:"text-slate-400"})})}),e.jsx("div",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 ${t.badge} text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm`,children:a})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:`block ${a===1?"text-[13px] font-black":"text-[12px] font-bold"} text-[#0a1628] truncate max-w-[80px]`,children:l}),e.jsxs("span",{className:`block ${a===1?"text-[11px]":"text-[10px]"} ${t.badge.replace("bg-","text-").replace("-500","-600").replace("-400","-600").replace("amber","amber")} font-bold`,children:[K(h)," XP"]})]})]})},ce=({currentUserId:s,onOpenRewards:a,onOpenLeaderboard:x,onNavigateToModules:m,onNavigateToQuizBattle:t,userLevel:r,userPhoto:l,currentXP:h,xpToNextLevel:f})=>{const N=h/f*100,[$,D]=o.useState([]),[F,u]=o.useState(!0),[y,g]=o.useState(null),p=o.useRef(null),n=o.useRef(null);o.useEffect(()=>{if(!s){u(!1);return}u(!0),g(null);const d=P(b=>{D(b),u(!1),g(null),n.current&&(clearTimeout(n.current),n.current=null)},s,!1,"all",3);return p.current=d,n.current=setTimeout(()=>{u(!1),g("Leaderboard data unavailable")},15e3),()=>{n.current&&(clearTimeout(n.current),n.current=null),p.current&&(p.current(),p.current=null)}},[s]);const i=$.slice(0,3);i.some(d=>d.userId===s);const z=[{bg:"from-amber-100 to-amber-50",border:"border-amber-400",badge:"bg-amber-500",shadow:"shadow-md"},{bg:"from-slate-200 to-slate-100",border:"border-sky-400",badge:"bg-sky-500",shadow:"shadow-sm"},{bg:"from-orange-50 to-slate-50",border:"border-orange-400",badge:"bg-orange-500",shadow:"shadow-sm"}],A=["74px","54px","38px"],L=["w-[78px]","w-[70px]","w-[70px]"],w=(d,b,C,R,j)=>e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(G,{entry:d,rank:C,isYou:R==="You",userPhoto:l,rankColor:z[j]}),e.jsxs(c.div,{initial:{height:0},animate:{height:A[b]},transition:{delay:.2+b*.1,duration:.5,ease:"easeOut"},className:`${L[b]} bg-gradient-to-b ${z[j].bg} rounded-t-xl rounded-b-md border-t-2 border-white/20 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]`,children:[e.jsx("span",{className:`${j===0?"text-amber-400 text-3xl":"text-slate-400 text-2xl"} font-black opacity-40 translate-y-1`,children:C}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]})]});return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:a,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(W,{size:14,className:"text-white"})}),e.jsxs("h3",{className:"font-display font-bold text-[13px] leading-tight text-white tracking-wide",children:["Rewards & ",e.jsx("br",{className:"hidden 2xl:block"})," Achievements"]})]}),e.jsx(T,{size:14,className:"shrink-0 text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3 bg-white/10 p-1.5 rounded-xl border border-white/20 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(v,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",r]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(O,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs("button",{onClick:d=>{d.stopPropagation(),m?.()},className:"flex items-center gap-1.5 text-xs font-body px-1 text-white cursor-pointer transition-colors active:scale-95",children:[e.jsx(X,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[h," XP"]})]})}),e.jsx(H,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",r+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(N),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(c.div,{initial:{width:0},animate:{width:`${N}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(J,{onNavigateToQuizBattle:t,userPhoto:l})}),e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:x,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(v,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(T,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsx("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:F?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(Y,{className:"w-5 h-5 animate-spin text-amber-400 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Loading rankings..."})]}):y||i.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(k,{className:"w-8 h-8 text-slate-300 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400 text-center",children:y||"No rankings available yet"})]}):e.jsxs(e.Fragment,{children:[w(i[1],1,2,i[1]?.name||"---",1),w(i[0],0,1,i[0]?.name||"---",0),w(i[2],2,3,i[2]?.name||"---",2)]})})]})]})};export{ce as default};
|
|
|
|
| 1 |
+
import{r as o,j as e}from"./vendor-react-B4AQeu28.js";import{q as S}from"./quiz_battle_avatar-BXHPSput.js";import{h as q,m as c,Z as _,a2 as B,a5 as P,F as W,a6 as v,a7 as X,q as Y,D as k}from"./index-Bp7MiGcW.js";import{C as M}from"./circle-check-big-JdaMs3bP.js";import{T as O,a as Z,b as H}from"./tooltip-nLNeX3nd.js";import{C as T}from"./chevron-right-BxoysOas.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const E=[{id:1,title:"Quiz Battle",subtitle:"Challenge players worldwide!",bgColor:"bg-[#9956de]",orbColor:"bg-[#6D28D9]",icon:e.jsx(B,{size:24,className:"text-white"}),buttonText:"Join Battle",actionType:"quiz-battle",avatarText:"Waiting for you to join..."},{id:2,title:"Topic Explorer",subtitle:"Dive into a new math topic today",bgColor:"bg-[#FF8B8B]",orbColor:"bg-[#E06A6A]",icon:e.jsx(_,{size:24,className:"text-white"}),buttonText:"Explore",actionType:"explore",avatarText:"Knowledge is power!"},{id:3,title:"Speed Runner",subtitle:"Finish a quiz in under 5 mins",bgColor:"bg-[#75D06A]",orbColor:"bg-[#58B34D]",icon:e.jsx(M,{size:24,className:"text-white"}),buttonText:null,actionType:null,avatarText:"Ready for action!"}],J=({onNavigateToQuizBattle:s,userPhoto:a})=>{const[x,m]=o.useState(0);o.useEffect(()=>{const r=setInterval(()=>{m(l=>(l+1)%E.length)},5e3);return()=>clearInterval(r)},[]);const t=E[x];return e.jsx("div",{className:"bg-white rounded-[24px] p-4 shadow-sm border border-slate-100 flex flex-col gap-6 mt-4 relative overflow-hidden",children:e.jsx("div",{className:"relative h-[185px] rounded-[-20px] rounded-2xl overflow-hidden cursor-pointer group",children:e.jsx(q,{mode:"wait",children:e.jsxs(c.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:`absolute inset-0 ${t.bgColor} p-4 sm:p-5 flex flex-col justify-between overflow-hidden`,children:[e.jsxs("div",{className:"absolute top-4 right-4 flex gap-1 items-center z-20",children:[e.jsx("div",{className:"w-3 h-1.5 rounded-full bg-white/60"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"}),e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-white/40"})]}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -right-4 -bottom-6 w-32 h-32 opacity-25 mix-blend-overlay pointer-events-none z-0 transform group-hover:scale-105 transition-transform duration-700",children:e.jsx("img",{src:S,alt:"",className:"w-full h-full object-contain"})}),e.jsx("div",{className:`absolute -right-4 -top-8 w-36 h-36 rounded-full ${t.orbColor} opacity-90 blur-2xl group-hover:scale-110 transition-transform duration-700 pointer-events-none`}),e.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-2xl rotate-12 bg-white/20 backdrop-blur-md shadow-sm border border-white/20 group-hover:rotate-[25deg] group-hover:scale-110 transition-transform duration-700 flex items-center justify-center z-10",children:t.icon}),e.jsxs("div",{className:"relative z-10 w-full pr-[60px]",children:[e.jsx("h3",{className:"font-display font-bold text-[20px] leading-tight text-white mb-0.5",children:t.title}),e.jsx("p",{className:"text-[12px] font-medium text-white/90 leading-snug",children:t.subtitle}),t.buttonText&&e.jsx("button",{onClick:r=>{r.stopPropagation(),t.actionType==="quiz-battle"&&s&&s()},className:"mt-2.5 bg-white text-[#0a1628] px-2 py-1 rounded-lg font-bold text-xs shadow-sm hover:scale-105 transition-transform uppercase tracking-wider whitespace-nowrap w-fit",children:t.buttonText})]}),e.jsxs("div",{className:"flex items-center gap-2.5 relative z-10 mt-auto pt-2",children:[a?e.jsxs("div",{className:"relative group/avatar shrink-0",children:[e.jsx("div",{className:"absolute inset-0 bg-white/40 blur-md rounded-full animate-pulse"}),e.jsx("img",{src:a,alt:"You",className:"w-8 h-8 rounded-full border-[2px] border-white object-cover relative z-10 shadow-md group-hover/avatar:scale-110 transition-transform"}),t.actionType==="quiz-battle"&&e.jsx("div",{className:"absolute -bottom-1 -right-1 w-[16px] h-[16px] bg-[#75D06A] border-2 border-[#7C3AED] rounded-full z-20 flex items-center justify-center",children:e.jsx(_,{size:8,className:"text-white",fill:"currentColor"})})]}):null,e.jsx("span",{className:"text-[12px] font-bold text-white tracking-wide leading-tight flex-1 pr-[60px]",children:t.avatarText})]})]},t.id)})})})},K=s=>{if(s>=1e3){const a=s/1e3;return a>=10?`${Math.round(a)}k`:`${a.toFixed(1)}k`}return`${s}`},G=({entry:s,rank:a,isYou:x,userPhoto:m,rankColor:t})=>{const r=x?s?.photo||m:s?.photo,l=x?"You":s?.name||"---",h=s?.xp||0;return e.jsxs(e.Fragment,{children:[e.jsxs(c.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.3+a*.1},className:"relative mb-2",children:[a===1&&e.jsx("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:e.jsx(v,{size:22,className:"text-amber-400 drop-shadow-md mb-1",fill:"#fbbf24",strokeWidth:1.5})}),e.jsx("div",{className:`w-10 h-10 rounded-full border-[3px] ${a===1?"w-[52px] h-[52px]":""} ${t.border} z-10 relative overflow-hidden ${t.shadow} bg-white`,children:r?e.jsx("img",{src:r,alt:l,className:"w-full h-full object-cover",onError:f=>{f.target.style.display="none"}}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-slate-200 to-slate-300 flex items-center justify-center",children:e.jsx(k,{size:a===1?22:16,className:"text-slate-400"})})}),e.jsx("div",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 ${t.badge} text-white text-[10px] font-bold px-2 py-0.5 rounded-full z-20 shadow-sm`,children:a})]}),e.jsxs("div",{className:"mt-2 text-center",children:[e.jsx("span",{className:`block ${a===1?"text-[13px] font-black":"text-[12px] font-bold"} text-[#0a1628] truncate max-w-[80px]`,children:l}),e.jsxs("span",{className:`block ${a===1?"text-[11px]":"text-[10px]"} ${t.badge.replace("bg-","text-").replace("-500","-600").replace("-400","-600").replace("amber","amber")} font-bold`,children:[K(h)," XP"]})]})]})},ce=({currentUserId:s,onOpenRewards:a,onOpenLeaderboard:x,onNavigateToModules:m,onNavigateToQuizBattle:t,userLevel:r,userPhoto:l,currentXP:h,xpToNextLevel:f})=>{const N=h/f*100,[$,D]=o.useState([]),[F,u]=o.useState(!0),[y,g]=o.useState(null),p=o.useRef(null),n=o.useRef(null);o.useEffect(()=>{if(!s){u(!1);return}u(!0),g(null);const d=P(b=>{D(b),u(!1),g(null),n.current&&(clearTimeout(n.current),n.current=null)},s,!1,"all",3);return p.current=d,n.current=setTimeout(()=>{u(!1),g("Leaderboard data unavailable")},15e3),()=>{n.current&&(clearTimeout(n.current),n.current=null),p.current&&(p.current(),p.current=null)}},[s]);const i=$.slice(0,3);i.some(d=>d.userId===s);const z=[{bg:"from-amber-100 to-amber-50",border:"border-amber-400",badge:"bg-amber-500",shadow:"shadow-md"},{bg:"from-slate-200 to-slate-100",border:"border-sky-400",badge:"bg-sky-500",shadow:"shadow-sm"},{bg:"from-orange-50 to-slate-50",border:"border-orange-400",badge:"bg-orange-500",shadow:"shadow-sm"}],A=["74px","54px","38px"],L=["w-[78px]","w-[70px]","w-[70px]"],w=(d,b,C,R,j)=>e.jsxs("div",{className:"flex flex-col items-center relative z-10",children:[e.jsx(G,{entry:d,rank:C,isYou:R==="You",userPhoto:l,rankColor:z[j]}),e.jsxs(c.div,{initial:{height:0},animate:{height:A[b]},transition:{delay:.2+b*.1,duration:.5,ease:"easeOut"},className:`${L[b]} bg-gradient-to-b ${z[j].bg} rounded-t-xl rounded-b-md border-t-2 border-white/20 flex items-center justify-center relative shadow-[inset_0_-4px_6px_rgba(0,0,0,0.05),0_4px_6px_rgba(0,0,0,0.05)]`,children:[e.jsx("span",{className:`${j===0?"text-amber-400 text-3xl":"text-slate-400 text-2xl"} font-black opacity-40 translate-y-1`,children:C}),e.jsx("div",{className:"absolute top-0 left-0 right-0 h-1.5 bg-white/70 rounded-t-xl"})]})]});return e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4,ease:[.22,1,.36,1]},onClick:a,className:"rounded-2xl border border-[#9956DE]/25 cursor-pointer transition-all group relative overflow-hidden bg-gradient-to-br from-[#9956DE] via-[#7274ED] to-[#1FA7E1] hover:shadow-[0_16px_40px_rgba(114,116,237,0.28)] hover:-translate-y-0.5",children:[e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_18%_8%,rgba(251,150,187,0.32),transparent_42%),radial-gradient(circle_at_85%_84%,rgba(117,208,106,0.24),transparent_40%)]"}),e.jsxs("div",{className:"relative z-10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 bg-white/20 rounded-xl flex items-center justify-center border border-white/35 backdrop-blur-sm",children:e.jsx(W,{size:14,className:"text-white"})}),e.jsxs("h3",{className:"font-display font-bold text-[13px] leading-tight text-white tracking-wide",children:["Rewards & ",e.jsx("br",{className:"hidden 2xl:block"})," Achievements"]})]}),e.jsx(T,{size:14,className:"shrink-0 text-white/80 group-hover:text-white group-hover:translate-x-0.5 transition-all"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-1 mb-3 bg-white/10 p-1.5 rounded-xl border border-white/20 backdrop-blur-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-body px-1 text-white",children:[e.jsx(v,{size:12,className:"text-[#FFB356]"}),e.jsxs("span",{className:"font-bold",children:["Lv ",r]})]}),e.jsx("div",{className:"w-px h-3 bg-white/35"}),e.jsxs(O,{children:[e.jsx(Z,{asChild:!0,children:e.jsxs("button",{onClick:d=>{d.stopPropagation(),m?.()},className:"flex items-center gap-1.5 text-xs font-body px-1 text-white cursor-pointer transition-colors active:scale-95",children:[e.jsx(X,{size:12,className:"text-[#6ED1CF]"}),e.jsxs("span",{className:"font-bold whitespace-nowrap",children:[h," XP"]})]})}),e.jsx(H,{side:"top",className:"bg-slate-900 text-white border border-slate-700",children:"Review more lessons to earn more XP!"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("span",{className:"text-[11px] font-body text-white/90",children:["Next: Level ",r+1]}),e.jsxs("span",{className:"text-[11px] font-body font-semibold text-white",children:[Math.round(N),"%"]})]}),e.jsx("div",{className:"h-2 bg-white/25 rounded-full overflow-hidden border border-white/20",children:e.jsx(c.div,{initial:{width:0},animate:{width:`${N}%`},transition:{duration:1,ease:"easeOut"},className:"h-full bg-gradient-to-r from-[#6ED1CF] via-[#75D06A] to-[#FFB356] rounded-full"})})]})]})]}),e.jsx(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4,ease:[.22,1,.36,1]},children:e.jsx(J,{onNavigateToQuizBattle:t,userPhoto:l})}),e.jsxs(c.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4,ease:[.22,1,.36,1]},onClick:x,className:"bg-white rounded-xl border border-slate-200/80 hover:shadow-md hover:border-amber-200/60 transition-all group overflow-hidden cursor-pointer",children:[e.jsxs("div",{className:"p-3 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 bg-amber-50 rounded-lg flex items-center justify-center border border-amber-200/60 transition-colors group-hover:bg-amber-100/50",children:e.jsx(v,{size:14,className:"text-amber-500"})}),e.jsx("h3",{className:"font-display font-bold text-sm text-[#0a1628]",children:"Leaderboards"})]}),e.jsx(T,{size:14,className:"text-slate-400 group-hover:translate-x-0.5 group-hover:text-amber-500 transition-transform"})]}),e.jsx("div",{className:"pt-8 pb-3 px-2 bg-gradient-to-b from-slate-50/30 to-white flex items-end justify-center gap-1.5 min-h-[170px]",children:F?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(Y,{className:"w-5 h-5 animate-spin text-amber-400 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400",children:"Loading rankings..."})]}):y||i.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[e.jsx(k,{className:"w-8 h-8 text-slate-300 mb-2"}),e.jsx("span",{className:"text-xs text-slate-400 text-center",children:y||"No rankings available yet"})]}):e.jsxs(e.Fragment,{children:[w(i[1],1,2,i[1]?.name||"---",1),w(i[0],0,1,i[0]?.name||"---",0),w(i[2],2,3,i[2]?.name||"---",2)]})})]})]})};export{ce as default};
|
assets/{ScientificCalculator-BIH8UnvI.js β ScientificCalculator-BCm13p89.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{e as Z,n as de,h as U,m as ue}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r as c,j as e}from"./vendor-react-B4AQeu28.js";import{e as Z,n as de,h as U,m as ue}from"./index-Bp7MiGcW.js";import{a as fe,C as pe}from"./chevron-up-DtS9MvUZ.js";import{X as be}from"./x-k8d6VLEw.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{SettingsModal-DnlLyFdo.js β SettingsModal-DNhoMuH7.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
| 2 |
-
import{e as U,u as Me,aW as Le,aX as De,aY as qe,aZ as Ie,a_ as Fe,a$ as Ve,D as Oe,V as He,a1 as Ge,b as Ue,h as $e,m as H,L as Be,F as Xe,a2 as Ye,$ as Qe,_ as G,j as d,b0 as We,aV as Je,b1 as Ke,b2 as Ze,b3 as es}from"./index-
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
|
@@ -19,4 +19,4 @@ import{e as U,u as Me,aW as Le,aX as De,aY as qe,aZ as Ie,a_ as Fe,a$ as Ve,D as
|
|
| 19 |
*
|
| 20 |
* This source code is licensed under the ISC license.
|
| 21 |
* See the LICENSE file in the root directory of this source tree.
|
| 22 |
-
*/const Ns=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],ks=U("smartphone",Ns),ws=()=>{const{userProfile:m,userRole:y}=Me(),[r,z]=a.useState(Le),[R,_]=a.useState(De),[k,T]=a.useState(!1),[D,E]=a.useState(null);a.useEffect(()=>{if(!m?.uid)return;(async()=>{T(!0),E(null);try{if(y==="teacher"){const u=await Fe(m.uid);z(u)}if(y==="admin"){const u=await Ve();_(u)}}catch(u){E(u instanceof Error?u.message:"Failed to load settings")}finally{T(!1)}})()},[m?.uid,y]);const o=a.useCallback(async g=>{if(!m?.uid)return;const u=await qe(m.uid,g);z(u)},[m?.uid]),M=a.useCallback(async g=>{const u=await Ie(g);_(u)},[]);return{teacherPrefs:r,adminConfig:R,loading:k,error:D,saveTeacherPrefs:o,saveAdminConfig:M}},ae=()=>JSON.parse(JSON.stringify(We)),rt=({isOpen:m,onClose:y,profileData:r,onSave:z,settingsData:R,onSaveSettings:_,onApplySettingsPreview:k,onExportData:T,onClearCache:D,onResetData:E})=>{const o=r?.role||"student",{teacherPrefs:M,adminConfig:g,saveTeacherPrefs:u,saveAdminConfig:ke}=ws(),[b,ne]=a.useState("account"),[l,h]=a.useState({}),[i,ie]=a.useState(ae()),[w,C]=a.useState(M),[j,$]=a.useState(g),[B,re]=a.useState(!1),[q,le]=a.useState(!1),[X,ce]=a.useState(!1),[Y,oe]=a.useState(!1),[de,Cs]=a.useState(!1),[we,I]=a.useState(!1),[Ce,F]=a.useState(!1),[Se,P]=a.useState(!1),[L,xe]=a.useState(""),[f,Ae]=a.useState(null),[v,me]=a.useState(!1),[Q,he]=a.useState(!1),[W,ue]=a.useState(""),[V,be]=a.useState(""),J=a.useRef(!1),K=a.useRef(ae());a.useEffect(()=>{if(!m){J.current=!1;return}if(J.current)return;J.current=!0;const s=R?JSON.parse(JSON.stringify(R)):ae();K.current=s,h({uid:r?.uid,name:r?.name||"",email:r?.email||"",phone:r?.phone||"",photo:r?.photo||"",avatarLayers:r?.avatarLayers,role:r?.role,gender:r?.gender,lrn:r?.lrn||"",grade:r?.grade||"",section:r?.section||"",school:r?.school||"",department:r?.department||"",subject:r?.subject||"",yearsOfExperience:r?.yearsOfExperience||"",qualification:r?.qualification||"",position:r?.position||""}),ie(s),C(M),$(g)},[m,r,R,M,g]),a.useEffect(()=>{m&&k?.(i)},[m,i,k]),a.useEffect(()=>{if(!m)return;const s=t=>{t.key==="Escape"&&(k?.(K.current),y())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[m,y,k]);const Z=a.useMemo(()=>{const s=[{id:"account",label:"Account",icon:Oe},{id:"notifications",label:"Notifications",icon:ge},{id:"appearance",label:"Appearance",icon:js}];return o==="student"&&(s.push({id:"privacy",label:"Privacy & Security",icon:He}),s.push({id:"learning",label:"Learning",icon:Ge})),o==="teacher"&&s.push({id:"teaching",label:"Teaching",icon:Ue}),o==="admin"&&s.push({id:"system",label:"System",icon:vs}),s.push({id:"data",label:"Data & Storage",icon:ve}),s},[o]),c=s=>{ie(t=>s(t))},ee=s=>{Ae(s),xe(""),he(!1),s==="password"&&ue(""),s==="email"&&be(l.email||""),P(!0)},fe=async()=>{if(!L.trim()){d.error("Current password is required");return}me(!0);try{if(f==="password"){if(W.length<8){d.error("New password must be at least 8 characters");return}await Ke(L,W),d.success("Password updated")}else if(f==="email"){if(!V.includes("@")){d.error("Enter a valid email");return}await Ze(L,V),h(s=>({...s,email:V})),d.success("Email updated")}else if(f==="delete"){await es(L,l.uid||""),d.success("Account deleted"),y();return}P(!1)}catch(s){d.error(s instanceof Error?s.message:"Authentication failed")}finally{me(!1)}},Ee=async()=>{const s=Je({name:l.name,phone:l.phone});if(s){d.error(s);return}re(!0);try{z&&await z(l),_&&await _(i),o==="teacher"&&await u(w),o==="admin"&&await ke(j),y()}catch(t){d.error(t instanceof Error?t.message:"Failed to save settings")}finally{re(!1)}},se=()=>{P(!1),I(!1),F(!1),k?.(K.current),y()},Pe=async()=>{if(!(!T||X)){ce(!0);try{await T()}catch(s){d.error(s instanceof Error?s.message:"Failed to export data")}finally{ce(!1)}}},ze=async()=>{if(!(!D||Y)){oe(!0);try{await D()}catch(s){d.error(s instanceof Error?s.message:"Failed to clear cache")}finally{oe(!1)}}},Re=async()=>{if(!(!E||q)){I(!1),le(!0);try{await E(),d.success("Testing data reset completed")}catch(s){d.error(s instanceof Error?s.message:"Failed to reset testing data")}finally{le(!1)}}},_e=()=>{F(!1),ee("delete")};return m?e.jsx($e,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-end sm:items-center justify-center sm:p-4",children:[e.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:se,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(H.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"relative bg-[#f7f9fc] rounded-t-2xl sm:rounded-2xl shadow-2xl border border-[#dde3eb] w-full sm:max-w-4xl h-[92vh] sm:max-h-[85vh] overflow-hidden flex flex-col sm:flex-row",children:[e.jsxs("div",{className:"hidden sm:flex w-64 flex-shrink-0 bg-slate-50 border-r border-slate-200 flex-col p-6 overflow-y-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-[#0a1628]",children:"Settings"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Manage your preferences"})]}),e.jsx("nav",{className:"space-y-1",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${b===s.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[e.jsx(t,{size:18}),e.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id)})})]}),e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsx("div",{className:"sm:hidden flex items-center border-b border-[#dde3eb] bg-slate-50 overflow-x-auto no-scrollbar px-2",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`flex flex-col items-center gap-0.5 px-3 py-2.5 shrink-0 text-xs font-medium border-b-2 transition-colors ${b===s.id?"border-sky-600 text-sky-700":"border-transparent text-slate-500"}`,children:[e.jsx(t,{size:16}),e.jsx("span",{className:"whitespace-nowrap",children:s.label})]},s.id)})}),e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-[#dde3eb]",children:[e.jsx("h3",{className:"text-base sm:text-lg font-display font-bold text-[#0a1628]",children:Z.find(s=>s.id===b)?.label}),e.jsx("button",{onClick:se,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:e.jsx(Ne,{size:20,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:[b==="account"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(is,{uid:l.uid,photoURL:l.photo,displayName:l.name,onUploaded:s=>h(t=>({...t,photo:s}))}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Full Name"}),e.jsx(n,{type:"text",value:l.name||"",onChange:s=>h(t=>({...t,name:s.target.value})),maxLength:100,autoComplete:"name",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Email Address"}),e.jsxs("div",{className:"flex items-center gap-2 max-w-md",children:[e.jsx(n,{type:"email",value:l.email||"",disabled:!0,className:"flex-1 bg-slate-100"}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>ee("email"),children:"Change"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Phone Number"}),e.jsx(n,{type:"tel",value:l.phone||"",onChange:s=>h(t=>({...t,phone:s.target.value})),maxLength:20,inputMode:"tel",autoComplete:"tel",pattern:"^\\+?[0-9 ()\\-.]{7,20}$",placeholder:"+63 912 345 6789",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Gender"}),e.jsxs(ss,{value:l.gender||"",onValueChange:s=>h(t=>({...t,gender:s})),children:[e.jsx(ts,{className:"max-w-md bg-white border-[#dde3eb] rounded-lg",children:e.jsx(as,{placeholder:"Select gender (optional)"})}),e.jsxs(ns,{children:[e.jsx(te,{value:"male",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rs,{className:"size-4 text-blue-500"}),e.jsx("span",{children:"Male"})]})}),e.jsx(te,{value:"female",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ls,{className:"size-4 text-pink-500"}),e.jsx("span",{children:"Female"})]})}),e.jsx(te,{value:"prefer_not_to_say",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cs,{className:"size-4 text-gray-500"}),e.jsx("span",{children:"Prefer not to say"})]})})]})]})]}),o==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"LRN"}),e.jsx(n,{value:l.lrn||"",onChange:s=>h(t=>({...t,lrn:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Grade Level"}),e.jsx(n,{value:l.grade||"",onChange:s=>h(t=>({...t,grade:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Section"}),e.jsx(n,{value:l.section||"",onChange:s=>h(t=>({...t,section:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"School"}),e.jsx(n,{value:l.school||"",onChange:s=>h(t=>({...t,school:s.target.value})),className:"max-w-md"})]})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(n,{value:l.department||"",onChange:s=>h(t=>({...t,department:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Subject"}),e.jsx(n,{value:l.subject||"",onChange:s=>h(t=>({...t,subject:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Years of Experience"}),e.jsx(n,{value:l.yearsOfExperience||"",onChange:s=>h(t=>({...t,yearsOfExperience:s.target.value})),className:"max-w-md"})]})]}),o==="admin"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Position"}),e.jsx(n,{value:l.position||"",onChange:s=>h(t=>({...t,position:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Change Password"}),e.jsxs(p,{variant:"outline",className:"rounded-xl",onClick:()=>ee("password"),children:[e.jsx(Be,{size:16,className:"mr-2"}),"Update Password"]})]})]}),b==="notifications"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Push Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Get notified on your device"})]}),e.jsx(x,{checked:i.notifications.pushNotifications,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,pushNotifications:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Sound Effects"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Play sounds for notifications"})]}),e.jsx(x,{checked:i.notifications.soundEnabled,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,soundEnabled:s}}))})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Submissions"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify when students submit work"})]}),e.jsx(x,{checked:w.notifyOnSubmission,onCheckedChange:s=>C(t=>({...t,notifyOnSubmission:s}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Activity Alerts"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify on at-risk student activity"})]}),e.jsx(x,{checked:w.notifyOnStudentActivity,onCheckedChange:s=>C(t=>({...t,notifyOnStudentActivity:s}))})]})]}),e.jsxs("div",{className:"pt-4",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-3 font-body",children:"Notification Types"}),e.jsx("div",{className:"space-y-3",children:[{key:"quizReminders",label:"Quiz Reminders"},{key:"newContent",label:"New Content"},{key:"achievements",label:"Achievements"},{key:"streakAlerts",label:"Streak Alerts"},{key:"weeklySummary",label:"Weekly Summary"}].map(s=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:i.notifications.notificationTypes[s.key],onChange:t=>c(N=>({...N,notifications:{...N.notifications,notificationTypes:{...N.notifications.notificationTypes,[s.key]:t.target.checked}}})),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),e.jsx("span",{className:"text-sm text-[#0a1628] font-body",children:s.label})]},s.key))})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Push Notification Categories"}),e.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Choose which kinds of pushes you want to receive on this device."}),e.jsxs("div",{className:"flex items-center justify-between py-2 mb-2 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h5",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Enable Push (master)"}),e.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Turn off to silence ALL push categories."})]}),e.jsx(x,{checked:i.pushPreferences.pushEnabled,onCheckedChange:s=>c(t=>({...t,pushPreferences:{...t.pushPreferences,pushEnabled:s}}))})]}),e.jsx("div",{className:"space-y-2",children:[{key:"achievement",label:"Achievements unlocked",icon:Xe},{key:"quiz_battle",label:"Quiz battle invites & results",icon:Ye},{key:"daily_reward",label:"Daily reward reminders",icon:os},{key:"assignment",label:"New assignments / deadlines",icon:ps},{key:"streak_reminder",label:"Streak reminders",icon:Qe},{key:"leaderboard",label:"Leaderboard updates",icon:ds},{key:"system",label:"System announcements",icon:xs}].map(s=>{const t=s.key,N=s.icon;return e.jsxs("label",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("span",{className:"text-sm text-[#0a1628] font-body flex items-center gap-2",children:[e.jsx(N,{className:"h-4 w-4 text-[#6c47ff]"}),s.label]}),e.jsx(x,{checked:!!i.pushPreferences[t],onCheckedChange:pe=>c(O=>({...O,pushPreferences:{...O.pushPreferences,[s.key]:pe}})),disabled:!i.pushPreferences.pushEnabled&&t!=="pushEnabled"})]},s.key)})}),e.jsx("div",{className:"mt-4",children:e.jsxs(p,{type:"button",variant:"outline",size:"sm",onClick:async()=>{try{const{requestPushPermissionAndRegister:s}=await G(async()=>{const{requestPushPermissionAndRegister:S}=await import("./index-BufUS6SI.js").then(A=>A.b9);return{requestPushPermissionAndRegister:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),{auth:t}=await G(async()=>{const{auth:S}=await import("./index-BufUS6SI.js").then(A=>A.b7);return{auth:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),N=t.currentUser?.uid;if(!N){d.error("You must be signed in to test push notifications.");return}if(!await s(N)){d.error("Push setup failed. Check that VITE_FIREBASE_VAPID_KEY is configured and notifications are allowed.");return}const{httpsCallable:O}=await G(async()=>{const{httpsCallable:S}=await import("./vendor-firebase-core-D7GXCeNu.js").then(A=>A.a9);return{httpsCallable:S}},[]),{cloudFunctions:Te}=await G(async()=>{const{cloudFunctions:S}=await import("./index-BufUS6SI.js").then(A=>A.b7);return{cloudFunctions:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),ye=(await O(Te,"sendTestPush")({}))?.data?.sent??0;ye>0?d.success(`Sent test push to ${ye} device(s).`):d.message("No active devices found. Enable browser notifications first.")}catch(s){d.error(s instanceof Error?s.message:"Failed to send test push")}},children:[e.jsx(ge,{size:14,className:"mr-2"}),"Send test push"]})})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(ms,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(n,{type:"time",value:i.notifications.quietHours.start,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,start:s.target.value}}})),className:"w-32"}),e.jsx("span",{className:"text-[#5a6578]",children:"to"}),e.jsx(n,{type:"time",value:i.notifications.quietHours.end,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,end:s.target.value}}})),className:"w-32"})]})]})]}),b==="appearance"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Dark Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Toggle dark theme"})]}),e.jsx(x,{checked:i.appearance.darkMode,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,darkMode:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-3 block font-body uppercase tracking-wider text-xs",children:"Font Size"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-slate-500",children:"Small"}),e.jsx("input",{type:"range",min:"12",max:"20",value:i.appearance.fontSize,onChange:s=>c(t=>({...t,appearance:{...t.appearance,fontSize:Number(s.target.value)}})),className:"flex-1"}),e.jsx("span",{className:"text-xs text-slate-500",children:"Large"}),e.jsxs("span",{className:"text-xs font-mono text-slate-600 w-8",children:[i.appearance.fontSize,"px"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Compact View"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show more content on screen"})]}),e.jsx(x,{checked:i.appearance.compactView,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,compactView:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Reduce Animations"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Minimize motion effects"})]}),e.jsx(x,{checked:i.appearance.reduceAnimations,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,reduceAnimations:s}}))})]})]}),b==="privacy"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Profile Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Who can see your profile"})]}),e.jsxs("select",{value:i.privacy.profileVisibility,onChange:s=>c(t=>({...t,privacy:{...t.privacy,profileVisibility:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[e.jsx("option",{value:"everyone",children:"Everyone"}),e.jsx("option",{value:"students_and_staff",children:"Students and Staff"}),e.jsx("option",{value:"private",children:"Private"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Activity Status"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let others see when you're online"})]}),e.jsx(x,{checked:i.privacy.showActivityStatus,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,showActivityStatus:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Data Sharing"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Share anonymous usage data"})]}),e.jsx(x,{checked:i.privacy.dataSharing,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,dataSharing:s}}))})]})]}),b==="learning"&&o==="student"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Daily XP Goal"}),e.jsx(n,{type:"number",value:i.learning.dailyXpGoal,onChange:s=>c(t=>({...t,learning:{...t.learning,dailyXpGoal:Number(s.target.value||0)}})),className:"max-w-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Preferred Study Time"}),e.jsxs("select",{value:i.learning.preferredStudyTime,onChange:s=>c(t=>({...t,learning:{...t.learning,preferredStudyTime:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"morning",children:"Morning (6AM - 12PM)"}),e.jsx("option",{value:"afternoon",children:"Afternoon (12PM - 6PM)"}),e.jsx("option",{value:"evening",children:"Evening (6PM - 12PM)"}),e.jsx("option",{value:"night",children:"Night (12AM - 6AM)"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-play Next Lesson"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically start the next lesson"})]}),e.jsx(x,{checked:i.learning.autoPlayLessons,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,autoPlayLessons:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Hints During Quizzes"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Display helpful hints for questions"})]}),e.jsx(x,{checked:i.learning.showHints,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,showHints:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Quiz Difficulty Preference"}),e.jsxs("select",{value:i.learning.quizDifficultyPreference,onChange:s=>c(t=>({...t,learning:{...t.learning,quizDifficultyPreference:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"adaptive",children:"Adaptive (Recommended)"}),e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(ks,{size:16,className:"inline mr-2"}),"Study Reminders"]}),e.jsx(n,{type:"time",value:i.learning.studyReminderTime,onChange:s=>c(t=>({...t,learning:{...t.learning,studyReminderTime:s.target.value}})),className:"w-32"})]})]}),b==="teaching"&&o==="teacher"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Quiz Defaults"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Time Limit (min)"}),e.jsx(n,{type:"number",value:w.quizDefaults.timeLimitMinutes,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,timeLimitMinutes:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Passing Score (%)"}),e.jsx(n,{type:"number",value:w.quizDefaults.passingScore,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,passingScore:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Attempts"}),e.jsx(n,{type:"number",value:w.quizDefaults.maxAttempts,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,maxAttempts:Number(s.target.value)}}))})]})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"Class Preferences"}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Analytics Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let students see their leaderboard rank"})]}),e.jsx(x,{checked:w.studentAnalyticsVisibility,onCheckedChange:s=>C(t=>({...t,studentAnalyticsVisibility:s}))})]})]}),b==="system"&&o==="admin"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Maintenance Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Disable platform access for non-admins"})]}),e.jsx(x,{checked:j.maintenanceMode,onCheckedChange:s=>$(t=>({...t,maintenanceMode:s}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Grade Level"}),e.jsx(n,{value:j.defaultGradeLevel,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Curriculum"}),e.jsx(n,{value:j.defaultCurriculum,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Class Size"}),e.jsx(n,{type:"number",value:j.maxClassSize,disabled:!0})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Audit Log Visible"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show audit logs in admin dashboard"})]}),e.jsx(x,{checked:j.auditLogVisible,onCheckedChange:s=>$(t=>({...t,auditLogVisible:s}))})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"AI Configuration"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Model Name"}),e.jsx(n,{value:j.aiConfig.modelName,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Temperature"}),e.jsx(n,{type:"number",value:j.aiConfig.temperature,disabled:!0})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"API Endpoint"}),e.jsx(n,{value:j.aiConfig.endpoint,disabled:!0})]})]})]}),b==="data"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-sky-900 mb-1 font-body",children:"Download Your Data"}),e.jsx("p",{className:"text-xs text-sky-700 mb-3",children:"Export all your learning data and progress"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:Pe,disabled:X,children:[e.jsx(ve,{size:16,className:"mr-2"}),X?"Exporting...":"Request Data Export"]})]}),e.jsxs("div",{className:"p-4 bg-white border border-[#dde3eb] rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Clear Cache"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-3",children:"Free up space by clearing cached data"}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:ze,disabled:Y,children:Y?"Clearing...":"Clear Cache"})]}),e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-rose-900 mb-1",children:"Reset Progress"}),e.jsxs("p",{className:"text-xs text-rose-700 mb-3",children:[o==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",o==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts.",o==="admin"&&"Reset admin testing artifacts like personal audit/content update records."]}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!E||q,onClick:()=>I(!0),children:q?"Resetting...":"Reset Testing Data"})]}),e.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-red-900 mb-1",children:"Delete Account"}),e.jsx("p",{className:"text-xs text-red-700 mb-3",children:"Permanently delete your account and all data"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:()=>F(!0),disabled:de,children:[e.jsx(hs,{size:16,className:"mr-2"}),de?"Deleting...":"Delete Account"]})]})]})]}),e.jsxs("div",{className:"shrink-0 px-4 sm:px-6 py-3 sm:py-4 border-t border-[#dde3eb] bg-[#edf1f7] flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 sm:gap-0",children:[e.jsx("p",{className:"text-xs text-slate-500 font-body text-center sm:text-left",children:"MathPulse AI v2.1.0"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(p,{variant:"outline",onClick:se,className:"rounded-lg border-[#dde3eb] flex-1 sm:flex-none",disabled:B,children:"Cancel"}),e.jsx(p,{onClick:Ee,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white flex-1 sm:flex-none",disabled:B,children:B?"Saving...":"Save Changes"})]})]})]})]})]}),Se&&e.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[130] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>{v||P(!1)},children:e.jsxs(H.div,{initial:{opacity:0,scale:.95,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{duration:.2},className:"w-full max-w-md rounded-2xl border border-[#dde3eb] bg-[#f7f9fc] shadow-2xl",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[e.jsxs("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:[f==="password"&&"Change Password",f==="email"&&"Change Email",f==="delete"&&"Delete Account"]}),e.jsx("button",{onClick:()=>{v||P(!1)},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close",children:e.jsx(Ne,{size:18,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Enter your current password to continue."}),e.jsxs("div",{className:"relative",children:[e.jsx(n,{type:Q?"text":"password",value:L,onChange:s=>xe(s.target.value),placeholder:"Current password",autoFocus:!0,className:"pr-10",disabled:v,onKeyDown:s=>{s.key==="Enter"&&fe()}}),e.jsx("button",{type:"button",onClick:()=>he(!Q),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:Q?e.jsx(us,{size:16}):e.jsx(bs,{size:16})})]}),f==="password"&&e.jsx("div",{className:"relative",children:e.jsx(n,{type:"password",value:W,onChange:s=>ue(s.target.value),placeholder:"New password (min 8 chars)",disabled:v})}),f==="email"&&e.jsx(n,{type:"email",value:V,onChange:s=>be(s.target.value),placeholder:"New email address",disabled:v}),f==="delete"&&e.jsx("p",{className:"text-sm text-red-600 font-medium",children:"This action is permanent and cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{variant:"outline",onClick:()=>P(!1),disabled:v,children:"Cancel"}),e.jsx(p,{onClick:()=>void fe(),className:f==="delete"?"bg-red-600 hover:bg-red-700 text-white":"bg-sky-600 hover:bg-sky-700 text-white",disabled:v,children:v?"Processing...":f==="delete"?"Delete Forever":"Confirm"})]})]})]})}),e.jsx(je,{isOpen:we,onClose:()=>I(!1),onConfirm:Re,title:"Reset Testing Data?",message:`Reset ${o} testing data? This will clear quizzes, diagnostic assessments, assessment history, XP, and learning progress. This action cannot be undone.`,confirmText:q?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),e.jsx(je,{isOpen:Ce,onClose:()=>F(!1),onConfirm:_e,title:"Delete Account?",message:"You will need to re-authenticate to permanently delete your account. This cannot be undone.",confirmText:"Continue",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null};export{rt as default};
|
|
|
|
| 1 |
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Bp7MiGcW.js","assets/vendor-react-B4AQeu28.js","assets/vendor-firebase-firestore-CNv3xXal.js","assets/vendor-firebase-core-D7GXCeNu.js","assets/vendor-firebase-auth-T_wvTOvf.js","assets/vendor-firebase-storage-Bi7H_66d.js","assets/vendor-firebase-analytics-rHarj5hR.js","assets/vendor-radix-C5nwdvGr.js","assets/vendor-charts-CAmziV1y.js","assets/vendor-markdown-yqZQ_iQm.js","assets/vendor-markdown-CfVKi3_s.css","assets/index-Dja0MwoB.css"])))=>i.map(i=>d[i]);
|
| 2 |
+
import{e as U,u as Me,aW as Le,aX as De,aY as qe,aZ as Ie,a_ as Fe,a$ as Ve,D as Oe,V as He,a1 as Ge,b as Ue,h as $e,m as H,L as Be,F as Xe,a2 as Ye,$ as Qe,_ as G,j as d,b0 as We,aV as Je,b1 as Ke,b2 as Ze,b3 as es}from"./index-Bp7MiGcW.js";import{r as a,j as e}from"./vendor-react-B4AQeu28.js";import{S as ss,a as ts,b as as,c as ns,d as te}from"./select-CNQuOudF.js";import{B as p}from"./button-BMVm9YQO.js";import{I as n}from"./input-Co0dljwe.js";import{S as x}from"./switch-C4JL2ii9.js";import je from"./ConfirmModal-CH3zQe0u.js";import{P as is,M as rs,V as ls}from"./ProfilePictureUploader-Cdp-MoCI.js";import{B as ge}from"./bell-DyLbgepV.js";import{D as ve}from"./download-DFL4ZCXr.js";import{X as Ne}from"./x-k8d6VLEw.js";import{C as cs}from"./circle-help-CLCoBWDy.js";import{G as os}from"./gift-CnT2c-5r.js";import{C as ds}from"./chart-column-Dyv8TfXk.js";import{M as xs}from"./megaphone-3N3DDeq6.js";import{C as ms}from"./clock-Cc6sJz1J.js";import{T as hs}from"./trash-2-BhUbBhdb.js";import{E as us,a as bs}from"./eye-B_U0s6fm.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";import"./chevron-up-DtS9MvUZ.js";import"./check-qsSFTYCr.js";import"./log-out-DrAbcVI9.js";import"./minus-BK7K7Pi2.js";import"./plus-D4SEqrVj.js";import"./upload-CP6O7WIX.js";/**
|
| 3 |
* @license lucide-react v0.487.0 - ISC
|
| 4 |
*
|
| 5 |
* This source code is licensed under the ISC license.
|
|
|
|
| 19 |
*
|
| 20 |
* This source code is licensed under the ISC license.
|
| 21 |
* See the LICENSE file in the root directory of this source tree.
|
| 22 |
+
*/const Ns=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],ks=U("smartphone",Ns),ws=()=>{const{userProfile:m,userRole:y}=Me(),[r,z]=a.useState(Le),[R,_]=a.useState(De),[k,T]=a.useState(!1),[D,E]=a.useState(null);a.useEffect(()=>{if(!m?.uid)return;(async()=>{T(!0),E(null);try{if(y==="teacher"){const u=await Fe(m.uid);z(u)}if(y==="admin"){const u=await Ve();_(u)}}catch(u){E(u instanceof Error?u.message:"Failed to load settings")}finally{T(!1)}})()},[m?.uid,y]);const o=a.useCallback(async g=>{if(!m?.uid)return;const u=await qe(m.uid,g);z(u)},[m?.uid]),M=a.useCallback(async g=>{const u=await Ie(g);_(u)},[]);return{teacherPrefs:r,adminConfig:R,loading:k,error:D,saveTeacherPrefs:o,saveAdminConfig:M}},ae=()=>JSON.parse(JSON.stringify(We)),rt=({isOpen:m,onClose:y,profileData:r,onSave:z,settingsData:R,onSaveSettings:_,onApplySettingsPreview:k,onExportData:T,onClearCache:D,onResetData:E})=>{const o=r?.role||"student",{teacherPrefs:M,adminConfig:g,saveTeacherPrefs:u,saveAdminConfig:ke}=ws(),[b,ne]=a.useState("account"),[l,h]=a.useState({}),[i,ie]=a.useState(ae()),[w,C]=a.useState(M),[j,$]=a.useState(g),[B,re]=a.useState(!1),[q,le]=a.useState(!1),[X,ce]=a.useState(!1),[Y,oe]=a.useState(!1),[de,Cs]=a.useState(!1),[we,I]=a.useState(!1),[Ce,F]=a.useState(!1),[Se,P]=a.useState(!1),[L,xe]=a.useState(""),[f,Ae]=a.useState(null),[v,me]=a.useState(!1),[Q,he]=a.useState(!1),[W,ue]=a.useState(""),[V,be]=a.useState(""),J=a.useRef(!1),K=a.useRef(ae());a.useEffect(()=>{if(!m){J.current=!1;return}if(J.current)return;J.current=!0;const s=R?JSON.parse(JSON.stringify(R)):ae();K.current=s,h({uid:r?.uid,name:r?.name||"",email:r?.email||"",phone:r?.phone||"",photo:r?.photo||"",avatarLayers:r?.avatarLayers,role:r?.role,gender:r?.gender,lrn:r?.lrn||"",grade:r?.grade||"",section:r?.section||"",school:r?.school||"",department:r?.department||"",subject:r?.subject||"",yearsOfExperience:r?.yearsOfExperience||"",qualification:r?.qualification||"",position:r?.position||""}),ie(s),C(M),$(g)},[m,r,R,M,g]),a.useEffect(()=>{m&&k?.(i)},[m,i,k]),a.useEffect(()=>{if(!m)return;const s=t=>{t.key==="Escape"&&(k?.(K.current),y())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[m,y,k]);const Z=a.useMemo(()=>{const s=[{id:"account",label:"Account",icon:Oe},{id:"notifications",label:"Notifications",icon:ge},{id:"appearance",label:"Appearance",icon:js}];return o==="student"&&(s.push({id:"privacy",label:"Privacy & Security",icon:He}),s.push({id:"learning",label:"Learning",icon:Ge})),o==="teacher"&&s.push({id:"teaching",label:"Teaching",icon:Ue}),o==="admin"&&s.push({id:"system",label:"System",icon:vs}),s.push({id:"data",label:"Data & Storage",icon:ve}),s},[o]),c=s=>{ie(t=>s(t))},ee=s=>{Ae(s),xe(""),he(!1),s==="password"&&ue(""),s==="email"&&be(l.email||""),P(!0)},fe=async()=>{if(!L.trim()){d.error("Current password is required");return}me(!0);try{if(f==="password"){if(W.length<8){d.error("New password must be at least 8 characters");return}await Ke(L,W),d.success("Password updated")}else if(f==="email"){if(!V.includes("@")){d.error("Enter a valid email");return}await Ze(L,V),h(s=>({...s,email:V})),d.success("Email updated")}else if(f==="delete"){await es(L,l.uid||""),d.success("Account deleted"),y();return}P(!1)}catch(s){d.error(s instanceof Error?s.message:"Authentication failed")}finally{me(!1)}},Ee=async()=>{const s=Je({name:l.name,phone:l.phone});if(s){d.error(s);return}re(!0);try{z&&await z(l),_&&await _(i),o==="teacher"&&await u(w),o==="admin"&&await ke(j),y()}catch(t){d.error(t instanceof Error?t.message:"Failed to save settings")}finally{re(!1)}},se=()=>{P(!1),I(!1),F(!1),k?.(K.current),y()},Pe=async()=>{if(!(!T||X)){ce(!0);try{await T()}catch(s){d.error(s instanceof Error?s.message:"Failed to export data")}finally{ce(!1)}}},ze=async()=>{if(!(!D||Y)){oe(!0);try{await D()}catch(s){d.error(s instanceof Error?s.message:"Failed to clear cache")}finally{oe(!1)}}},Re=async()=>{if(!(!E||q)){I(!1),le(!0);try{await E(),d.success("Testing data reset completed")}catch(s){d.error(s instanceof Error?s.message:"Failed to reset testing data")}finally{le(!1)}}},_e=()=>{F(!1),ee("delete")};return m?e.jsx($e,{children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-end sm:items-center justify-center sm:p-4",children:[e.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:se,className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),e.jsxs(H.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"relative bg-[#f7f9fc] rounded-t-2xl sm:rounded-2xl shadow-2xl border border-[#dde3eb] w-full sm:max-w-4xl h-[92vh] sm:max-h-[85vh] overflow-hidden flex flex-col sm:flex-row",children:[e.jsxs("div",{className:"hidden sm:flex w-64 flex-shrink-0 bg-slate-50 border-r border-slate-200 flex-col p-6 overflow-y-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-display font-bold text-[#0a1628]",children:"Settings"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1 font-body",children:"Manage your preferences"})]}),e.jsx("nav",{className:"space-y-1",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-left transition-all ${b===s.id?"bg-sky-50 text-sky-700 shadow-sm":"text-slate-500 hover:bg-slate-100 hover:text-sky-700"}`,children:[e.jsx(t,{size:18}),e.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id)})})]}),e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsx("div",{className:"sm:hidden flex items-center border-b border-[#dde3eb] bg-slate-50 overflow-x-auto no-scrollbar px-2",children:Z.map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>ne(s.id),className:`flex flex-col items-center gap-0.5 px-3 py-2.5 shrink-0 text-xs font-medium border-b-2 transition-colors ${b===s.id?"border-sky-600 text-sky-700":"border-transparent text-slate-500"}`,children:[e.jsx(t,{size:16}),e.jsx("span",{className:"whitespace-nowrap",children:s.label})]},s.id)})}),e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-[#dde3eb]",children:[e.jsx("h3",{className:"text-base sm:text-lg font-display font-bold text-[#0a1628]",children:Z.find(s=>s.id===b)?.label}),e.jsx("button",{onClick:se,className:"p-2 hover:bg-[#edf1f7] rounded-xl transition-colors",children:e.jsx(Ne,{size:20,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:[b==="account"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx(is,{uid:l.uid,photoURL:l.photo,displayName:l.name,onUploaded:s=>h(t=>({...t,photo:s}))}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Full Name"}),e.jsx(n,{type:"text",value:l.name||"",onChange:s=>h(t=>({...t,name:s.target.value})),maxLength:100,autoComplete:"name",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Email Address"}),e.jsxs("div",{className:"flex items-center gap-2 max-w-md",children:[e.jsx(n,{type:"email",value:l.email||"",disabled:!0,className:"flex-1 bg-slate-100"}),e.jsx(p,{variant:"outline",size:"sm",onClick:()=>ee("email"),children:"Change"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Phone Number"}),e.jsx(n,{type:"tel",value:l.phone||"",onChange:s=>h(t=>({...t,phone:s.target.value})),maxLength:20,inputMode:"tel",autoComplete:"tel",pattern:"^\\+?[0-9 ()\\-.]{7,20}$",placeholder:"+63 912 345 6789",className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Gender"}),e.jsxs(ss,{value:l.gender||"",onValueChange:s=>h(t=>({...t,gender:s})),children:[e.jsx(ts,{className:"max-w-md bg-white border-[#dde3eb] rounded-lg",children:e.jsx(as,{placeholder:"Select gender (optional)"})}),e.jsxs(ns,{children:[e.jsx(te,{value:"male",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rs,{className:"size-4 text-blue-500"}),e.jsx("span",{children:"Male"})]})}),e.jsx(te,{value:"female",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ls,{className:"size-4 text-pink-500"}),e.jsx("span",{children:"Female"})]})}),e.jsx(te,{value:"prefer_not_to_say",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cs,{className:"size-4 text-gray-500"}),e.jsx("span",{children:"Prefer not to say"})]})})]})]})]}),o==="student"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"LRN"}),e.jsx(n,{value:l.lrn||"",onChange:s=>h(t=>({...t,lrn:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Grade Level"}),e.jsx(n,{value:l.grade||"",onChange:s=>h(t=>({...t,grade:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Section"}),e.jsx(n,{value:l.section||"",onChange:s=>h(t=>({...t,section:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"School"}),e.jsx(n,{value:l.school||"",onChange:s=>h(t=>({...t,school:s.target.value})),className:"max-w-md"})]})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Department"}),e.jsx(n,{value:l.department||"",onChange:s=>h(t=>({...t,department:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Subject"}),e.jsx(n,{value:l.subject||"",onChange:s=>h(t=>({...t,subject:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Years of Experience"}),e.jsx(n,{value:l.yearsOfExperience||"",onChange:s=>h(t=>({...t,yearsOfExperience:s.target.value})),className:"max-w-md"})]})]}),o==="admin"&&e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Position"}),e.jsx(n,{value:l.position||"",onChange:s=>h(t=>({...t,position:s.target.value})),className:"max-w-md"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Change Password"}),e.jsxs(p,{variant:"outline",className:"rounded-xl",onClick:()=>ee("password"),children:[e.jsx(Be,{size:16,className:"mr-2"}),"Update Password"]})]})]}),b==="notifications"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Push Notifications"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Get notified on your device"})]}),e.jsx(x,{checked:i.notifications.pushNotifications,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,pushNotifications:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Sound Effects"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Play sounds for notifications"})]}),e.jsx(x,{checked:i.notifications.soundEnabled,onCheckedChange:s=>c(t=>({...t,notifications:{...t.notifications,soundEnabled:s}}))})]}),o==="teacher"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Submissions"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify when students submit work"})]}),e.jsx(x,{checked:w.notifyOnSubmission,onCheckedChange:s=>C(t=>({...t,notifyOnSubmission:s}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Activity Alerts"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Notify on at-risk student activity"})]}),e.jsx(x,{checked:w.notifyOnStudentActivity,onCheckedChange:s=>C(t=>({...t,notifyOnStudentActivity:s}))})]})]}),e.jsxs("div",{className:"pt-4",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-3 font-body",children:"Notification Types"}),e.jsx("div",{className:"space-y-3",children:[{key:"quizReminders",label:"Quiz Reminders"},{key:"newContent",label:"New Content"},{key:"achievements",label:"Achievements"},{key:"streakAlerts",label:"Streak Alerts"},{key:"weeklySummary",label:"Weekly Summary"}].map(s=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:i.notifications.notificationTypes[s.key],onChange:t=>c(N=>({...N,notifications:{...N.notifications,notificationTypes:{...N.notifications.notificationTypes,[s.key]:t.target.checked}}})),className:"w-4 h-4 rounded border-[#dde3eb] text-sky-600 focus:ring-sky-500"}),e.jsx("span",{className:"text-sm text-[#0a1628] font-body",children:s.label})]},s.key))})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Push Notification Categories"}),e.jsx("p",{className:"text-xs text-slate-500 mb-3",children:"Choose which kinds of pushes you want to receive on this device."}),e.jsxs("div",{className:"flex items-center justify-between py-2 mb-2 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h5",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Enable Push (master)"}),e.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:"Turn off to silence ALL push categories."})]}),e.jsx(x,{checked:i.pushPreferences.pushEnabled,onCheckedChange:s=>c(t=>({...t,pushPreferences:{...t.pushPreferences,pushEnabled:s}}))})]}),e.jsx("div",{className:"space-y-2",children:[{key:"achievement",label:"Achievements unlocked",icon:Xe},{key:"quiz_battle",label:"Quiz battle invites & results",icon:Ye},{key:"daily_reward",label:"Daily reward reminders",icon:os},{key:"assignment",label:"New assignments / deadlines",icon:ps},{key:"streak_reminder",label:"Streak reminders",icon:Qe},{key:"leaderboard",label:"Leaderboard updates",icon:ds},{key:"system",label:"System announcements",icon:xs}].map(s=>{const t=s.key,N=s.icon;return e.jsxs("label",{className:"flex items-center justify-between py-1.5",children:[e.jsxs("span",{className:"text-sm text-[#0a1628] font-body flex items-center gap-2",children:[e.jsx(N,{className:"h-4 w-4 text-[#6c47ff]"}),s.label]}),e.jsx(x,{checked:!!i.pushPreferences[t],onCheckedChange:pe=>c(O=>({...O,pushPreferences:{...O.pushPreferences,[s.key]:pe}})),disabled:!i.pushPreferences.pushEnabled&&t!=="pushEnabled"})]},s.key)})}),e.jsx("div",{className:"mt-4",children:e.jsxs(p,{type:"button",variant:"outline",size:"sm",onClick:async()=>{try{const{requestPushPermissionAndRegister:s}=await G(async()=>{const{requestPushPermissionAndRegister:S}=await import("./index-Bp7MiGcW.js").then(A=>A.b9);return{requestPushPermissionAndRegister:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),{auth:t}=await G(async()=>{const{auth:S}=await import("./index-Bp7MiGcW.js").then(A=>A.b7);return{auth:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),N=t.currentUser?.uid;if(!N){d.error("You must be signed in to test push notifications.");return}if(!await s(N)){d.error("Push setup failed. Check that VITE_FIREBASE_VAPID_KEY is configured and notifications are allowed.");return}const{httpsCallable:O}=await G(async()=>{const{httpsCallable:S}=await import("./vendor-firebase-core-D7GXCeNu.js").then(A=>A.a9);return{httpsCallable:S}},[]),{cloudFunctions:Te}=await G(async()=>{const{cloudFunctions:S}=await import("./index-Bp7MiGcW.js").then(A=>A.b7);return{cloudFunctions:S}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),ye=(await O(Te,"sendTestPush")({}))?.data?.sent??0;ye>0?d.success(`Sent test push to ${ye} device(s).`):d.message("No active devices found. Enable browser notifications first.")}catch(s){d.error(s instanceof Error?s.message:"Failed to send test push")}},children:[e.jsx(ge,{size:14,className:"mr-2"}),"Send test push"]})})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(ms,{size:16,className:"inline mr-2"}),"Quiet Hours"]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(n,{type:"time",value:i.notifications.quietHours.start,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,start:s.target.value}}})),className:"w-32"}),e.jsx("span",{className:"text-[#5a6578]",children:"to"}),e.jsx(n,{type:"time",value:i.notifications.quietHours.end,onChange:s=>c(t=>({...t,notifications:{...t.notifications,quietHours:{...t.notifications.quietHours,end:s.target.value}}})),className:"w-32"})]})]})]}),b==="appearance"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Dark Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Toggle dark theme"})]}),e.jsx(x,{checked:i.appearance.darkMode,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,darkMode:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-3 block font-body uppercase tracking-wider text-xs",children:"Font Size"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs text-slate-500",children:"Small"}),e.jsx("input",{type:"range",min:"12",max:"20",value:i.appearance.fontSize,onChange:s=>c(t=>({...t,appearance:{...t.appearance,fontSize:Number(s.target.value)}})),className:"flex-1"}),e.jsx("span",{className:"text-xs text-slate-500",children:"Large"}),e.jsxs("span",{className:"text-xs font-mono text-slate-600 w-8",children:[i.appearance.fontSize,"px"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Compact View"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show more content on screen"})]}),e.jsx(x,{checked:i.appearance.compactView,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,compactView:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Reduce Animations"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Minimize motion effects"})]}),e.jsx(x,{checked:i.appearance.reduceAnimations,onCheckedChange:s=>c(t=>({...t,appearance:{...t.appearance,reduceAnimations:s}}))})]})]}),b==="privacy"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Profile Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Who can see your profile"})]}),e.jsxs("select",{value:i.privacy.profileVisibility,onChange:s=>c(t=>({...t,privacy:{...t.privacy,profileVisibility:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm bg-white text-[#0a1628]",children:[e.jsx("option",{value:"everyone",children:"Everyone"}),e.jsx("option",{value:"students_and_staff",children:"Students and Staff"}),e.jsx("option",{value:"private",children:"Private"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Activity Status"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let others see when you're online"})]}),e.jsx(x,{checked:i.privacy.showActivityStatus,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,showActivityStatus:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Data Sharing"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Share anonymous usage data"})]}),e.jsx(x,{checked:i.privacy.dataSharing,onCheckedChange:s=>c(t=>({...t,privacy:{...t.privacy,dataSharing:s}}))})]})]}),b==="learning"&&o==="student"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Daily XP Goal"}),e.jsx(n,{type:"number",value:i.learning.dailyXpGoal,onChange:s=>c(t=>({...t,learning:{...t.learning,dailyXpGoal:Number(s.target.value||0)}})),className:"max-w-xs"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Preferred Study Time"}),e.jsxs("select",{value:i.learning.preferredStudyTime,onChange:s=>c(t=>({...t,learning:{...t.learning,preferredStudyTime:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"morning",children:"Morning (6AM - 12PM)"}),e.jsx("option",{value:"afternoon",children:"Afternoon (12PM - 6PM)"}),e.jsx("option",{value:"evening",children:"Evening (6PM - 12PM)"}),e.jsx("option",{value:"night",children:"Night (12AM - 6AM)"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Auto-play Next Lesson"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Automatically start the next lesson"})]}),e.jsx(x,{checked:i.learning.autoPlayLessons,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,autoPlayLessons:s}}))})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Show Hints During Quizzes"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Display helpful hints for questions"})]}),e.jsx(x,{checked:i.learning.showHints,onCheckedChange:s=>c(t=>({...t,learning:{...t.learning,showHints:s}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:"Quiz Difficulty Preference"}),e.jsxs("select",{value:i.learning.quizDifficultyPreference,onChange:s=>c(t=>({...t,learning:{...t.learning,quizDifficultyPreference:s.target.value}})),className:"px-3 py-2 border border-[#dde3eb] rounded-lg text-sm w-full max-w-xs bg-white text-[#0a1628]",children:[e.jsx("option",{value:"adaptive",children:"Adaptive (Recommended)"}),e.jsx("option",{value:"easy",children:"Easy"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"hard",children:"Hard"})]})]}),e.jsxs("div",{className:"pt-4 border-t border-[#dde3eb]",children:[e.jsxs("label",{className:"text-sm font-bold text-[#5a6578] mb-2 block font-body uppercase tracking-wider text-xs",children:[e.jsx(ks,{size:16,className:"inline mr-2"}),"Study Reminders"]}),e.jsx(n,{type:"time",value:i.learning.studyReminderTime,onChange:s=>c(t=>({...t,learning:{...t.learning,studyReminderTime:s.target.value}})),className:"w-32"})]})]}),b==="teaching"&&o==="teacher"&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Quiz Defaults"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Time Limit (min)"}),e.jsx(n,{type:"number",value:w.quizDefaults.timeLimitMinutes,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,timeLimitMinutes:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Passing Score (%)"}),e.jsx(n,{type:"number",value:w.quizDefaults.passingScore,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,passingScore:Number(s.target.value)}}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Attempts"}),e.jsx(n,{type:"number",value:w.quizDefaults.maxAttempts,onChange:s=>C(t=>({...t,quizDefaults:{...t.quizDefaults,maxAttempts:Number(s.target.value)}}))})]})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"Class Preferences"}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-t border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Student Analytics Visibility"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Let students see their leaderboard rank"})]}),e.jsx(x,{checked:w.studentAnalyticsVisibility,onCheckedChange:s=>C(t=>({...t,studentAnalyticsVisibility:s}))})]})]}),b==="system"&&o==="admin"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Maintenance Mode"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Disable platform access for non-admins"})]}),e.jsx(x,{checked:j.maintenanceMode,onCheckedChange:s=>$(t=>({...t,maintenanceMode:s}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Grade Level"}),e.jsx(n,{value:j.defaultGradeLevel,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Default Curriculum"}),e.jsx(n,{value:j.defaultCurriculum,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Max Class Size"}),e.jsx(n,{type:"number",value:j.maxClassSize,disabled:!0})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-[#dde3eb]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body",children:"Audit Log Visible"}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Show audit logs in admin dashboard"})]}),e.jsx(x,{checked:j.auditLogVisible,onCheckedChange:s=>$(t=>({...t,auditLogVisible:s}))})]}),e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] font-body pt-4",children:"AI Configuration"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Model Name"}),e.jsx(n,{value:j.aiConfig.modelName,disabled:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"Temperature"}),e.jsx(n,{type:"number",value:j.aiConfig.temperature,disabled:!0})]}),e.jsxs("div",{className:"col-span-2",children:[e.jsx("label",{className:"text-xs text-[#5a6578] block mb-1",children:"API Endpoint"}),e.jsx(n,{value:j.aiConfig.endpoint,disabled:!0})]})]})]}),b==="data"&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-4 bg-sky-50 border border-sky-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-sky-900 mb-1 font-body",children:"Download Your Data"}),e.jsx("p",{className:"text-xs text-sky-700 mb-3",children:"Export all your learning data and progress"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:Pe,disabled:X,children:[e.jsx(ve,{size:16,className:"mr-2"}),X?"Exporting...":"Request Data Export"]})]}),e.jsxs("div",{className:"p-4 bg-white border border-[#dde3eb] rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-[#0a1628] mb-1 font-body",children:"Clear Cache"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-3",children:"Free up space by clearing cached data"}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl",onClick:ze,disabled:Y,children:Y?"Clearing...":"Clear Cache"})]}),e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-rose-900 mb-1",children:"Reset Progress"}),e.jsxs("p",{className:"text-xs text-rose-700 mb-3",children:[o==="student"&&"Reset quizzes, diagnostic state, XP, and learning progress for retesting.",o==="teacher"&&"Reset imported records, managed classrooms, and teacher-generated quiz artifacts.",o==="admin"&&"Reset admin testing artifacts like personal audit/content update records."]}),e.jsx(p,{variant:"outline",size:"sm",className:"rounded-xl text-rose-700 border-rose-300",disabled:!E||q,onClick:()=>I(!0),children:q?"Resetting...":"Reset Testing Data"})]}),e.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:[e.jsx("h4",{className:"text-sm font-bold text-red-900 mb-1",children:"Delete Account"}),e.jsx("p",{className:"text-xs text-red-700 mb-3",children:"Permanently delete your account and all data"}),e.jsxs(p,{variant:"outline",size:"sm",className:"rounded-xl text-red-700 border-red-300",onClick:()=>F(!0),disabled:de,children:[e.jsx(hs,{size:16,className:"mr-2"}),de?"Deleting...":"Delete Account"]})]})]})]}),e.jsxs("div",{className:"shrink-0 px-4 sm:px-6 py-3 sm:py-4 border-t border-[#dde3eb] bg-[#edf1f7] flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 sm:gap-0",children:[e.jsx("p",{className:"text-xs text-slate-500 font-body text-center sm:text-left",children:"MathPulse AI v2.1.0"}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(p,{variant:"outline",onClick:se,className:"rounded-lg border-[#dde3eb] flex-1 sm:flex-none",disabled:B,children:"Cancel"}),e.jsx(p,{onClick:Ee,className:"rounded-lg bg-sky-600 hover:bg-sky-700 text-white flex-1 sm:flex-none",disabled:B,children:B?"Saving...":"Save Changes"})]})]})]})]})]}),Se&&e.jsx(H.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[130] bg-black/50 backdrop-blur-sm flex items-center justify-center p-4",onClick:()=>{v||P(!1)},children:e.jsxs(H.div,{initial:{opacity:0,scale:.95,y:12},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:12},transition:{duration:.2},className:"w-full max-w-md rounded-2xl border border-[#dde3eb] bg-[#f7f9fc] shadow-2xl",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[#dde3eb] px-6 py-4",children:[e.jsxs("h4",{className:"text-lg font-display font-bold text-[#0a1628]",children:[f==="password"&&"Change Password",f==="email"&&"Change Email",f==="delete"&&"Delete Account"]}),e.jsx("button",{onClick:()=>{v||P(!1)},className:"p-2 rounded-xl hover:bg-[#edf1f7] transition-colors","aria-label":"Close",children:e.jsx(Ne,{size:18,className:"text-[#5a6578]"})})]}),e.jsxs("div",{className:"px-6 py-5 space-y-4",children:[e.jsx("p",{className:"text-sm text-[#5a6578]",children:"Enter your current password to continue."}),e.jsxs("div",{className:"relative",children:[e.jsx(n,{type:Q?"text":"password",value:L,onChange:s=>xe(s.target.value),placeholder:"Current password",autoFocus:!0,className:"pr-10",disabled:v,onKeyDown:s=>{s.key==="Enter"&&fe()}}),e.jsx("button",{type:"button",onClick:()=>he(!Q),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:Q?e.jsx(us,{size:16}):e.jsx(bs,{size:16})})]}),f==="password"&&e.jsx("div",{className:"relative",children:e.jsx(n,{type:"password",value:W,onChange:s=>ue(s.target.value),placeholder:"New password (min 8 chars)",disabled:v})}),f==="email"&&e.jsx(n,{type:"email",value:V,onChange:s=>be(s.target.value),placeholder:"New email address",disabled:v}),f==="delete"&&e.jsx("p",{className:"text-sm text-red-600 font-medium",children:"This action is permanent and cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(p,{variant:"outline",onClick:()=>P(!1),disabled:v,children:"Cancel"}),e.jsx(p,{onClick:()=>void fe(),className:f==="delete"?"bg-red-600 hover:bg-red-700 text-white":"bg-sky-600 hover:bg-sky-700 text-white",disabled:v,children:v?"Processing...":f==="delete"?"Delete Forever":"Confirm"})]})]})]})}),e.jsx(je,{isOpen:we,onClose:()=>I(!1),onConfirm:Re,title:"Reset Testing Data?",message:`Reset ${o} testing data? This will clear quizzes, diagnostic assessments, assessment history, XP, and learning progress. This action cannot be undone.`,confirmText:q?"Resetting...":"Reset Data",cancelText:"Cancel",type:"warning",icon:"warning",zIndexClass:"z-[130]"}),e.jsx(je,{isOpen:Ce,onClose:()=>F(!1),onConfirm:_e,title:"Delete Account?",message:"You will need to re-authenticate to permanently delete your account. This cannot be undone.",confirmText:"Continue",cancelText:"Cancel",type:"danger",icon:"delete",zIndexClass:"z-[130]"})]})}):null};export{rt as default};
|
assets/{Sidebar-bryEim00.js β Sidebar-BzRsh0CN.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as x,j as e}from"./vendor-react-B4AQeu28.js";import{S as $,a as B,L as u,D,M as G}from"./LogoutActionButton-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{r as x,j as e}from"./vendor-react-B4AQeu28.js";import{S as $,a as B,L as u,D,M as G}from"./LogoutActionButton-BlHbD8Uf.js";import{e as z,m as c,o as P,U as M,G as N,b as m,V as q,a2 as F,F as U}from"./index-Bp7MiGcW.js";import{T as S,a as L,b as C}from"./tooltip-nLNeX3nd.js";import{X as Q}from"./x-k8d6VLEw.js";import{C as V}from"./chevron-right-BxoysOas.js";import{C as W}from"./chevron-left-Be5knpOV.js";import{C as A}from"./chart-column-Dyv8TfXk.js";import{S as R}from"./shirt-C1GQiNvP.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{SupplementalBanner-BtyN_3ih.js β SupplementalBanner-BiW4WQHX.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as e,r as y}from"./vendor-react-B4AQeu28.js";import{h as j,m as p,y as h,b as f,T as m,B as x}from"./index-
|
|
|
|
| 1 |
+
import{j as e,r as y}from"./vendor-react-B4AQeu28.js";import{h as j,m as p,y as h,b as f,T as m,B as x}from"./index-Bp7MiGcW.js";import{X as v}from"./x-k8d6VLEw.js";import{S as w}from"./sparkles-fLB3ltj1.js";import{C as g}from"./chevron-right-BxoysOas.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const b={"General Mathematics":[{label:"Functions Deep Dive",description:"Interactive review of function types and graphs",icon:e.jsx(m,{size:14})},{label:"Business Math Basics",description:"Simple & compound interest practice",icon:e.jsx(f,{size:14})}],"Statistics and Probability":[{label:"Distribution Visualizer",description:"Explore normal distribution curves",icon:e.jsx(m,{size:14})},{label:"Hypothesis Practice",description:"Step-by-step hypothesis testing",icon:e.jsx(x,{size:14})}],"Pre-Calculus":[{label:"Conic Sections Explorer",description:"Visual parabola, ellipse, hyperbola tool",icon:e.jsx(m,{size:14})},{label:"Trig Identity Practice",description:"Identity verification drill set",icon:e.jsx(x,{size:14})}],"Basic Calculus":[{label:"Limits Visualizer",description:"Graphical approach to limits",icon:e.jsx(m,{size:14})},{label:"Derivative Rules Drill",description:"Practice chain rule & implicit diff",icon:e.jsx(x,{size:14})}]};function u(i){const s=i.toLowerCase();return s==="functions"||s.includes("function")||s==="businessmath"||s.includes("business")||s==="logic"||s.includes("reason")||s.includes("general")||s.includes("gen-math")||s.includes("gen math")?"General Mathematics":s.includes("stat")||s.includes("prob")?"Statistics and Probability":s.includes("pre-calc")||s.includes("pre calc")||s.includes("precalc")?"Pre-Calculus":s.includes("basic")||s.includes("calc")?"Basic Calculus":null}function N(i){const s=i.trim().toLowerCase();return s==="functions"?"Functions and Graphs":s==="businessmath"?"Business and Financial Mathematics":s==="logic"?"Logic and Reasoning":i}const k=({atRiskSubjects:i=[],onAction:s,onDismiss:n})=>{const[l,a]=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(g,{size:16})]})]})]})]})})})},z=({quizSubject:i,atRiskSubjects:s=[]})=>{const n=i?u(i):null;if(!s.some(r=>{const t=u(r);return t&&t===n})||!n)return null;const a=b[n]||[];return e.jsx(p.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"mb-4 overflow-hidden",children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-50 to-orange-50 border border-rose-200 rounded-xl p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(h,{size:14,className:"text-rose-600"}),e.jsxs("span",{className:"text-xs font-bold text-rose-800",children:["Supplemental Focus Area β ",n]})]}),e.jsx("p",{className:"text-xs text-rose-700 mb-2",children:"This topic was flagged in your diagnostic. Take your time and review the explanations carefully."}),a.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.slice(0,2).map((r,t)=>e.jsxs("span",{className:"inline-flex items-center gap-1 bg-rose-100 text-rose-700 px-2 py-0.5 rounded-md text-xs font-medium",children:[r.icon,r.label]},t))})]})})},C=({quizSubject:i,quizScore:s=0,atRiskSubjects:n=[],onAction:l})=>{const a=i?u(i):null,r=n.some(c=>{const d=u(c);return d&&d===a});if(s>=70&&!r)return null;const t=a?b[a]||[]:[],o=s<70;return e.jsx(p.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.5},className:"mt-4",children:e.jsx("div",{className:`rounded-2xl p-4 border-2 ${o?"bg-orange-50 border-orange-200":"bg-sky-50 border-sky-200"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${o?"bg-orange-500":"bg-sky-500"}`,children:e.jsx(f,{size:20,className:"text-white"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-display font-bold text-[#0a1628] text-sm mb-1",children:o?"Review Recommended":"Supplemental Materials"}),e.jsx("p",{className:"text-xs text-[#5a6578] mb-2",children:o?`You scored ${s}% on this quiz. We recommend reviewing the following resources to strengthen your understanding.`:"This topic was identified as an area for growth. Check out these additional resources."}),t.length>0&&e.jsx("div",{className:"space-y-1.5 mb-3",children:t.map((c,d)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center ${o?"bg-orange-100 text-orange-600":"bg-sky-100 text-sky-600"}`,children:c.icon}),e.jsx("span",{className:"font-medium text-[#0a1628]",children:c.label}),e.jsxs("span",{className:"text-slate-500",children:["β ",c.description]})]},d))}),l&&e.jsxs("button",{onClick:l,className:`inline-flex items-center gap-1.5 text-xs font-bold px-3 py-1.5 rounded-lg transition-colors ${o?"bg-orange-500 hover:bg-orange-600 text-white":"bg-sky-500 hover:bg-sky-600 text-white"}`,children:["Review Topics",e.jsx(g,{size:12})]})]})]})})})},I=i=>{switch(i.variant){case"compact":return e.jsx(z,{...i});case"results":return e.jsx(C,{...i});case"full":default:return e.jsx(k,{...i})}};export{I as default};
|
assets/{SupplementalPillCarousel-0O59RLiu.js β SupplementalPillCarousel-BpO68D9M.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{d as o,r as U,j as r}from"./vendor-react-B4AQeu28.js";import{o as se,h as Qe,m as Ie,y as Se,a as jt,L as Ze,I as et}from"./index-
|
| 2 |
[data-state=closed]
|
| 3 |
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Wt(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function Vt(){return Pe(/^Mac/)}function Yt(){return Pe(/^iPhone/)}function Ye(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Xt(){return Pe(/^iPad/)||Vt()&&navigator.maxTouchPoints>1}function at(){return Yt()||Xt()}function Pe(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Kt=24,Jt=typeof window<"u"?U.useLayoutEffect:U.useEffect;function Xe(...e){return(...n)=>{for(let t of e)typeof t=="function"&&t(...n)}}const je=typeof document<"u"&&window.visualViewport;function Ke(e){let n=window.getComputedStyle(e);return/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY)}function ot(e){for(Ke(e)&&(e=e.parentElement);e&&!Ke(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Qt=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let be=0,De;function Zt(e={}){let{isDisabled:n}=e;Jt(()=>{if(!n)return be++,be===1&&at()&&(De=en()),()=>{be--,be===0&&De?.()}},[n])}function en(){let e,n=0,t=m=>{e=ot(m.target),!(e===document.documentElement&&e===document.body)&&(n=m.changedTouches[0].pageY)},i=m=>{if(!e||e===document.documentElement||e===document.body){m.preventDefault();return}let c=m.changedTouches[0].pageY,$=e.scrollTop,I=e.scrollHeight-e.clientHeight;I!==0&&(($<=0&&c>n||$>=I&&c<n)&&m.preventDefault(),n=c)},s=m=>{let c=m.target;Ae(c)&&c!==document.activeElement&&(m.preventDefault(),c.style.transform="translateY(-2000px)",c.focus(),requestAnimationFrame(()=>{c.style.transform=""}))},a=m=>{let c=m.target;Ae(c)&&(c.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{c.style.transform="",je&&(je.height<window.innerHeight?requestAnimationFrame(()=>{Je(c)}):je.addEventListener("resize",()=>Je(c),{once:!0}))}))},h=()=>{window.scrollTo(0,0)},w=window.pageXOffset,y=window.pageYOffset,S=Xe(tn(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let v=Xe(me(document,"touchstart",t,{passive:!1,capture:!0}),me(document,"touchmove",i,{passive:!1,capture:!0}),me(document,"touchend",s,{passive:!1,capture:!0}),me(document,"focus",a,!0),me(window,"scroll",h));return()=>{S(),v(),window.scrollTo(w,y)}}function tn(e,n,t){let i=e.style[n];return e.style[n]=t,()=>{e.style[n]=i}}function me(e,n,t,i){return e.addEventListener(n,t,i),()=>{e.removeEventListener(n,t,i)}}function Je(e){let n=document.scrollingElement||document.documentElement;for(;e&&e!==n;){let t=ot(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let i=t.getBoundingClientRect().top,s=e.getBoundingClientRect().top,a=e.getBoundingClientRect().bottom;const h=t.getBoundingClientRect().bottom+Kt;a>h&&(t.scrollTop+=s-i)}e=t.parentElement}}function Ae(e){return e instanceof HTMLInputElement&&!Qt.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function nn(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function rn(...e){return n=>e.forEach(t=>nn(t,n))}function it(...e){return U.useCallback(rn(...e),e)}const st=new WeakMap;function L(e,n,t=!1){if(!e||!(e instanceof HTMLElement))return;let i={};Object.entries(n).forEach(([s,a])=>{if(s.startsWith("--")){e.style.setProperty(s,a);return}i[s]=e.style[s],e.style[s]=a}),!t&&st.set(e,i)}function an(e,n){if(!e||!(e instanceof HTMLElement))return;let t=st.get(e);t&&(e.style[n]=t[n])}const P=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function xe(e,n){if(!e)return null;const t=window.getComputedStyle(e),i=t.transform||t.webkitTransform||t.mozTransform;let s=i.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[P(n)?13:12]):(s=i.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[P(n)?5:4]):null)}function on(e){return 8*(Math.log(e+1)-2)}function Ne(e,n){if(!e)return()=>{};const t=e.style.cssText;return Object.assign(e.style,n),()=>{e.style.cssText=t}}function sn(...e){return(...n)=>{for(const t of e)typeof t=="function"&&t(...n)}}const D={DURATION:.5,EASE:[.32,.72,0,1]},lt=.4,ln=.25,cn=100,ct=8,ne=16,_e=26,Oe="vaul-dragging";function ut(e){const n=o.useRef(e);return o.useEffect(()=>{n.current=e}),o.useMemo(()=>(...t)=>n.current==null?void 0:n.current.call(n,...t),[])}function un({defaultProp:e,onChange:n}){const t=o.useState(e),[i]=t,s=o.useRef(i),a=ut(n);return o.useEffect(()=>{s.current!==i&&(a(i),s.current=i)},[i,s,a]),t}function dt({prop:e,defaultProp:n,onChange:t=()=>{}}){const[i,s]=un({defaultProp:n,onChange:t}),a=e!==void 0,h=a?e:i,w=ut(t),y=o.useCallback(S=>{if(a){const m=typeof S=="function"?S(e):S;m!==e&&w(m)}else s(S)},[a,e,s,w]);return[h,y]}function dn({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:t,drawerRef:i,overlayRef:s,fadeFromIndex:a,onSnapPointChange:h,direction:w="bottom",container:y,snapToSequentialPoint:S}){const[v,m]=dt({prop:e,defaultProp:t?.[0],onChange:n}),[c,$]=o.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);o.useEffect(()=>{function p(){$({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);const I=o.useMemo(()=>v===t?.[t.length-1]||null,[t,v]),M=o.useMemo(()=>{var p;return(p=t?.findIndex(R=>R===v))!=null?p:null},[t,v]),F=t&&t.length>0&&(a||a===0)&&!Number.isNaN(a)&&t[a]===v||!t,f=o.useMemo(()=>{const p=y?{width:y.getBoundingClientRect().width,height:y.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var R;return(R=t?.map(x=>{const G=typeof x=="string";let B=0;if(G&&(B=parseInt(x,10)),P(w)){const u=G?B:c?x*p.height:0;return c?w==="bottom"?p.height-u:-p.height+u:u}const H=G?B:c?x*p.width:0;return c?w==="right"?p.width-H:-p.width+H:H}))!=null?R:[]},[t,c,y]),A=o.useMemo(()=>M!==null?f?.[M]:null,[f,M]),N=o.useCallback(p=>{var R;const x=(R=f?.findIndex(G=>G===p))!=null?R:null;h(x),L(i.current,{transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,transform:P(w)?`translate3d(0, ${p}px, 0)`:`translate3d(${p}px, 0, 0)`}),f&&x!==f.length-1&&a!==void 0&&x!==a&&x<a?L(s.current,{transition:`opacity ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,opacity:"0"}):L(s.current,{transition:`opacity ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,opacity:"1"}),m(t?.[Math.max(x,0)])},[i.current,t,f,a,s,m]);o.useEffect(()=>{if(v||e){var p;const R=(p=t?.findIndex(x=>x===e||x===v))!=null?p:-1;f&&R!==-1&&typeof f[R]=="number"&&N(f[R])}},[v,e,t,f,N]);function l({draggedDistance:p,closeDrawer:R,velocity:x,dismissible:G}){if(a===void 0)return;const B=w==="bottom"||w==="right"?(A??0)-p:(A??0)+p,H=M===a-1,u=M===0,b=p>0;if(H&&L(s.current,{transition:`opacity ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`}),!S&&x>2&&!b){G?R():N(f[0]);return}if(!S&&x>2&&b&&f&&t){N(f[t.length-1]);return}const j=f?.reduce((_,W)=>typeof _!="number"||typeof W!="number"?_:Math.abs(W-B)<Math.abs(_-B)?W:_),O=P(w)?window.innerHeight:window.innerWidth;if(x>lt&&Math.abs(p)<O*.4){const _=b?1:-1;if(_>0&&I&&t){N(f[t.length-1]);return}if(u&&_<0&&G&&R(),M===null)return;N(f[M+_]);return}N(j)}function V({draggedDistance:p}){if(A===null)return;const R=w==="bottom"||w==="right"?A-p:A+p;(w==="bottom"||w==="right")&&R<f[f.length-1]||(w==="top"||w==="left")&&R>f[f.length-1]||L(i.current,{transform:P(w)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`})}function X(p,R){if(!t||typeof M!="number"||!f||a===void 0)return null;const x=M===a-1;if(M>=a&&R)return 0;if(x&&!R)return 1;if(!F&&!x)return null;const B=x?M+1:M-1,H=x?f[B]-f[B-1]:f[B+1]-f[B],u=p/Math.abs(H);return x?1-u:u}return{isLastSnapPoint:I,activeSnapPoint:v,shouldFade:F,getPercentageDragged:X,setActiveSnapPoint:m,activeSnapPointIndex:M,onRelease:l,onDrag:V,snapPointsOffset:f}}const fn=()=>()=>{};function mn(){const{direction:e,isOpen:n,shouldScaleBackground:t,setBackgroundColorOnScale:i,noBodyStyles:s}=he(),a=o.useRef(null),h=U.useMemo(()=>document.body.style.backgroundColor,[]);function w(){return(window.innerWidth-_e)/window.innerWidth}o.useEffect(()=>{if(n&&t){a.current&&clearTimeout(a.current);const y=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!y)return;sn(i&&!s?Ne(document.body,{background:"black"}):fn,Ne(y,{transformOrigin:P(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${D.DURATION}s`,transitionTimingFunction:`cubic-bezier(${D.EASE.join(",")})`}));const S=Ne(y,{borderRadius:`${ct}px`,overflow:"hidden",...P(e)?{transform:`scale(${w()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${w()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{S(),a.current=window.setTimeout(()=>{h?document.body.style.background=h:document.body.style.removeProperty("background")},D.DURATION*1e3)}}},[n,t,h])}let pe=null;function pn({isOpen:e,modal:n,nested:t,hasBeenOpened:i,preventScrollRestoration:s,noBodyStyles:a}){const[h,w]=o.useState(()=>typeof window<"u"?window.location.href:""),y=o.useRef(0),S=o.useCallback(()=>{if(Ye()&&pe===null&&e&&!a){pe={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:m,innerHeight:c}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-y.current}px`,left:`${-m}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const $=c-window.innerHeight;$&&y.current>=c&&(document.body.style.top=`${-(y.current+$)}px`)}),300)}},[e]),v=o.useCallback(()=>{if(Ye()&&pe!==null&&!a){const m=-parseInt(document.body.style.top,10),c=-parseInt(document.body.style.left,10);Object.assign(document.body.style,pe),window.requestAnimationFrame(()=>{if(s&&h!==window.location.href){w(window.location.href);return}window.scrollTo(c,m)}),pe=null}},[h]);return o.useEffect(()=>{function m(){y.current=window.scrollY}return m(),window.addEventListener("scroll",m),()=>{window.removeEventListener("scroll",m)}},[]),o.useEffect(()=>{if(n)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||v()}},[n,v]),o.useEffect(()=>{t||!i||(e?(!window.matchMedia("(display-mode: standalone)").matches&&S(),n||window.setTimeout(()=>{v()},500)):v())},[e,i,h,n,t,S,v]),{restorePositionSetting:v}}function hn({open:e,onOpenChange:n,children:t,onDrag:i,onRelease:s,snapPoints:a,shouldScaleBackground:h=!1,setBackgroundColorOnScale:w=!0,closeThreshold:y=ln,scrollLockTimeout:S=cn,dismissible:v=!0,handleOnly:m=!1,fadeFromIndex:c=a&&a.length-1,activeSnapPoint:$,setActiveSnapPoint:I,fixed:M,modal:F=!0,onClose:f,nested:A,noBodyStyles:N=!1,direction:l="bottom",defaultOpen:V=!1,disablePreventScroll:X=!0,snapToSequentialPoint:p=!1,preventScrollRestoration:R=!1,repositionInputs:x=!0,onAnimationEnd:G,container:B,autoFocus:H=!1}){var u,b;const[j=!1,O]=dt({defaultProp:V,prop:e,onChange:d=>{n?.(d),!d&&!A&&xt(),setTimeout(()=>{G?.(d)},D.DURATION*1e3),d&&!F&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),d||(document.body.style.pointerEvents="auto")}}),[_,W]=o.useState(!1),[Q,le]=o.useState(!1),[pt,$e]=o.useState(!1),ae=o.useRef(null),ge=o.useRef(null),Te=o.useRef(null),Re=o.useRef(null),ce=o.useRef(null),ue=o.useRef(!1),Ce=o.useRef(null),Me=o.useRef(0),oe=o.useRef(!1),Le=o.useRef(!V),Be=o.useRef(0),g=o.useRef(null),Fe=o.useRef(((u=g.current)==null?void 0:u.getBoundingClientRect().height)||0),Ge=o.useRef(((b=g.current)==null?void 0:b.getBoundingClientRect().width)||0),Ee=o.useRef(0),ht=o.useCallback(d=>{a&&d===de.length-1&&(ge.current=new Date)},[]),{activeSnapPoint:gt,activeSnapPointIndex:ie,setActiveSnapPoint:He,onRelease:wt,snapPointsOffset:de,onDrag:vt,shouldFade:qe,getPercentageDragged:bt}=dn({snapPoints:a,activeSnapPointProp:$,setActiveSnapPointProp:I,drawerRef:g,fadeFromIndex:c,overlayRef:ae,onSnapPointChange:ht,direction:l,container:B,snapToSequentialPoint:p});Zt({isDisabled:!j||Q||!F||pt||!_||!x||!X});const{restorePositionSetting:xt}=pn({isOpen:j,modal:F,nested:A??!1,hasBeenOpened:_,preventScrollRestoration:R,noBodyStyles:N});function we(){return(window.innerWidth-_e)/window.innerWidth}function yt(d){var C,E;!v&&!a||g.current&&!g.current.contains(d.target)||(Fe.current=((C=g.current)==null?void 0:C.getBoundingClientRect().height)||0,Ge.current=((E=g.current)==null?void 0:E.getBoundingClientRect().width)||0,le(!0),Te.current=new Date,at()&&window.addEventListener("touchend",()=>ue.current=!1,{once:!0}),d.target.setPointerCapture(d.pointerId),Me.current=P(l)?d.pageY:d.pageX)}function ze(d,C){var E;let T=d;const k=(E=window.getSelection())==null?void 0:E.toString(),z=g.current?xe(g.current,l):null,q=new Date;if(T.tagName==="SELECT"||T.hasAttribute("data-vaul-no-drag")||T.closest("[data-vaul-no-drag]"))return!1;if(l==="right"||l==="left")return!0;if(ge.current&&q.getTime()-ge.current.getTime()<500)return!1;if(z!==null&&(l==="bottom"?z>0:z<0))return!0;if(k&&k.length>0)return!1;if(ce.current&&q.getTime()-ce.current.getTime()<S&&z===0||C)return ce.current=q,!1;for(;T;){if(T.scrollHeight>T.clientHeight){if(T.scrollTop!==0)return ce.current=new Date,!1;if(T.getAttribute("role")==="dialog")return!0}T=T.parentNode}return!0}function St(d){if(g.current&&Q){const C=l==="bottom"||l==="right"?1:-1,E=(Me.current-(P(l)?d.pageY:d.pageX))*C,T=E>0,k=a&&!v&&!T;if(k&&ie===0)return;const z=Math.abs(E),q=document.querySelector("[data-vaul-drawer-wrapper]"),Z=l==="bottom"||l==="top"?Fe.current:Ge.current;let Y=z/Z;const te=bt(z,T);if(te!==null&&(Y=te),k&&Y>=1||!ue.current&&!ze(d.target,T))return;if(g.current.classList.add(Oe),ue.current=!0,L(g.current,{transition:"none"}),L(ae.current,{transition:"none"}),a&&vt({draggedDistance:E}),T&&!a){const K=on(E),ve=Math.min(K*-1,0)*C;L(g.current,{transform:P(l)?`translate3d(0, ${ve}px, 0)`:`translate3d(${ve}px, 0, 0)`});return}const ee=1-Y;if((qe||c&&ie===c-1)&&(i?.(d,Y),L(ae.current,{opacity:`${ee}`,transition:"none"},!0)),q&&ae.current&&h){const K=Math.min(we()+Y*(1-we()),1),ve=8-Y*8,We=Math.max(0,14-Y*14);L(q,{borderRadius:`${ve}px`,transform:P(l)?`scale(${K}) translate3d(0, ${We}px, 0)`:`scale(${K}) translate3d(${We}px, 0, 0)`,transition:"none"},!0)}if(!a){const K=z*C;L(g.current,{transform:P(l)?`translate3d(0, ${K}px, 0)`:`translate3d(${K}px, 0, 0)`})}}}o.useEffect(()=>{window.requestAnimationFrame(()=>{Le.current=!0})},[]),o.useEffect(()=>{var d;function C(){if(!g.current||!x)return;const E=document.activeElement;if(Ae(E)||oe.current){var T;const k=((T=window.visualViewport)==null?void 0:T.height)||0,z=window.innerHeight;let q=z-k;const Z=g.current.getBoundingClientRect().height||0,Y=Z>z*.8;Ee.current||(Ee.current=Z);const te=g.current.getBoundingClientRect().top;if(Math.abs(Be.current-q)>60&&(oe.current=!oe.current),a&&a.length>0&&de&&ie){const ee=de[ie]||0;q+=ee}if(Be.current=q,Z>k||oe.current){const ee=g.current.getBoundingClientRect().height;let K=ee;ee>k&&(K=k-(Y?te:_e)),M?g.current.style.height=`${ee-Math.max(q,0)}px`:g.current.style.height=`${Math.max(K,k-te)}px`}else Wt()||(g.current.style.height=`${Ee.current}px`);a&&a.length>0&&!oe.current?g.current.style.bottom="0px":g.current.style.bottom=`${Math.max(q,0)}px`}}return(d=window.visualViewport)==null||d.addEventListener("resize",C),()=>{var E;return(E=window.visualViewport)==null?void 0:E.removeEventListener("resize",C)}},[ie,a,de]);function fe(d){Tt(),f?.(),d||O(!1),setTimeout(()=>{a&&He(a[0])},D.DURATION*1e3)}function Ue(){if(!g.current)return;const d=document.querySelector("[data-vaul-drawer-wrapper]"),C=xe(g.current,l);L(g.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`}),L(ae.current,{transition:`opacity ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,opacity:"1"}),h&&C&&C>0&&j&&L(d,{borderRadius:`${ct}px`,overflow:"hidden",...P(l)?{transform:`scale(${we()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${we()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${D.DURATION}s`,transitionTimingFunction:`cubic-bezier(${D.EASE.join(",")})`},!0)}function Tt(){!Q||!g.current||(g.current.classList.remove(Oe),ue.current=!1,le(!1),Re.current=new Date)}function Rt(d){if(!Q||!g.current)return;g.current.classList.remove(Oe),ue.current=!1,le(!1),Re.current=new Date;const C=xe(g.current,l);if(!d||!ze(d.target,!1)||!C||Number.isNaN(C)||Te.current===null)return;const E=Re.current.getTime()-Te.current.getTime(),T=Me.current-(P(l)?d.pageY:d.pageX),k=Math.abs(T)/E;if(k>.05&&($e(!0),setTimeout(()=>{$e(!1)},200)),a){wt({draggedDistance:T*(l==="bottom"||l==="right"?1:-1),closeDrawer:fe,velocity:k,dismissible:v}),s?.(d,!0);return}if(l==="bottom"||l==="right"?T>0:T<0){Ue(),s?.(d,!0);return}if(k>lt){fe(),s?.(d,!1);return}var z;const q=Math.min((z=g.current.getBoundingClientRect().height)!=null?z:0,window.innerHeight);var Z;const Y=Math.min((Z=g.current.getBoundingClientRect().width)!=null?Z:0,window.innerWidth),te=l==="left"||l==="right";if(Math.abs(C)>=(te?Y:q)*y){fe(),s?.(d,!1);return}s?.(d,!0),Ue()}o.useEffect(()=>(j&&(L(document.documentElement,{scrollBehavior:"auto"}),ge.current=new Date),()=>{an(document.documentElement,"scrollBehavior")}),[j]);function Ct(d){const C=d?(window.innerWidth-ne)/window.innerWidth:1,E=d?-ne:0;Ce.current&&window.clearTimeout(Ce.current),L(g.current,{transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,transform:P(l)?`scale(${C}) translate3d(0, ${E}px, 0)`:`scale(${C}) translate3d(${E}px, 0, 0)`}),!d&&g.current&&(Ce.current=setTimeout(()=>{const T=xe(g.current,l);L(g.current,{transition:"none",transform:P(l)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})},500))}function Mt(d,C){if(C<0)return;const E=(window.innerWidth-ne)/window.innerWidth,T=E+C*(1-E),k=-ne+C*ne;L(g.current,{transform:P(l)?`scale(${T}) translate3d(0, ${k}px, 0)`:`scale(${T}) translate3d(${k}px, 0, 0)`,transition:"none"})}function Et(d,C){const E=P(l)?window.innerHeight:window.innerWidth,T=C?(E-ne)/E:1,k=C?-ne:0;C&&L(g.current,{transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,transform:P(l)?`scale(${T}) translate3d(0, ${k}px, 0)`:`scale(${T}) translate3d(${k}px, 0, 0)`})}return o.useEffect(()=>{F||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[F]),o.createElement(At,{defaultOpen:V,onOpenChange:d=>{!v&&!d||(d?W(!0):fe(!0),O(d))},open:j},o.createElement(rt.Provider,{value:{activeSnapPoint:gt,snapPoints:a,setActiveSnapPoint:He,drawerRef:g,overlayRef:ae,onOpenChange:n,onPress:yt,onRelease:Rt,onDrag:St,dismissible:v,shouldAnimate:Le,handleOnly:m,isOpen:j,isDragging:Q,shouldFade:qe,closeDrawer:fe,onNestedDrag:Mt,onNestedOpenChange:Ct,onNestedRelease:Et,keyboardIsOpen:oe,modal:F,snapPointsOffset:de,activeSnapPointIndex:ie,direction:l,shouldScaleBackground:h,setBackgroundColorOnScale:w,noBodyStyles:N,container:B,autoFocus:H}},t))}const ft=o.forwardRef(function({...e},n){const{overlayRef:t,snapPoints:i,onRelease:s,shouldFade:a,isOpen:h,modal:w,shouldAnimate:y}=he(),S=it(n,t),v=i&&i.length>0;if(!w)return null;const m=o.useCallback(c=>s(c),[s]);return o.createElement(Pt,{onMouseUp:m,ref:S,"data-vaul-overlay":"","data-vaul-snap-points":h&&v?"true":"false","data-vaul-snap-points-overlay":h&&a?"true":"false","data-vaul-animate":y?.current?"true":"false",...e})});ft.displayName="Drawer.Overlay";const mt=o.forwardRef(function({onPointerDownOutside:e,style:n,onOpenAutoFocus:t,...i},s){const{drawerRef:a,onPress:h,onRelease:w,onDrag:y,keyboardIsOpen:S,snapPointsOffset:v,activeSnapPointIndex:m,modal:c,isOpen:$,direction:I,snapPoints:M,container:F,handleOnly:f,shouldAnimate:A,autoFocus:N}=he(),[l,V]=o.useState(!1),X=it(s,a),p=o.useRef(null),R=o.useRef(null),x=o.useRef(!1),G=M&&M.length>0;mn();const B=(u,b,j=0)=>{if(x.current)return!0;const O=Math.abs(u.y),_=Math.abs(u.x),W=_>O,Q=["bottom","right"].includes(b)?1:-1;if(b==="left"||b==="right"){if(!(u.x*Q<0)&&_>=0&&_<=j)return W}else if(!(u.y*Q<0)&&O>=0&&O<=j)return!W;return x.current=!0,!0};o.useEffect(()=>{G&&window.requestAnimationFrame(()=>{V(!0)})},[]);function H(u){p.current=null,x.current=!1,w(u)}return o.createElement(_t,{"data-vaul-drawer-direction":I,"data-vaul-drawer":"","data-vaul-delayed-snap-points":l?"true":"false","data-vaul-snap-points":$&&G?"true":"false","data-vaul-custom-container":F?"true":"false","data-vaul-animate":A?.current?"true":"false",...i,ref:X,style:v&&v.length>0?{"--snap-point-height":`${v[m??0]}px`,...n}:n,onPointerDown:u=>{f||(i.onPointerDown==null||i.onPointerDown.call(i,u),p.current={x:u.pageX,y:u.pageY},h(u))},onOpenAutoFocus:u=>{t?.(u),N||u.preventDefault()},onPointerDownOutside:u=>{if(e?.(u),!c||u.defaultPrevented){u.preventDefault();return}S.current&&(S.current=!1)},onFocusOutside:u=>{if(!c){u.preventDefault();return}},onPointerMove:u=>{if(R.current=u,f||(i.onPointerMove==null||i.onPointerMove.call(i,u),!p.current))return;const b=u.pageY-p.current.y,j=u.pageX-p.current.x,O=u.pointerType==="touch"?10:2;B({x:j,y:b},I,O)?y(u):(Math.abs(j)>O||Math.abs(b)>O)&&(p.current=null)},onPointerUp:u=>{i.onPointerUp==null||i.onPointerUp.call(i,u),p.current=null,x.current=!1,w(u)},onPointerOut:u=>{i.onPointerOut==null||i.onPointerOut.call(i,u),H(R.current)},onContextMenu:u=>{i.onContextMenu==null||i.onContextMenu.call(i,u),R.current&&H(R.current)}})});mt.displayName="Drawer.Content";const gn=250,wn=120,vn=o.forwardRef(function({preventCycle:e=!1,children:n,...t},i){const{closeDrawer:s,isDragging:a,snapPoints:h,activeSnapPoint:w,setActiveSnapPoint:y,dismissible:S,handleOnly:v,isOpen:m,onPress:c,onDrag:$}=he(),I=o.useRef(null),M=o.useRef(!1);function F(){if(M.current){N();return}window.setTimeout(()=>{f()},wn)}function f(){if(a||e||M.current){N();return}if(N(),!h||h.length===0){S||s();return}if(w===h[h.length-1]&&S){s();return}const V=h.findIndex(p=>p===w);if(V===-1)return;const X=h[V+1];y(X)}function A(){I.current=window.setTimeout(()=>{M.current=!0},gn)}function N(){I.current&&window.clearTimeout(I.current),M.current=!1}return o.createElement("div",{onClick:F,onPointerCancel:N,onPointerDown:l=>{v&&c(l),A()},onPointerMove:l=>{v&&$(l)},ref:i,"data-vaul-drawer-visible":m?"true":"false","data-vaul-handle":"","aria-hidden":"true",...t},o.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});vn.displayName="Drawer.Handle";function bn(e){const n=he(),{container:t=n.container,...i}=e;return o.createElement(kt,{container:t,...i})}const re={Root:hn,Content:mt,Overlay:ft,Portal:bn,Close:It,Title:Nt,Description:Ot};function xn({...e}){return r.jsx(re.Root,{"data-slot":"drawer",...e})}function yn({...e}){return r.jsx(re.Portal,{"data-slot":"drawer-portal",...e})}function Sn({...e}){return r.jsx(re.Close,{"data-slot":"drawer-close",...e})}function Tn({className:e,...n}){return r.jsx(re.Overlay,{"data-slot":"drawer-overlay",className:se("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...n})}function Rn({className:e,children:n,...t}){return r.jsxs(yn,{"data-slot":"drawer-portal",children:[r.jsx(Tn,{}),r.jsxs(re.Content,{"data-slot":"drawer-content",className:se("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...t,children:[r.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),n]})]})}function Cn({className:e,...n}){return r.jsx("div",{"data-slot":"drawer-header",className:se("flex flex-col gap-1.5 p-4",e),...n})}function Mn({className:e,...n}){return r.jsx("div",{"data-slot":"drawer-footer",className:se("mt-auto flex flex-col gap-2 p-4",e),...n})}function En({className:e,...n}){return r.jsx(re.Title,{"data-slot":"drawer-title",className:se("text-foreground font-semibold",e),...n})}function jn({className:e,...n}){return r.jsx(re.Description,{"data-slot":"drawer-description",className:se("text-muted-foreground text-sm",e),...n})}const Dn={coming_soon:{icon:r.jsx(tt,{size:16}),bg:"bg-amber-50 border-amber-200",text:"text-amber-800",message:"The full module for this topic isn't available yet β here's what you can study in the meantime, based on the DepEd curriculum."},progression_locked:{icon:r.jsx(Ze,{size:16}),bg:"bg-purple-50 border-purple-200",text:"text-purple-800",message:"You're flagged as at-risk here, but this module is currently locked behind progression. Study this brief while you work toward unlocking it."},no_module:{icon:r.jsx(Se,{size:16}),bg:"bg-rose-50 border-rose-200",text:"text-rose-800",message:"No module has been created for this topic yet. Here's what the DepEd curriculum says you should know."}},Nn=({open:e,onOpenChange:n,topicName:t,topicId:i,resolutionState:s,fallbackContent:a,moduleId:h,studentId:w,onNavigateToPrerequisite:y,loading:S=!1,error:v=null})=>{const[m,c]=U.useState(!1),[$,I]=U.useState(!1),[M,F]=U.useState(!1),f=Dn[s],A=async()=>{if(!(!w||!h)){I(!0);try{await $t(w,h),F(!0)}catch{}I(!1)}};return r.jsx(xn,{open:e,onOpenChange:n,children:r.jsxs(Rn,{className:"max-h-[85vh]",children:[r.jsxs(Cn,{children:[r.jsx(En,{className:"text-lg",children:t}),r.jsx(jn,{children:"At-Risk Study Brief"})]}),r.jsxs("div",{className:"px-4 pb-4 overflow-y-auto flex-1 space-y-4",children:[r.jsxs("div",{className:`flex items-start gap-2 p-3 rounded-lg border ${f.bg}`,children:[r.jsx("span",{className:`mt-0.5 ${f.text}`,children:f.icon}),r.jsx("p",{className:`text-xs leading-relaxed ${f.text}`,children:f.message})]}),S&&r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx("div",{className:"animate-pulse text-sm text-gray-500",children:"Loading study brief..."})}),v&&r.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-red-50 border border-red-200",children:[r.jsx(Lt,{size:14,className:"text-red-600"}),r.jsx("p",{className:"text-xs text-red-700",children:v})]}),a&&!S&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-semibold text-gray-900 mb-1",children:"Overview"}),r.jsx("p",{className:"text-sm text-gray-700 leading-relaxed",children:a.summary})]}),a.key_concepts.length>0&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Key Concepts"}),r.jsx("ul",{className:"space-y-1.5",children:a.key_concepts.map((N,l)=>r.jsxs("li",{className:"flex items-start gap-2 text-sm text-gray-700",children:[r.jsx("span",{className:"mt-1.5 w-1.5 h-1.5 rounded-full bg-purple-500 flex-shrink-0"}),N]},l))})]}),a.one_worked_example?.problem&&r.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[r.jsxs("button",{onClick:()=>c(!m),className:"w-full flex items-center justify-between px-3 py-2.5 bg-gray-50 hover:bg-gray-100 transition-colors",children:[r.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"Worked Example"}),m?r.jsx(Bt,{size:16}):r.jsx(Ft,{size:16})]}),r.jsx(Qe,{children:m&&r.jsx(Ie.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:r.jsxs("div",{className:"px-3 py-3 space-y-2",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase",children:"Problem"}),r.jsx("p",{className:"text-sm text-gray-800 mt-0.5",children:a.one_worked_example.problem})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase",children:"Solution"}),r.jsx("p",{className:"text-sm text-gray-800 mt-0.5 whitespace-pre-line",children:a.one_worked_example.solution})]})]})})})]}),a.what_to_focus_on&&r.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:[r.jsx("h4",{className:"text-xs font-bold text-blue-800 uppercase mb-1",children:"What to Focus On"}),r.jsx("p",{className:"text-sm text-blue-900 leading-relaxed",children:a.what_to_focus_on})]}),a.rag_confidence==="low"&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[r.jsx(Se,{size:12}),r.jsx("span",{children:"Limited curriculum data was available for this topic preview."})]})]})]}),r.jsxs(Mn,{children:[s==="coming_soon"&&h&&r.jsxs("button",{onClick:A,disabled:M||$,className:"flex items-center justify-center gap-2 w-full py-2.5 rounded-lg bg-amber-500 hover:bg-amber-600 text-white text-sm font-semibold disabled:opacity-50 transition-colors",children:[r.jsx(Gt,{size:14}),M?"Subscribed!":$?"Subscribing...":"Notify Me When Available"]}),s==="progression_locked"&&h&&y&&r.jsxs("button",{onClick:()=>{y(h),n(!1)},className:"flex items-center justify-center gap-2 w-full py-2.5 rounded-lg bg-purple-600 hover:bg-purple-700 text-white text-sm font-semibold transition-colors",children:["Go to prerequisite module",r.jsx(jt,{size:14})]}),r.jsx(Sn,{asChild:!0,children:r.jsx("button",{className:"w-full py-2 rounded-lg border border-gray-200 text-sm text-gray-600 hover:bg-gray-50 transition-colors",children:"Close"})})]})]})})},J={pillBg:"#E9D5FF",pillText:"#6B21A8",pillLockedBg:"#EDE9FE",pillLockedText:"#7C3AED",pillComingSoonBg:"#FEF3C7",pillComingSoonText:"#92400E",pillNoModuleBg:"#FFE4E6",pillNoModuleText:"#BE123C",headerText:"#1F2937",arrowBg:"#F3F4F6"},On=new Set(et.map(e=>e.id));function ye(e){return nt[e]||et.find(n=>n.id===e)?.moduleTitle||e.split("-").slice(2).join(" ").replace(/\b\w/g,n=>n.toUpperCase())}function In(e){switch(e){case"coming_soon":return{style:{backgroundColor:J.pillComingSoonBg,color:J.pillComingSoonText,cursor:"pointer"},icon:r.jsx(tt,{size:14})};case"progression_locked":return{style:{backgroundColor:J.pillLockedBg,color:J.pillLockedText,cursor:"pointer"},icon:r.jsx(Ze,{size:14})};case"no_module":return{style:{backgroundColor:J.pillNoModuleBg,color:J.pillNoModuleText,cursor:"pointer"},icon:r.jsx(Se,{size:14})};default:return{style:{backgroundColor:J.pillBg,color:J.pillText,cursor:"pointer"},icon:r.jsx(Se,{size:14})}}}const Qn=({flaggedTopics:e=[],atRiskSubjects:n=[],unlockedModuleIds:t,moduleStatusMap:i={},resolutionStateMap:s={},fallbackContentMap:a={},onTopicClick:h,onNavigateToPrerequisite:w,studentId:y})=>{const S=U.useRef(null),[v,m]=U.useState(!1),[c,$]=U.useState(null),[I,M]=U.useState({}),[F,f]=U.useState(null),[A,N]=U.useState(!1),[l,V]=U.useState(""),X=e.filter(b=>On.has(b));if(X.length===0)return null;const p=()=>{if(S.current){const{scrollLeft:b,scrollWidth:j,clientWidth:O}=S.current;m(b+O<j-10)}},R=()=>{S.current?.scrollBy({left:200,behavior:"smooth"})},x=b=>{if(s[b])return s[b];const j=i[b];return j==="coming_soon"?"coming_soon":j==="unavailable"?"no_module":(j==="available"||j==="teacher_uploaded")&&t&&!t.has(b)?"progression_locked":"accessible"},G=async b=>{if(x(b)==="accessible"){if(c===b){h?.(b);return}if($(b),!I[b]&&y){f(b);try{const O=ye(b),_=await Dt(y,b,O,"General Mathematics",.7);_.generated&&M(W=>({...W,[b]:_.tips}))}catch{}f(null)}}else V(b),N(!0)},B=l?x(l):"no_module",H=l&&a[l]||null,u=l||null;return r.jsxs(r.Fragment,{children:[r.jsxs(Ie.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"mb-4",children:[r.jsx("h3",{className:"text-base font-bold mb-3",style:{color:J.headerText},children:"Recommended for Review"}),r.jsxs("div",{className:"relative flex items-center",children:[r.jsx("div",{ref:S,onScroll:p,className:"flex gap-2 overflow-x-auto scrollbar-hide pb-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:X.slice(0,8).map((b,j)=>{const O=x(b),{style:_,icon:W}=In(O);return r.jsxs("button",{onClick:()=>G(b),title:O==="coming_soon"?"Module coming soon β tap for study brief":O==="progression_locked"?"Locked β complete previous module first":O==="no_module"?"No module yet β tap for curriculum brief":void 0,className:"flex items-center gap-1.5 px-4 py-2 rounded-full text-sm font-semibold transition-all whitespace-nowrap hover:scale-[1.02] active:scale-[0.98]",style:_,children:[W,ye(b),O==="accessible"&&r.jsx(Ve,{size:14})]},`${b}-${j}`)})}),v&&r.jsx("button",{onClick:R,className:"flex-shrink-0 ml-2 w-8 h-8 rounded-full flex items-center justify-center transition-colors",style:{backgroundColor:J.arrowBg},"aria-label":"Scroll right",children:r.jsx(Ve,{size:16,className:"text-gray-600"})})]}),r.jsx("style",{children:`
|
| 4 |
.scrollbar-hide::-webkit-scrollbar { display: none; }
|
|
|
|
| 1 |
+
import{d as o,r as U,j as r}from"./vendor-react-B4AQeu28.js";import{o as se,h as Qe,m as Ie,y as Se,a as jt,L as Ze,I as et}from"./index-Bp7MiGcW.js";import{f as Dt}from"./deepseekRagService-Bke9fSTt.js";import{T as Nt,D as Ot,d as It,b as At,c as _t,P as kt,O as Pt}from"./vendor-radix-C5nwdvGr.js";import{w as $t}from"./moduleWatchService-Cyzc6bn4.js";import{C as Lt}from"./circle-alert-CHGy8HcB.js";import{a as Bt,C as Ft}from"./chevron-up-DtS9MvUZ.js";import{B as Gt}from"./bell-DyLbgepV.js";import{C as tt}from"./clock-Cc6sJz1J.js";import{C as Ve}from"./chevron-right-BxoysOas.js";import{S as Ht}from"./sparkles-fLB3ltj1.js";import{X as qt}from"./x-k8d6VLEw.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const ke=[{topicId:"gm-q1-business-finance",label:"Business and Finance",subjectId:"gen-math",quarter:1,competencyCodes:["GM11-BF-1","GM11-BF-2","GM11-BF-3"]},{topicId:"gm-q1-patterns-sequences-series",label:"Patterns, Sequences, and Series",subjectId:"gen-math",quarter:1,competencyCodes:["GM11-PSS-1","GM11-PSS-2","GM11-PSS-3"]},{topicId:"gm-q1-financial-application-sequences-series",label:"Financial Application of Sequences and Series",subjectId:"gen-math",quarter:1,competencyCodes:["GM11-FASS-1","GM11-FASS-2"]},{topicId:"gm-q2-measurement-conversion",label:"Measurement and Conversion",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-MC-1","GM11-MC-2"]},{topicId:"gm-q2-functions-graphs",label:"Functions and Their Graphs",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-FG-1","GM11-FG-2","GM11-FG-3","M11GM-Ia-2","M11GM-Ib-5","M11GM-Id-2","M11GM-Ie-f-1","M11GM-Ii-4"]},{topicId:"gm-q2-piecewise-functions",label:"Piecewise Functions",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-PF-1","GM11-PF-2"]},{topicId:"gm-q2-statistical-variables",label:"Statistical Variables",subjectId:"gen-math",quarter:2,competencyCodes:["GM11-SV-1","GM11-SV-2"]},{topicId:"gm-q3-basic-trigonometry",label:"Basic Trigonometry",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-BT-1","GM11-BT-2"]},{topicId:"gm-q3-practical-applications-measurement",label:"Practical Applications of Measurement",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-PAM-1","GM11-PAM-2","M11GM-IIa-b-1","M11GM-IIa-2","M11GM-IIc-d-1","M11GM-IIf-3"]},{topicId:"gm-q3-transformational-geometry-volume-capacity",label:"Transformational Geometry / Volume and Capacity",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-TGVC-1","GM11-TGVC-2"]},{topicId:"gm-q3-random-variables-sampling",label:"Random Variables and Sampling",subjectId:"gen-math",quarter:3,competencyCodes:["GM11-RVS-1","GM11-RVS-2","GM11-RVS-3"]},{topicId:"gm-q4-compound-interest-annuities-loans",label:"Compound Interest, Annuities, and Loans",subjectId:"gen-math",quarter:4,competencyCodes:["GM11-CIAL-1","GM11-CIAL-2","GM11-CIAL-3"]},{topicId:"gm-q4-hypothesis-testing-regression",label:"Hypothesis Testing and Regression",subjectId:"gen-math",quarter:4,competencyCodes:["GM11-HTR-1","GM11-HTR-2"]},{topicId:"gm-q4-propositions-syllogisms-fallacies",label:"Logical Propositions, Syllogisms, and Fallacies",subjectId:"gen-math",quarter:4,competencyCodes:["GM11-PSF-1","GM11-PSF-2","GM11-PSF-3","M11GM-IIg-1","M11GM-IIh-1","M11GM-IIi-1","M11GM-IIi-2","M11GM-IIj-1"]}];for(const e of ke)for(const n of e.competencyCodes)e.topicId;const zt={};for(const e of ke)zt[e.topicId]=e;const nt={};for(const e of ke)nt[e.topicId]=e.label;function Ut(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const rt=o.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),he=()=>{const e=o.useContext(rt);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Ut(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
| 2 |
[data-state=closed]
|
| 3 |
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Wt(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function Vt(){return Pe(/^Mac/)}function Yt(){return Pe(/^iPhone/)}function Ye(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Xt(){return Pe(/^iPad/)||Vt()&&navigator.maxTouchPoints>1}function at(){return Yt()||Xt()}function Pe(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const Kt=24,Jt=typeof window<"u"?U.useLayoutEffect:U.useEffect;function Xe(...e){return(...n)=>{for(let t of e)typeof t=="function"&&t(...n)}}const je=typeof document<"u"&&window.visualViewport;function Ke(e){let n=window.getComputedStyle(e);return/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY)}function ot(e){for(Ke(e)&&(e=e.parentElement);e&&!Ke(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Qt=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let be=0,De;function Zt(e={}){let{isDisabled:n}=e;Jt(()=>{if(!n)return be++,be===1&&at()&&(De=en()),()=>{be--,be===0&&De?.()}},[n])}function en(){let e,n=0,t=m=>{e=ot(m.target),!(e===document.documentElement&&e===document.body)&&(n=m.changedTouches[0].pageY)},i=m=>{if(!e||e===document.documentElement||e===document.body){m.preventDefault();return}let c=m.changedTouches[0].pageY,$=e.scrollTop,I=e.scrollHeight-e.clientHeight;I!==0&&(($<=0&&c>n||$>=I&&c<n)&&m.preventDefault(),n=c)},s=m=>{let c=m.target;Ae(c)&&c!==document.activeElement&&(m.preventDefault(),c.style.transform="translateY(-2000px)",c.focus(),requestAnimationFrame(()=>{c.style.transform=""}))},a=m=>{let c=m.target;Ae(c)&&(c.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{c.style.transform="",je&&(je.height<window.innerHeight?requestAnimationFrame(()=>{Je(c)}):je.addEventListener("resize",()=>Je(c),{once:!0}))}))},h=()=>{window.scrollTo(0,0)},w=window.pageXOffset,y=window.pageYOffset,S=Xe(tn(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let v=Xe(me(document,"touchstart",t,{passive:!1,capture:!0}),me(document,"touchmove",i,{passive:!1,capture:!0}),me(document,"touchend",s,{passive:!1,capture:!0}),me(document,"focus",a,!0),me(window,"scroll",h));return()=>{S(),v(),window.scrollTo(w,y)}}function tn(e,n,t){let i=e.style[n];return e.style[n]=t,()=>{e.style[n]=i}}function me(e,n,t,i){return e.addEventListener(n,t,i),()=>{e.removeEventListener(n,t,i)}}function Je(e){let n=document.scrollingElement||document.documentElement;for(;e&&e!==n;){let t=ot(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let i=t.getBoundingClientRect().top,s=e.getBoundingClientRect().top,a=e.getBoundingClientRect().bottom;const h=t.getBoundingClientRect().bottom+Kt;a>h&&(t.scrollTop+=s-i)}e=t.parentElement}}function Ae(e){return e instanceof HTMLInputElement&&!Qt.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function nn(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function rn(...e){return n=>e.forEach(t=>nn(t,n))}function it(...e){return U.useCallback(rn(...e),e)}const st=new WeakMap;function L(e,n,t=!1){if(!e||!(e instanceof HTMLElement))return;let i={};Object.entries(n).forEach(([s,a])=>{if(s.startsWith("--")){e.style.setProperty(s,a);return}i[s]=e.style[s],e.style[s]=a}),!t&&st.set(e,i)}function an(e,n){if(!e||!(e instanceof HTMLElement))return;let t=st.get(e);t&&(e.style[n]=t[n])}const P=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function xe(e,n){if(!e)return null;const t=window.getComputedStyle(e),i=t.transform||t.webkitTransform||t.mozTransform;let s=i.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[P(n)?13:12]):(s=i.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[P(n)?5:4]):null)}function on(e){return 8*(Math.log(e+1)-2)}function Ne(e,n){if(!e)return()=>{};const t=e.style.cssText;return Object.assign(e.style,n),()=>{e.style.cssText=t}}function sn(...e){return(...n)=>{for(const t of e)typeof t=="function"&&t(...n)}}const D={DURATION:.5,EASE:[.32,.72,0,1]},lt=.4,ln=.25,cn=100,ct=8,ne=16,_e=26,Oe="vaul-dragging";function ut(e){const n=o.useRef(e);return o.useEffect(()=>{n.current=e}),o.useMemo(()=>(...t)=>n.current==null?void 0:n.current.call(n,...t),[])}function un({defaultProp:e,onChange:n}){const t=o.useState(e),[i]=t,s=o.useRef(i),a=ut(n);return o.useEffect(()=>{s.current!==i&&(a(i),s.current=i)},[i,s,a]),t}function dt({prop:e,defaultProp:n,onChange:t=()=>{}}){const[i,s]=un({defaultProp:n,onChange:t}),a=e!==void 0,h=a?e:i,w=ut(t),y=o.useCallback(S=>{if(a){const m=typeof S=="function"?S(e):S;m!==e&&w(m)}else s(S)},[a,e,s,w]);return[h,y]}function dn({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:t,drawerRef:i,overlayRef:s,fadeFromIndex:a,onSnapPointChange:h,direction:w="bottom",container:y,snapToSequentialPoint:S}){const[v,m]=dt({prop:e,defaultProp:t?.[0],onChange:n}),[c,$]=o.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);o.useEffect(()=>{function p(){$({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);const I=o.useMemo(()=>v===t?.[t.length-1]||null,[t,v]),M=o.useMemo(()=>{var p;return(p=t?.findIndex(R=>R===v))!=null?p:null},[t,v]),F=t&&t.length>0&&(a||a===0)&&!Number.isNaN(a)&&t[a]===v||!t,f=o.useMemo(()=>{const p=y?{width:y.getBoundingClientRect().width,height:y.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var R;return(R=t?.map(x=>{const G=typeof x=="string";let B=0;if(G&&(B=parseInt(x,10)),P(w)){const u=G?B:c?x*p.height:0;return c?w==="bottom"?p.height-u:-p.height+u:u}const H=G?B:c?x*p.width:0;return c?w==="right"?p.width-H:-p.width+H:H}))!=null?R:[]},[t,c,y]),A=o.useMemo(()=>M!==null?f?.[M]:null,[f,M]),N=o.useCallback(p=>{var R;const x=(R=f?.findIndex(G=>G===p))!=null?R:null;h(x),L(i.current,{transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,transform:P(w)?`translate3d(0, ${p}px, 0)`:`translate3d(${p}px, 0, 0)`}),f&&x!==f.length-1&&a!==void 0&&x!==a&&x<a?L(s.current,{transition:`opacity ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,opacity:"0"}):L(s.current,{transition:`opacity ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,opacity:"1"}),m(t?.[Math.max(x,0)])},[i.current,t,f,a,s,m]);o.useEffect(()=>{if(v||e){var p;const R=(p=t?.findIndex(x=>x===e||x===v))!=null?p:-1;f&&R!==-1&&typeof f[R]=="number"&&N(f[R])}},[v,e,t,f,N]);function l({draggedDistance:p,closeDrawer:R,velocity:x,dismissible:G}){if(a===void 0)return;const B=w==="bottom"||w==="right"?(A??0)-p:(A??0)+p,H=M===a-1,u=M===0,b=p>0;if(H&&L(s.current,{transition:`opacity ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`}),!S&&x>2&&!b){G?R():N(f[0]);return}if(!S&&x>2&&b&&f&&t){N(f[t.length-1]);return}const j=f?.reduce((_,W)=>typeof _!="number"||typeof W!="number"?_:Math.abs(W-B)<Math.abs(_-B)?W:_),O=P(w)?window.innerHeight:window.innerWidth;if(x>lt&&Math.abs(p)<O*.4){const _=b?1:-1;if(_>0&&I&&t){N(f[t.length-1]);return}if(u&&_<0&&G&&R(),M===null)return;N(f[M+_]);return}N(j)}function V({draggedDistance:p}){if(A===null)return;const R=w==="bottom"||w==="right"?A-p:A+p;(w==="bottom"||w==="right")&&R<f[f.length-1]||(w==="top"||w==="left")&&R>f[f.length-1]||L(i.current,{transform:P(w)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`})}function X(p,R){if(!t||typeof M!="number"||!f||a===void 0)return null;const x=M===a-1;if(M>=a&&R)return 0;if(x&&!R)return 1;if(!F&&!x)return null;const B=x?M+1:M-1,H=x?f[B]-f[B-1]:f[B+1]-f[B],u=p/Math.abs(H);return x?1-u:u}return{isLastSnapPoint:I,activeSnapPoint:v,shouldFade:F,getPercentageDragged:X,setActiveSnapPoint:m,activeSnapPointIndex:M,onRelease:l,onDrag:V,snapPointsOffset:f}}const fn=()=>()=>{};function mn(){const{direction:e,isOpen:n,shouldScaleBackground:t,setBackgroundColorOnScale:i,noBodyStyles:s}=he(),a=o.useRef(null),h=U.useMemo(()=>document.body.style.backgroundColor,[]);function w(){return(window.innerWidth-_e)/window.innerWidth}o.useEffect(()=>{if(n&&t){a.current&&clearTimeout(a.current);const y=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!y)return;sn(i&&!s?Ne(document.body,{background:"black"}):fn,Ne(y,{transformOrigin:P(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${D.DURATION}s`,transitionTimingFunction:`cubic-bezier(${D.EASE.join(",")})`}));const S=Ne(y,{borderRadius:`${ct}px`,overflow:"hidden",...P(e)?{transform:`scale(${w()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${w()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{S(),a.current=window.setTimeout(()=>{h?document.body.style.background=h:document.body.style.removeProperty("background")},D.DURATION*1e3)}}},[n,t,h])}let pe=null;function pn({isOpen:e,modal:n,nested:t,hasBeenOpened:i,preventScrollRestoration:s,noBodyStyles:a}){const[h,w]=o.useState(()=>typeof window<"u"?window.location.href:""),y=o.useRef(0),S=o.useCallback(()=>{if(Ye()&&pe===null&&e&&!a){pe={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:m,innerHeight:c}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-y.current}px`,left:`${-m}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const $=c-window.innerHeight;$&&y.current>=c&&(document.body.style.top=`${-(y.current+$)}px`)}),300)}},[e]),v=o.useCallback(()=>{if(Ye()&&pe!==null&&!a){const m=-parseInt(document.body.style.top,10),c=-parseInt(document.body.style.left,10);Object.assign(document.body.style,pe),window.requestAnimationFrame(()=>{if(s&&h!==window.location.href){w(window.location.href);return}window.scrollTo(c,m)}),pe=null}},[h]);return o.useEffect(()=>{function m(){y.current=window.scrollY}return m(),window.addEventListener("scroll",m),()=>{window.removeEventListener("scroll",m)}},[]),o.useEffect(()=>{if(n)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||v()}},[n,v]),o.useEffect(()=>{t||!i||(e?(!window.matchMedia("(display-mode: standalone)").matches&&S(),n||window.setTimeout(()=>{v()},500)):v())},[e,i,h,n,t,S,v]),{restorePositionSetting:v}}function hn({open:e,onOpenChange:n,children:t,onDrag:i,onRelease:s,snapPoints:a,shouldScaleBackground:h=!1,setBackgroundColorOnScale:w=!0,closeThreshold:y=ln,scrollLockTimeout:S=cn,dismissible:v=!0,handleOnly:m=!1,fadeFromIndex:c=a&&a.length-1,activeSnapPoint:$,setActiveSnapPoint:I,fixed:M,modal:F=!0,onClose:f,nested:A,noBodyStyles:N=!1,direction:l="bottom",defaultOpen:V=!1,disablePreventScroll:X=!0,snapToSequentialPoint:p=!1,preventScrollRestoration:R=!1,repositionInputs:x=!0,onAnimationEnd:G,container:B,autoFocus:H=!1}){var u,b;const[j=!1,O]=dt({defaultProp:V,prop:e,onChange:d=>{n?.(d),!d&&!A&&xt(),setTimeout(()=>{G?.(d)},D.DURATION*1e3),d&&!F&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),d||(document.body.style.pointerEvents="auto")}}),[_,W]=o.useState(!1),[Q,le]=o.useState(!1),[pt,$e]=o.useState(!1),ae=o.useRef(null),ge=o.useRef(null),Te=o.useRef(null),Re=o.useRef(null),ce=o.useRef(null),ue=o.useRef(!1),Ce=o.useRef(null),Me=o.useRef(0),oe=o.useRef(!1),Le=o.useRef(!V),Be=o.useRef(0),g=o.useRef(null),Fe=o.useRef(((u=g.current)==null?void 0:u.getBoundingClientRect().height)||0),Ge=o.useRef(((b=g.current)==null?void 0:b.getBoundingClientRect().width)||0),Ee=o.useRef(0),ht=o.useCallback(d=>{a&&d===de.length-1&&(ge.current=new Date)},[]),{activeSnapPoint:gt,activeSnapPointIndex:ie,setActiveSnapPoint:He,onRelease:wt,snapPointsOffset:de,onDrag:vt,shouldFade:qe,getPercentageDragged:bt}=dn({snapPoints:a,activeSnapPointProp:$,setActiveSnapPointProp:I,drawerRef:g,fadeFromIndex:c,overlayRef:ae,onSnapPointChange:ht,direction:l,container:B,snapToSequentialPoint:p});Zt({isDisabled:!j||Q||!F||pt||!_||!x||!X});const{restorePositionSetting:xt}=pn({isOpen:j,modal:F,nested:A??!1,hasBeenOpened:_,preventScrollRestoration:R,noBodyStyles:N});function we(){return(window.innerWidth-_e)/window.innerWidth}function yt(d){var C,E;!v&&!a||g.current&&!g.current.contains(d.target)||(Fe.current=((C=g.current)==null?void 0:C.getBoundingClientRect().height)||0,Ge.current=((E=g.current)==null?void 0:E.getBoundingClientRect().width)||0,le(!0),Te.current=new Date,at()&&window.addEventListener("touchend",()=>ue.current=!1,{once:!0}),d.target.setPointerCapture(d.pointerId),Me.current=P(l)?d.pageY:d.pageX)}function ze(d,C){var E;let T=d;const k=(E=window.getSelection())==null?void 0:E.toString(),z=g.current?xe(g.current,l):null,q=new Date;if(T.tagName==="SELECT"||T.hasAttribute("data-vaul-no-drag")||T.closest("[data-vaul-no-drag]"))return!1;if(l==="right"||l==="left")return!0;if(ge.current&&q.getTime()-ge.current.getTime()<500)return!1;if(z!==null&&(l==="bottom"?z>0:z<0))return!0;if(k&&k.length>0)return!1;if(ce.current&&q.getTime()-ce.current.getTime()<S&&z===0||C)return ce.current=q,!1;for(;T;){if(T.scrollHeight>T.clientHeight){if(T.scrollTop!==0)return ce.current=new Date,!1;if(T.getAttribute("role")==="dialog")return!0}T=T.parentNode}return!0}function St(d){if(g.current&&Q){const C=l==="bottom"||l==="right"?1:-1,E=(Me.current-(P(l)?d.pageY:d.pageX))*C,T=E>0,k=a&&!v&&!T;if(k&&ie===0)return;const z=Math.abs(E),q=document.querySelector("[data-vaul-drawer-wrapper]"),Z=l==="bottom"||l==="top"?Fe.current:Ge.current;let Y=z/Z;const te=bt(z,T);if(te!==null&&(Y=te),k&&Y>=1||!ue.current&&!ze(d.target,T))return;if(g.current.classList.add(Oe),ue.current=!0,L(g.current,{transition:"none"}),L(ae.current,{transition:"none"}),a&&vt({draggedDistance:E}),T&&!a){const K=on(E),ve=Math.min(K*-1,0)*C;L(g.current,{transform:P(l)?`translate3d(0, ${ve}px, 0)`:`translate3d(${ve}px, 0, 0)`});return}const ee=1-Y;if((qe||c&&ie===c-1)&&(i?.(d,Y),L(ae.current,{opacity:`${ee}`,transition:"none"},!0)),q&&ae.current&&h){const K=Math.min(we()+Y*(1-we()),1),ve=8-Y*8,We=Math.max(0,14-Y*14);L(q,{borderRadius:`${ve}px`,transform:P(l)?`scale(${K}) translate3d(0, ${We}px, 0)`:`scale(${K}) translate3d(${We}px, 0, 0)`,transition:"none"},!0)}if(!a){const K=z*C;L(g.current,{transform:P(l)?`translate3d(0, ${K}px, 0)`:`translate3d(${K}px, 0, 0)`})}}}o.useEffect(()=>{window.requestAnimationFrame(()=>{Le.current=!0})},[]),o.useEffect(()=>{var d;function C(){if(!g.current||!x)return;const E=document.activeElement;if(Ae(E)||oe.current){var T;const k=((T=window.visualViewport)==null?void 0:T.height)||0,z=window.innerHeight;let q=z-k;const Z=g.current.getBoundingClientRect().height||0,Y=Z>z*.8;Ee.current||(Ee.current=Z);const te=g.current.getBoundingClientRect().top;if(Math.abs(Be.current-q)>60&&(oe.current=!oe.current),a&&a.length>0&&de&&ie){const ee=de[ie]||0;q+=ee}if(Be.current=q,Z>k||oe.current){const ee=g.current.getBoundingClientRect().height;let K=ee;ee>k&&(K=k-(Y?te:_e)),M?g.current.style.height=`${ee-Math.max(q,0)}px`:g.current.style.height=`${Math.max(K,k-te)}px`}else Wt()||(g.current.style.height=`${Ee.current}px`);a&&a.length>0&&!oe.current?g.current.style.bottom="0px":g.current.style.bottom=`${Math.max(q,0)}px`}}return(d=window.visualViewport)==null||d.addEventListener("resize",C),()=>{var E;return(E=window.visualViewport)==null?void 0:E.removeEventListener("resize",C)}},[ie,a,de]);function fe(d){Tt(),f?.(),d||O(!1),setTimeout(()=>{a&&He(a[0])},D.DURATION*1e3)}function Ue(){if(!g.current)return;const d=document.querySelector("[data-vaul-drawer-wrapper]"),C=xe(g.current,l);L(g.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`}),L(ae.current,{transition:`opacity ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,opacity:"1"}),h&&C&&C>0&&j&&L(d,{borderRadius:`${ct}px`,overflow:"hidden",...P(l)?{transform:`scale(${we()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${we()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${D.DURATION}s`,transitionTimingFunction:`cubic-bezier(${D.EASE.join(",")})`},!0)}function Tt(){!Q||!g.current||(g.current.classList.remove(Oe),ue.current=!1,le(!1),Re.current=new Date)}function Rt(d){if(!Q||!g.current)return;g.current.classList.remove(Oe),ue.current=!1,le(!1),Re.current=new Date;const C=xe(g.current,l);if(!d||!ze(d.target,!1)||!C||Number.isNaN(C)||Te.current===null)return;const E=Re.current.getTime()-Te.current.getTime(),T=Me.current-(P(l)?d.pageY:d.pageX),k=Math.abs(T)/E;if(k>.05&&($e(!0),setTimeout(()=>{$e(!1)},200)),a){wt({draggedDistance:T*(l==="bottom"||l==="right"?1:-1),closeDrawer:fe,velocity:k,dismissible:v}),s?.(d,!0);return}if(l==="bottom"||l==="right"?T>0:T<0){Ue(),s?.(d,!0);return}if(k>lt){fe(),s?.(d,!1);return}var z;const q=Math.min((z=g.current.getBoundingClientRect().height)!=null?z:0,window.innerHeight);var Z;const Y=Math.min((Z=g.current.getBoundingClientRect().width)!=null?Z:0,window.innerWidth),te=l==="left"||l==="right";if(Math.abs(C)>=(te?Y:q)*y){fe(),s?.(d,!1);return}s?.(d,!0),Ue()}o.useEffect(()=>(j&&(L(document.documentElement,{scrollBehavior:"auto"}),ge.current=new Date),()=>{an(document.documentElement,"scrollBehavior")}),[j]);function Ct(d){const C=d?(window.innerWidth-ne)/window.innerWidth:1,E=d?-ne:0;Ce.current&&window.clearTimeout(Ce.current),L(g.current,{transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,transform:P(l)?`scale(${C}) translate3d(0, ${E}px, 0)`:`scale(${C}) translate3d(${E}px, 0, 0)`}),!d&&g.current&&(Ce.current=setTimeout(()=>{const T=xe(g.current,l);L(g.current,{transition:"none",transform:P(l)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})},500))}function Mt(d,C){if(C<0)return;const E=(window.innerWidth-ne)/window.innerWidth,T=E+C*(1-E),k=-ne+C*ne;L(g.current,{transform:P(l)?`scale(${T}) translate3d(0, ${k}px, 0)`:`scale(${T}) translate3d(${k}px, 0, 0)`,transition:"none"})}function Et(d,C){const E=P(l)?window.innerHeight:window.innerWidth,T=C?(E-ne)/E:1,k=C?-ne:0;C&&L(g.current,{transition:`transform ${D.DURATION}s cubic-bezier(${D.EASE.join(",")})`,transform:P(l)?`scale(${T}) translate3d(0, ${k}px, 0)`:`scale(${T}) translate3d(${k}px, 0, 0)`})}return o.useEffect(()=>{F||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[F]),o.createElement(At,{defaultOpen:V,onOpenChange:d=>{!v&&!d||(d?W(!0):fe(!0),O(d))},open:j},o.createElement(rt.Provider,{value:{activeSnapPoint:gt,snapPoints:a,setActiveSnapPoint:He,drawerRef:g,overlayRef:ae,onOpenChange:n,onPress:yt,onRelease:Rt,onDrag:St,dismissible:v,shouldAnimate:Le,handleOnly:m,isOpen:j,isDragging:Q,shouldFade:qe,closeDrawer:fe,onNestedDrag:Mt,onNestedOpenChange:Ct,onNestedRelease:Et,keyboardIsOpen:oe,modal:F,snapPointsOffset:de,activeSnapPointIndex:ie,direction:l,shouldScaleBackground:h,setBackgroundColorOnScale:w,noBodyStyles:N,container:B,autoFocus:H}},t))}const ft=o.forwardRef(function({...e},n){const{overlayRef:t,snapPoints:i,onRelease:s,shouldFade:a,isOpen:h,modal:w,shouldAnimate:y}=he(),S=it(n,t),v=i&&i.length>0;if(!w)return null;const m=o.useCallback(c=>s(c),[s]);return o.createElement(Pt,{onMouseUp:m,ref:S,"data-vaul-overlay":"","data-vaul-snap-points":h&&v?"true":"false","data-vaul-snap-points-overlay":h&&a?"true":"false","data-vaul-animate":y?.current?"true":"false",...e})});ft.displayName="Drawer.Overlay";const mt=o.forwardRef(function({onPointerDownOutside:e,style:n,onOpenAutoFocus:t,...i},s){const{drawerRef:a,onPress:h,onRelease:w,onDrag:y,keyboardIsOpen:S,snapPointsOffset:v,activeSnapPointIndex:m,modal:c,isOpen:$,direction:I,snapPoints:M,container:F,handleOnly:f,shouldAnimate:A,autoFocus:N}=he(),[l,V]=o.useState(!1),X=it(s,a),p=o.useRef(null),R=o.useRef(null),x=o.useRef(!1),G=M&&M.length>0;mn();const B=(u,b,j=0)=>{if(x.current)return!0;const O=Math.abs(u.y),_=Math.abs(u.x),W=_>O,Q=["bottom","right"].includes(b)?1:-1;if(b==="left"||b==="right"){if(!(u.x*Q<0)&&_>=0&&_<=j)return W}else if(!(u.y*Q<0)&&O>=0&&O<=j)return!W;return x.current=!0,!0};o.useEffect(()=>{G&&window.requestAnimationFrame(()=>{V(!0)})},[]);function H(u){p.current=null,x.current=!1,w(u)}return o.createElement(_t,{"data-vaul-drawer-direction":I,"data-vaul-drawer":"","data-vaul-delayed-snap-points":l?"true":"false","data-vaul-snap-points":$&&G?"true":"false","data-vaul-custom-container":F?"true":"false","data-vaul-animate":A?.current?"true":"false",...i,ref:X,style:v&&v.length>0?{"--snap-point-height":`${v[m??0]}px`,...n}:n,onPointerDown:u=>{f||(i.onPointerDown==null||i.onPointerDown.call(i,u),p.current={x:u.pageX,y:u.pageY},h(u))},onOpenAutoFocus:u=>{t?.(u),N||u.preventDefault()},onPointerDownOutside:u=>{if(e?.(u),!c||u.defaultPrevented){u.preventDefault();return}S.current&&(S.current=!1)},onFocusOutside:u=>{if(!c){u.preventDefault();return}},onPointerMove:u=>{if(R.current=u,f||(i.onPointerMove==null||i.onPointerMove.call(i,u),!p.current))return;const b=u.pageY-p.current.y,j=u.pageX-p.current.x,O=u.pointerType==="touch"?10:2;B({x:j,y:b},I,O)?y(u):(Math.abs(j)>O||Math.abs(b)>O)&&(p.current=null)},onPointerUp:u=>{i.onPointerUp==null||i.onPointerUp.call(i,u),p.current=null,x.current=!1,w(u)},onPointerOut:u=>{i.onPointerOut==null||i.onPointerOut.call(i,u),H(R.current)},onContextMenu:u=>{i.onContextMenu==null||i.onContextMenu.call(i,u),R.current&&H(R.current)}})});mt.displayName="Drawer.Content";const gn=250,wn=120,vn=o.forwardRef(function({preventCycle:e=!1,children:n,...t},i){const{closeDrawer:s,isDragging:a,snapPoints:h,activeSnapPoint:w,setActiveSnapPoint:y,dismissible:S,handleOnly:v,isOpen:m,onPress:c,onDrag:$}=he(),I=o.useRef(null),M=o.useRef(!1);function F(){if(M.current){N();return}window.setTimeout(()=>{f()},wn)}function f(){if(a||e||M.current){N();return}if(N(),!h||h.length===0){S||s();return}if(w===h[h.length-1]&&S){s();return}const V=h.findIndex(p=>p===w);if(V===-1)return;const X=h[V+1];y(X)}function A(){I.current=window.setTimeout(()=>{M.current=!0},gn)}function N(){I.current&&window.clearTimeout(I.current),M.current=!1}return o.createElement("div",{onClick:F,onPointerCancel:N,onPointerDown:l=>{v&&c(l),A()},onPointerMove:l=>{v&&$(l)},ref:i,"data-vaul-drawer-visible":m?"true":"false","data-vaul-handle":"","aria-hidden":"true",...t},o.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});vn.displayName="Drawer.Handle";function bn(e){const n=he(),{container:t=n.container,...i}=e;return o.createElement(kt,{container:t,...i})}const re={Root:hn,Content:mt,Overlay:ft,Portal:bn,Close:It,Title:Nt,Description:Ot};function xn({...e}){return r.jsx(re.Root,{"data-slot":"drawer",...e})}function yn({...e}){return r.jsx(re.Portal,{"data-slot":"drawer-portal",...e})}function Sn({...e}){return r.jsx(re.Close,{"data-slot":"drawer-close",...e})}function Tn({className:e,...n}){return r.jsx(re.Overlay,{"data-slot":"drawer-overlay",className:se("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...n})}function Rn({className:e,children:n,...t}){return r.jsxs(yn,{"data-slot":"drawer-portal",children:[r.jsx(Tn,{}),r.jsxs(re.Content,{"data-slot":"drawer-content",className:se("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...t,children:[r.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),n]})]})}function Cn({className:e,...n}){return r.jsx("div",{"data-slot":"drawer-header",className:se("flex flex-col gap-1.5 p-4",e),...n})}function Mn({className:e,...n}){return r.jsx("div",{"data-slot":"drawer-footer",className:se("mt-auto flex flex-col gap-2 p-4",e),...n})}function En({className:e,...n}){return r.jsx(re.Title,{"data-slot":"drawer-title",className:se("text-foreground font-semibold",e),...n})}function jn({className:e,...n}){return r.jsx(re.Description,{"data-slot":"drawer-description",className:se("text-muted-foreground text-sm",e),...n})}const Dn={coming_soon:{icon:r.jsx(tt,{size:16}),bg:"bg-amber-50 border-amber-200",text:"text-amber-800",message:"The full module for this topic isn't available yet β here's what you can study in the meantime, based on the DepEd curriculum."},progression_locked:{icon:r.jsx(Ze,{size:16}),bg:"bg-purple-50 border-purple-200",text:"text-purple-800",message:"You're flagged as at-risk here, but this module is currently locked behind progression. Study this brief while you work toward unlocking it."},no_module:{icon:r.jsx(Se,{size:16}),bg:"bg-rose-50 border-rose-200",text:"text-rose-800",message:"No module has been created for this topic yet. Here's what the DepEd curriculum says you should know."}},Nn=({open:e,onOpenChange:n,topicName:t,topicId:i,resolutionState:s,fallbackContent:a,moduleId:h,studentId:w,onNavigateToPrerequisite:y,loading:S=!1,error:v=null})=>{const[m,c]=U.useState(!1),[$,I]=U.useState(!1),[M,F]=U.useState(!1),f=Dn[s],A=async()=>{if(!(!w||!h)){I(!0);try{await $t(w,h),F(!0)}catch{}I(!1)}};return r.jsx(xn,{open:e,onOpenChange:n,children:r.jsxs(Rn,{className:"max-h-[85vh]",children:[r.jsxs(Cn,{children:[r.jsx(En,{className:"text-lg",children:t}),r.jsx(jn,{children:"At-Risk Study Brief"})]}),r.jsxs("div",{className:"px-4 pb-4 overflow-y-auto flex-1 space-y-4",children:[r.jsxs("div",{className:`flex items-start gap-2 p-3 rounded-lg border ${f.bg}`,children:[r.jsx("span",{className:`mt-0.5 ${f.text}`,children:f.icon}),r.jsx("p",{className:`text-xs leading-relaxed ${f.text}`,children:f.message})]}),S&&r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx("div",{className:"animate-pulse text-sm text-gray-500",children:"Loading study brief..."})}),v&&r.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-red-50 border border-red-200",children:[r.jsx(Lt,{size:14,className:"text-red-600"}),r.jsx("p",{className:"text-xs text-red-700",children:v})]}),a&&!S&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-semibold text-gray-900 mb-1",children:"Overview"}),r.jsx("p",{className:"text-sm text-gray-700 leading-relaxed",children:a.summary})]}),a.key_concepts.length>0&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Key Concepts"}),r.jsx("ul",{className:"space-y-1.5",children:a.key_concepts.map((N,l)=>r.jsxs("li",{className:"flex items-start gap-2 text-sm text-gray-700",children:[r.jsx("span",{className:"mt-1.5 w-1.5 h-1.5 rounded-full bg-purple-500 flex-shrink-0"}),N]},l))})]}),a.one_worked_example?.problem&&r.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[r.jsxs("button",{onClick:()=>c(!m),className:"w-full flex items-center justify-between px-3 py-2.5 bg-gray-50 hover:bg-gray-100 transition-colors",children:[r.jsx("span",{className:"text-sm font-semibold text-gray-900",children:"Worked Example"}),m?r.jsx(Bt,{size:16}):r.jsx(Ft,{size:16})]}),r.jsx(Qe,{children:m&&r.jsx(Ie.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:r.jsxs("div",{className:"px-3 py-3 space-y-2",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase",children:"Problem"}),r.jsx("p",{className:"text-sm text-gray-800 mt-0.5",children:a.one_worked_example.problem})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-xs font-bold text-gray-500 uppercase",children:"Solution"}),r.jsx("p",{className:"text-sm text-gray-800 mt-0.5 whitespace-pre-line",children:a.one_worked_example.solution})]})]})})})]}),a.what_to_focus_on&&r.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:[r.jsx("h4",{className:"text-xs font-bold text-blue-800 uppercase mb-1",children:"What to Focus On"}),r.jsx("p",{className:"text-sm text-blue-900 leading-relaxed",children:a.what_to_focus_on})]}),a.rag_confidence==="low"&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[r.jsx(Se,{size:12}),r.jsx("span",{children:"Limited curriculum data was available for this topic preview."})]})]})]}),r.jsxs(Mn,{children:[s==="coming_soon"&&h&&r.jsxs("button",{onClick:A,disabled:M||$,className:"flex items-center justify-center gap-2 w-full py-2.5 rounded-lg bg-amber-500 hover:bg-amber-600 text-white text-sm font-semibold disabled:opacity-50 transition-colors",children:[r.jsx(Gt,{size:14}),M?"Subscribed!":$?"Subscribing...":"Notify Me When Available"]}),s==="progression_locked"&&h&&y&&r.jsxs("button",{onClick:()=>{y(h),n(!1)},className:"flex items-center justify-center gap-2 w-full py-2.5 rounded-lg bg-purple-600 hover:bg-purple-700 text-white text-sm font-semibold transition-colors",children:["Go to prerequisite module",r.jsx(jt,{size:14})]}),r.jsx(Sn,{asChild:!0,children:r.jsx("button",{className:"w-full py-2 rounded-lg border border-gray-200 text-sm text-gray-600 hover:bg-gray-50 transition-colors",children:"Close"})})]})]})})},J={pillBg:"#E9D5FF",pillText:"#6B21A8",pillLockedBg:"#EDE9FE",pillLockedText:"#7C3AED",pillComingSoonBg:"#FEF3C7",pillComingSoonText:"#92400E",pillNoModuleBg:"#FFE4E6",pillNoModuleText:"#BE123C",headerText:"#1F2937",arrowBg:"#F3F4F6"},On=new Set(et.map(e=>e.id));function ye(e){return nt[e]||et.find(n=>n.id===e)?.moduleTitle||e.split("-").slice(2).join(" ").replace(/\b\w/g,n=>n.toUpperCase())}function In(e){switch(e){case"coming_soon":return{style:{backgroundColor:J.pillComingSoonBg,color:J.pillComingSoonText,cursor:"pointer"},icon:r.jsx(tt,{size:14})};case"progression_locked":return{style:{backgroundColor:J.pillLockedBg,color:J.pillLockedText,cursor:"pointer"},icon:r.jsx(Ze,{size:14})};case"no_module":return{style:{backgroundColor:J.pillNoModuleBg,color:J.pillNoModuleText,cursor:"pointer"},icon:r.jsx(Se,{size:14})};default:return{style:{backgroundColor:J.pillBg,color:J.pillText,cursor:"pointer"},icon:r.jsx(Se,{size:14})}}}const Qn=({flaggedTopics:e=[],atRiskSubjects:n=[],unlockedModuleIds:t,moduleStatusMap:i={},resolutionStateMap:s={},fallbackContentMap:a={},onTopicClick:h,onNavigateToPrerequisite:w,studentId:y})=>{const S=U.useRef(null),[v,m]=U.useState(!1),[c,$]=U.useState(null),[I,M]=U.useState({}),[F,f]=U.useState(null),[A,N]=U.useState(!1),[l,V]=U.useState(""),X=e.filter(b=>On.has(b));if(X.length===0)return null;const p=()=>{if(S.current){const{scrollLeft:b,scrollWidth:j,clientWidth:O}=S.current;m(b+O<j-10)}},R=()=>{S.current?.scrollBy({left:200,behavior:"smooth"})},x=b=>{if(s[b])return s[b];const j=i[b];return j==="coming_soon"?"coming_soon":j==="unavailable"?"no_module":(j==="available"||j==="teacher_uploaded")&&t&&!t.has(b)?"progression_locked":"accessible"},G=async b=>{if(x(b)==="accessible"){if(c===b){h?.(b);return}if($(b),!I[b]&&y){f(b);try{const O=ye(b),_=await Dt(y,b,O,"General Mathematics",.7);_.generated&&M(W=>({...W,[b]:_.tips}))}catch{}f(null)}}else V(b),N(!0)},B=l?x(l):"no_module",H=l&&a[l]||null,u=l||null;return r.jsxs(r.Fragment,{children:[r.jsxs(Ie.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"mb-4",children:[r.jsx("h3",{className:"text-base font-bold mb-3",style:{color:J.headerText},children:"Recommended for Review"}),r.jsxs("div",{className:"relative flex items-center",children:[r.jsx("div",{ref:S,onScroll:p,className:"flex gap-2 overflow-x-auto scrollbar-hide pb-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:X.slice(0,8).map((b,j)=>{const O=x(b),{style:_,icon:W}=In(O);return r.jsxs("button",{onClick:()=>G(b),title:O==="coming_soon"?"Module coming soon β tap for study brief":O==="progression_locked"?"Locked β complete previous module first":O==="no_module"?"No module yet β tap for curriculum brief":void 0,className:"flex items-center gap-1.5 px-4 py-2 rounded-full text-sm font-semibold transition-all whitespace-nowrap hover:scale-[1.02] active:scale-[0.98]",style:_,children:[W,ye(b),O==="accessible"&&r.jsx(Ve,{size:14})]},`${b}-${j}`)})}),v&&r.jsx("button",{onClick:R,className:"flex-shrink-0 ml-2 w-8 h-8 rounded-full flex items-center justify-center transition-colors",style:{backgroundColor:J.arrowBg},"aria-label":"Scroll right",children:r.jsx(Ve,{size:16,className:"text-gray-600"})})]}),r.jsx("style",{children:`
|
| 4 |
.scrollbar-hide::-webkit-scrollbar { display: none; }
|
assets/{TeacherDashboard-BlgU-Xg_.js β TeacherDashboard-Dqx3gqwf.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/{XPNotification-Ba3kZbWo.js β XPNotification-GHNILw26.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as l,b as n,j as e}from"./vendor-react-B4AQeu28.js";import{h as c,m as r,a7 as m}from"./index-
|
|
|
|
| 1 |
+
import{r as l,b as n,j as e}from"./vendor-react-B4AQeu28.js";import{h as c,m as r,a7 as m}from"./index-Bp7MiGcW.js";import{S as x}from"./sparkles-fLB3ltj1.js";import"./vendor-firebase-firestore-CNv3xXal.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const w=({xp:i,message:a,show:t,onComplete:s})=>(l.useEffect(()=>{if(t){const o=setTimeout(()=>{s()},3e3);return()=>clearTimeout(o)}},[t,s]),n.createPortal(e.jsx(c,{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},transition:{type:"spring",damping:25,stiffness:200},className:"fixed top-8 left-1/2 -translate-x-1/2 z-[300]",style:{willChange:"transform, opacity"},children:e.jsxs("div",{className:"bg-gradient-to-r from-rose-400 via-orange-500 to-rose-500 text-white px-6 py-4 rounded-2xl shadow-2xl border-2 border-rose-300 flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 bg-white/20 rounded-xl flex items-center justify-center",children:e.jsx(m,{size:20,className:"text-white",fill:"currentColor"})}),e.jsx(r.div,{className:"absolute -top-1 -right-1",animate:{rotate:[0,360]},transition:{duration:2,repeat:1/0,ease:"linear"},style:{willChange:"transform"},children:e.jsx(x,{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"]})]})]})})}),document.body));export{w as default};
|
assets/{automationService-KQFQd_ic.js β automationService-g67Xos9d.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{doc as g,collection as a,serverTimestamp as c,setDoc as l,addDoc as D,query as b,where as z,getDocs as A,updateDoc as Q,writeBatch as $}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as r,b5 as _}from"./index-
|
|
|
|
| 1 |
+
import{doc as g,collection as a,serverTimestamp as c,setDoc as l,addDoc as D,query as b,where as z,getDocs as A,updateDoc as Q,writeBatch as $}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as r,b5 as _}from"./index-Bp7MiGcW.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const m=async(e,n,o,u,i)=>{try{const t=g(a(r,"notifications")),s={id:t.id,userId:e,type:n,title:o,message:u,read:!1,...i?{actionUrl:i}:{},createdAt:new Date},d={id:s.id,userId:s.userId,type:s.type,title:s.title,message:s.message,read:s.read,createdAt:c(),link:i||null};return await l(t,{...d}),s}catch(t){throw console.error("Error creating notification:",t),t}};async function M(e){if(!e)return 0;const n=a(r,"deepDiagnosticAssignments"),o=b(n,z("lrn","==",e));return(await A(o)).docs.filter(i=>{const t=i.data().status;return t==="pending"||t==="queued"||t==="in_progress"||t==="expired"}).length}async function x(e,n,o="Grade 11",u,i="iar_only",t="initial_assessment",s){if(t==="followup_diagnostic"){const d=a(r,"deepDiagnosticAssignments"),C=b(d,z("lrn","==",e)),f=await A(C);if(!f.empty){const p=$(r);let w=!1;for(const h of f.docs){const I=h.data().status;(I==="pending"||I==="queued")&&(p.update(h.ref,{status:"in_progress",startedAt:c()}),w=!0)}w&&await p.commit()}}return await l(g(r,"diagnosticResults",e),{lrn:e,results:n,gradeLevel:o,workflowMode:i,assessmentType:t,questionBreakdown:u||null,topicBreakdown:s||null,completedAt:c(),processed:!1,processing:!1}),{success:!0,event:"diagnostic_completed",lrn:e,message:`Diagnostic submitted for ${e}. Processing will begin automatically.`,remedialQuizzesCreated:0,notifications:["Your diagnostic results are being processed. Check back shortly!"]}}async function N(e){return await D(a(r,"quizResults"),{lrn:e.lrn,studentId:e.lrn,quizId:e.quizId,subject:e.subject,score:e.score,totalQuestions:e.totalQuestions,correctAnswers:e.correctAnswers,timeSpentSeconds:e.timeSpentSeconds,answers:e.answers||null,submittedAt:c()}),{success:!0,event:"quiz_submitted",lrn:e.lrn,message:`Quiz submitted for ${e.lrn}. Risk recalculation will run automatically.`,remedialQuizzesCreated:0,notifications:[`Quiz result recorded for ${e.subject}.`]}}async function W(e){return await _(e.lrn),await m(e.lrn,"reminder","Welcome to MathPulse AI!","Complete your diagnostic assessment to get started with personalised learning."),e.teacherId&&await m(e.teacherId,"message","New Student Enrolled",`${e.name} has joined. Diagnostic assessment is pending.`),{success:!0,event:"student_enrolled",lrn:e.lrn,message:`Student ${e.name} enrolled and initialised`,remedialQuizzesCreated:0,notifications:[`Welcome ${e.name}! Please complete the diagnostic assessment.`]}}async function G(e){return await D(a(r,"dataImports"),{teacherId:e.teacherId,studentCount:e.students.length,columnMapping:e.columnMapping,importedAt:c(),processed:!1}),await m(e.teacherId,"message","Data Import Processed",`Data import complete β ${e.students.length} student records processed.`),{success:!0,event:"data_imported",message:`Data import processed for ${e.students.length} students`,remedialQuizzesCreated:0,notifications:[`Data import complete β ${e.students.length} student records processed.`]}}async function Y(e){const n=g(r,"curriculumContent",e.contentId);return e.action==="delete"?await Q(n,{deleted:!0,deletedBy:e.adminId,deletedAt:c(),contentType:e.contentType,subjectId:e.subjectId||null}):await l(n,{contentType:e.contentType,subjectId:e.subjectId||null,details:e.details||null,updatedBy:e.adminId,action:e.action,updatedAt:c()},{merge:!0}),{success:!0,event:"content_updated",message:`Content ${e.action} processed for ${e.contentType}`,remedialQuizzesCreated:0,notifications:[]}}export{M as getPendingDeepDiagnosticCount,Y as triggerContentUpdated,G as triggerDataImported,x as triggerDiagnosticCompleted,N as triggerQuizSubmitted,W as triggerStudentEnrolled};
|
assets/avatarData-BuQSOXo3.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 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_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_blue_cap",name:"Blue Cap",category:"accessory",src:"/avatar/blue_cap.png",thumbnail:"/avatar/blue_cap_thumbnail.png",isReward:!0},{id:"acc_crown",name:"Gold Crown",category:"accessory",src:"/avatar/crown.png",thumbnail:"/avatar/crown_thumbnail.png",isReward:!0},{id:"acc_mathsquad_badge",name:"MathSquad Badge",category:"accessory",src:"/avatar/mathsquad_badge.png",thumbnail:"/avatar/mathsquad_badge_thumbnail.png",isReward:!0},{id:"acc_calc_crown",name:"Calculus Crown",category:"accessory",src:"/avatar/calc_crown.png",thumbnail:"/avatar/calc_crown_thumbnail.png",isReward:!0}],n=a=>{if(a)return r.find(c=>c.id===a)?.src};export{r as M,n as g};
|
|
|
|
|
|
assets/avatarData-ChByUhv2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
const t=[{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:"top_brown_vest",name:"Brown Vest",category:"top",src:"/avatar/brown_vest.png",thumbnail:"/avatar/brown_vest_thumbnail.png",price:150},{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:"shoe_slippers",name:"Slippers",category:"shoes",src:"/avatar/slippers.png",thumbnail:"/avatar/slippers_thumbnail.png",price:100},{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:300},{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:"Gold Crown",category:"accessory",src:"/avatar/crown.png",thumbnail:"/avatar/crown_thumbnail.png",isReward:!0,isExclusive:!0},{id:"exc_naruto_set",name:"Naruto Set",category:"top",src:"/avatar/naruto_top.png",thumbnail:"/avatar/exclusive_naruto_set_thumbnail.png",isReward:!0,isExclusive:!0,setLayers:{top:"exc_naruto_top",bottom:"exc_naruto_pants",shoes:"exc_naruto_shoes",accessory:"exc_forehead_protector"}},{id:"exc_naruto_top",name:"Naruto Top",category:"top",src:"/avatar/naruto_top.png",thumbnail:"/avatar/exclusive_naruto_set_thumbnail.png",isReward:!0,isExclusive:!0},{id:"exc_naruto_pants",name:"Naruto Pants",category:"bottom",src:"/avatar/naruto_pants.png",thumbnail:"/avatar/exclusive_naruto_set_thumbnail.png",isReward:!0,isExclusive:!0},{id:"exc_naruto_shoes",name:"Naruto Shoes",category:"shoes",src:"/avatar/naruto_shoes.png",thumbnail:"/avatar/exclusive_naruto_set_thumbnail.png",isReward:!0,isExclusive:!0},{id:"exc_forehead_protector",name:"Forehead Protector",category:"accessory",src:"/avatar/forehead_protector.png",thumbnail:"/avatar/exclusive_naruto_set_thumbnail.png",isReward:!0,isExclusive:!0}],e=t.filter(a=>a.isExclusive&&a.id!=="exc_naruto_top"&&a.id!=="exc_naruto_pants"&&a.id!=="exc_naruto_shoes"&&a.id!=="exc_forehead_protector"),n=a=>{if(a)return t.find(r=>r.id===a)?.src};export{e as E,t as M,n as g};
|
assets/{bell-D9j1Gy0m.js β bell-DyLbgepV.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e}from"./index-Bp7MiGcW.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{button-DsnZWCoA.js β button-BMVm9YQO.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{j as y}from"./vendor-react-B4AQeu28.js";import{S as k}from"./vendor-radix-C5nwdvGr.js";import{c as V}from"./vendor-charts-CAmziV1y.js";import{o as p}from"./index-
|
|
|
|
| 1 |
+
import{j as y}from"./vendor-react-B4AQeu28.js";import{S as k}from"./vendor-radix-C5nwdvGr.js";import{c as V}from"./vendor-charts-CAmziV1y.js";import{o as p}from"./index-Bp7MiGcW.js";const g=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,m=V,j=(n,r)=>e=>{var o;if(r?.variants==null)return m(n,e?.class,e?.className);const{variants:u,defaultVariants:i}=r,b=Object.keys(u).map(t=>{const a=e?.[t],d=i?.[t];if(a===null)return null;const s=g(a)||g(d);return u[t][s]}),v=e&&Object.entries(e).reduce((t,a)=>{let[d,s]=a;return s===void 0||(t[d]=s),t},{}),f=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((t,a)=>{let{class:d,className:s,...h}=a;return Object.entries(h).every(x=>{let[c,l]=x;return Array.isArray(l)?l.includes({...i,...v}[c]):{...i,...v}[c]===l})?[...t,d,s]:t},[]);return m(n,b,f,e?.class,e?.className)},N=j("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}});function w({className:n,variant:r,size:e,asChild:o=!1,...u}){const i=o?k:"button";return y.jsx(i,{"data-slot":"button",className:p(N({variant:r,size:e,className:n})),...u})}export{w as B,j as c};
|
assets/{chart-column-BcVJ31XT.js β chart-column-Dyv8TfXk.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as t}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as t}from"./index-Bp7MiGcW.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chatService-BcZzFY2v.js β chatService-DgvwP4xj.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{doc as c,collection as u,getDoc as g,serverTimestamp as i,setDoc as w,updateDoc as p,query as l,where as d,orderBy as y,getDocs as A}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as a}from"./index-
|
|
|
|
| 1 |
+
import{doc as c,collection as u,getDoc as g,serverTimestamp as i,setDoc as w,updateDoc as p,query as l,where as d,orderBy as y,getDocs as A}from"./vendor-firebase-firestore-CNv3xXal.js";import{g as a}from"./index-Bp7MiGcW.js";import"./vendor-firebase-core-D7GXCeNu.js";import"./vendor-react-B4AQeu28.js";import"./vendor-firebase-auth-T_wvTOvf.js";import"./vendor-firebase-storage-Bi7H_66d.js";import"./vendor-firebase-analytics-rHarj5hR.js";import"./vendor-radix-C5nwdvGr.js";import"./vendor-charts-CAmziV1y.js";import"./vendor-markdown-yqZQ_iQm.js";const Q=async(s,t="New Conversation")=>{try{const e=c(u(a,"chatSessions")),n={id:e.id,userId:s,title:t,messages:[],createdAt:new Date,updatedAt:new Date,isActive:!0};return await w(e,{...n,createdAt:i(),updatedAt:i()}),n}catch(e){throw console.error("Error creating chat session:",e),e}},R=async s=>{try{const t=l(u(a,"chatSessions"),d("userId","==",s),d("isActive","==",!0),y("updatedAt","desc"));return(await A(t)).docs.map(n=>{const r=n.data();return{...r,createdAt:r.createdAt?.toDate()||new Date,updatedAt:r.updatedAt?.toDate()||new Date}})}catch(t){return console.error("Error getting chat sessions:",t),[]}},b=async s=>{try{const t=await g(c(a,"chatSessions",s));if(t.exists()){const e=t.data();return{...e,createdAt:e.createdAt?.toDate()||new Date,updatedAt:e.updatedAt?.toDate()||new Date}}return null}catch(t){return console.error("Error getting chat session:",t),null}},q=async(s,t,e,n)=>{try{const r=c(u(a,"chatMessages")),o={id:r.id,userId:"",role:t,content:e,timestamp:new Date,...n?{context:n}:{}},m=await g(c(a,"chatSessions",s));m.exists()&&(o.userId=m.data().userId);const h={id:o.id,userId:o.userId,role:o.role,content:o.content,sessionId:s,timestamp:i()};return o.context&&(h.context=o.context),await w(r,h),await p(c(a,"chatSessions",s),{updatedAt:i()}),o}catch(r){throw console.error("Error adding message:",r),r}},B=async(s,t)=>{try{const e=l(u(a,"chatMessages"),d("sessionId","==",s),d("userId","==",t),y("timestamp","asc"));return(await A(e)).docs.map(r=>{const o=r.data();return{...o,timestamp:o.timestamp?.toDate()||new Date}})}catch(e){return console.error("Error getting session messages:",e),[]}},N=async(s,t)=>{try{await p(c(a,"chatSessions",s),{title:t,updatedAt:i()})}catch(e){throw console.error("Error updating session title:",e),e}},U=async s=>{try{await p(c(a,"chatSessions",s),{isActive:!1,updatedAt:i()})}catch(t){throw console.error("Error deleting session:",t),t}};export{q as addMessageToSession,Q as createChatSession,U as deleteSession,b as getChatSession,B as getSessionMessages,R as getUserChatSessions,N as updateSessionTitle};
|
assets/{check-B-qbiSF7.js β check-qsSFTYCr.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as c}from"./index-Bp7MiGcW.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chevron-left-DMbkPbec.js β chevron-left-Be5knpOV.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e}from"./index-Bp7MiGcW.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chevron-right-DADygX42.js β chevron-right-BxoysOas.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as o}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as o}from"./index-Bp7MiGcW.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{chevron-up-CoNRuMZ7.js β chevron-up-DtS9MvUZ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as o}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as o}from"./index-Bp7MiGcW.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{circle-alert-DDdeEgNa.js β circle-alert-CHGy8HcB.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e}from"./index-Bp7MiGcW.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{circle-check-BzgmgbHa.js β circle-check-DzQphSnP.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as c}from"./index-Bp7MiGcW.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{circle-check-big-CDg2qLfH.js β circle-check-big-JdaMs3bP.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as c}from"./index-Bp7MiGcW.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
assets/{circle-help-DNA0h1v1.js β circle-help-CLCoBWDy.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{e as c}from"./index-
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|
|
|
|
| 1 |
+
import{e as c}from"./index-Bp7MiGcW.js";/**
|
| 2 |
* @license lucide-react v0.487.0 - ISC
|
| 3 |
*
|
| 4 |
* This source code is licensed under the ISC license.
|